diff --git a/api.md b/api.md index 2aad28dcc7..1c72973d0c 100644 --- a/api.md +++ b/api.md @@ -888,16 +888,16 @@ Methods: - client.zones.settings.waf.edit({ ...params }) -> ZonesWAF - client.zones.settings.waf.get({ ...params }) -> ZonesWAF -### Webp +### WebP Types: -- ZonesWebp +- ZonesWebP Methods: -- client.zones.settings.webp.edit({ ...params }) -> ZonesWebp -- client.zones.settings.webp.get({ ...params }) -> ZonesWebp +- client.zones.settings.WebP.edit({ ...params }) -> ZonesWebP +- client.zones.settings.WebP.get({ ...params }) -> ZonesWebP ### Websocket @@ -1302,28 +1302,28 @@ Methods: - client.argo.tieredCaching.edit({ ...params }) -> TieredCachingEditResponse - client.argo.tieredCaching.get({ ...params }) -> TieredCachingGetResponse -# AvailablePlans +# Plans Types: -- BillSubsAPIAvailableRatePlan -- AvailablePlanListResponse +- BillSubsAPIAvailableRatePlan +- PlanListResponse Methods: -- client.availablePlans.list(zoneIdentifier) -> AvailablePlanListResponse | null -- client.availablePlans.get(zoneIdentifier, planIdentifier) -> BillSubsAPIAvailableRatePlan +- client.plans.list(zoneIdentifier) -> PlanListResponse | null +- client.plans.get(zoneIdentifier, planIdentifier) -> BillSubsAPIAvailableRatePlan -# AvailableRatePlans +# RatePlans Types: -- BillSubsRatePlan -- AvailableRatePlanGetResponse +- BillSubsRatePlan +- RatePlanGetResponse Methods: -- client.availableRatePlans.get(zoneIdentifier) -> AvailableRatePlanGetResponse | null +- client.ratePlans.get(zoneIdentifier) -> RatePlanGetResponse | null # CertificateAuthorities @@ -1521,78 +1521,76 @@ Methods: # EmailRouting -## Routing - Types: -- EmailSettings -- RoutingDisableResponse -- RoutingEnableResponse -- RoutingGetResponse +- EmailSettings +- EmailRoutingDisableResponse +- EmailRoutingEnableResponse +- EmailRoutingGetResponse Methods: -- client.emailRouting.routing.disable(zoneIdentifier) -> RoutingDisableResponse -- client.emailRouting.routing.enable(zoneIdentifier) -> RoutingEnableResponse -- client.emailRouting.routing.get(zoneIdentifier) -> RoutingGetResponse +- client.emailRouting.disable(zoneIdentifier) -> EmailRoutingDisableResponse +- client.emailRouting.enable(zoneIdentifier) -> EmailRoutingEnableResponse +- client.emailRouting.get(zoneIdentifier) -> EmailRoutingGetResponse -### DNS +## DNS Types: -- EmailDNSRecord -- DNSGetResponse +- EmailDNSRecord +- DNSGetResponse Methods: -- client.emailRouting.routing.dns.get(zoneIdentifier) -> DNSGetResponse | null +- client.emailRouting.dns.get(zoneIdentifier) -> DNSGetResponse | null -### Rules +## Rules Types: -- EmailRules -- RuleCreateResponse -- RuleUpdateResponse -- RuleListResponse -- RuleDeleteResponse -- RuleGetResponse +- EmailRules +- RuleCreateResponse +- RuleUpdateResponse +- RuleListResponse +- RuleDeleteResponse +- RuleGetResponse Methods: -- client.emailRouting.routing.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse -- client.emailRouting.routing.rules.update(zoneIdentifier, ruleIdentifier, { ...params }) -> RuleUpdateResponse -- client.emailRouting.routing.rules.list(zoneIdentifier, { ...params }) -> RuleListResponsesV4PagePaginationArray -- client.emailRouting.routing.rules.delete(zoneIdentifier, ruleIdentifier) -> RuleDeleteResponse -- client.emailRouting.routing.rules.get(zoneIdentifier, ruleIdentifier) -> RuleGetResponse +- client.emailRouting.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse +- client.emailRouting.rules.update(zoneIdentifier, ruleIdentifier, { ...params }) -> RuleUpdateResponse +- client.emailRouting.rules.list(zoneIdentifier, { ...params }) -> RuleListResponsesV4PagePaginationArray +- client.emailRouting.rules.delete(zoneIdentifier, ruleIdentifier) -> RuleDeleteResponse +- client.emailRouting.rules.get(zoneIdentifier, ruleIdentifier) -> RuleGetResponse -#### CatchAlls +### CatchAlls Types: -- EmailCatchAllRule +- EmailCatchAllRule Methods: -- client.emailRouting.routing.rules.catchAlls.update(zoneIdentifier, { ...params }) -> EmailCatchAllRule -- client.emailRouting.routing.rules.catchAlls.get(zoneIdentifier) -> EmailCatchAllRule +- client.emailRouting.rules.catchAlls.update(zoneIdentifier, { ...params }) -> EmailCatchAllRule +- client.emailRouting.rules.catchAlls.get(zoneIdentifier) -> EmailCatchAllRule -### Addresses +## Addresses Types: -- EmailAddresses -- AddressCreateResponse -- AddressListResponse -- AddressDeleteResponse -- AddressGetResponse +- EmailAddresses +- AddressCreateResponse +- AddressListResponse +- AddressDeleteResponse +- AddressGetResponse Methods: -- client.emailRouting.routing.addresses.create(accountIdentifier, { ...params }) -> AddressCreateResponse -- client.emailRouting.routing.addresses.list(accountIdentifier, { ...params }) -> AddressListResponsesV4PagePaginationArray -- client.emailRouting.routing.addresses.delete(accountIdentifier, destinationAddressIdentifier) -> AddressDeleteResponse -- client.emailRouting.routing.addresses.get(accountIdentifier, destinationAddressIdentifier) -> AddressGetResponse +- client.emailRouting.addresses.create(accountIdentifier, { ...params }) -> AddressCreateResponse +- client.emailRouting.addresses.list(accountIdentifier, { ...params }) -> AddressListResponsesV4PagePaginationArray +- client.emailRouting.addresses.delete(accountIdentifier, destinationAddressIdentifier) -> AddressDeleteResponse +- client.emailRouting.addresses.get(accountIdentifier, destinationAddressIdentifier) -> AddressGetResponse # Filters @@ -1892,15 +1890,15 @@ Methods: - client.logs.control.cmb.config.delete({ ...params }) -> ConfigDeleteResponse | null - client.logs.control.cmb.config.get({ ...params }) -> LogcontrolCmbConfig | null -## Rayid +## RayID Types: -- RayidGetResponse +- RayIDGetResponse Methods: -- client.logs.rayid.get(zoneIdentifier, rayIdentifier, { ...params }) -> RayidGetResponse +- client.logs.RayID.get(zoneIdentifier, rayIdentifier, { ...params }) -> RayIDGetResponse ## Received @@ -2721,11 +2719,11 @@ Methods: - client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void - client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> RulesetsRulesetResponse -### ByTags +### ByTag Methods: -- client.rulesets.versions.byTags.get(rulesetId, rulesetVersion, ruleTag, { ...params }) -> RulesetsRulesetResponse +- client.rulesets.versions.byTag.get(rulesetId, rulesetVersion, ruleTag, { ...params }) -> RulesetsRulesetResponse # URLNormalization @@ -3370,41 +3368,41 @@ Methods: - client.magicTransit.sites.acls.delete(siteId, aclIdentifier, { ...params }) -> ACLDeleteResponse - client.magicTransit.sites.acls.get(siteId, aclIdentifier, { ...params }) -> ACLGetResponse -### Lans +### LANs Types: -- LanCreateResponse -- LanUpdateResponse -- LanListResponse -- LanDeleteResponse -- LanGetResponse +- LANCreateResponse +- LANUpdateResponse +- LANListResponse +- LANDeleteResponse +- LANGetResponse Methods: -- client.magicTransit.sites.lans.create(siteId, { ...params }) -> LanCreateResponse -- client.magicTransit.sites.lans.update(siteId, lanId, { ...params }) -> LanUpdateResponse -- client.magicTransit.sites.lans.list(siteId, { ...params }) -> LanListResponse -- client.magicTransit.sites.lans.delete(siteId, lanId, { ...params }) -> LanDeleteResponse -- client.magicTransit.sites.lans.get(siteId, lanId, { ...params }) -> LanGetResponse +- client.magicTransit.sites.lans.create(siteId, { ...params }) -> LANCreateResponse +- client.magicTransit.sites.lans.update(siteId, lanId, { ...params }) -> LANUpdateResponse +- client.magicTransit.sites.lans.list(siteId, { ...params }) -> LANListResponse +- client.magicTransit.sites.lans.delete(siteId, lanId, { ...params }) -> LANDeleteResponse +- client.magicTransit.sites.lans.get(siteId, lanId, { ...params }) -> LANGetResponse -### Wans +### WANs Types: -- WanCreateResponse -- WanUpdateResponse -- WanListResponse -- WanDeleteResponse -- WanGetResponse +- WANCreateResponse +- WANUpdateResponse +- WANListResponse +- WANDeleteResponse +- WANGetResponse Methods: -- client.magicTransit.sites.wans.create(siteId, { ...params }) -> WanCreateResponse -- client.magicTransit.sites.wans.update(siteId, wanId, { ...params }) -> WanUpdateResponse -- client.magicTransit.sites.wans.list(siteId, { ...params }) -> WanListResponse -- client.magicTransit.sites.wans.delete(siteId, wanId, { ...params }) -> WanDeleteResponse -- client.magicTransit.sites.wans.get(siteId, wanId, { ...params }) -> WanGetResponse +- client.magicTransit.sites.wans.create(siteId, { ...params }) -> WANCreateResponse +- client.magicTransit.sites.wans.update(siteId, wanId, { ...params }) -> WANUpdateResponse +- client.magicTransit.sites.wans.list(siteId, { ...params }) -> WANListResponse +- client.magicTransit.sites.wans.delete(siteId, wanId, { ...params }) -> WANDeleteResponse +- client.magicTransit.sites.wans.get(siteId, wanId, { ...params }) -> WANGetResponse # MagicNetworkMonitoring @@ -3563,25 +3561,25 @@ Methods: - client.pcaps.list({ ...params }) -> PCAPListResponse | null - client.pcaps.get(pcapId, { ...params }) -> PCAPGetResponse -## Ownerships +## Ownership Types: -- MagicVisibilityPCAPsOwnership -- OwnershipGetResponse +- MagicVisibilityPCAPsOwnership +- OwnershipGetResponse Methods: -- client.pcaps.ownerships.create({ ...params }) -> MagicVisibilityPCAPsOwnership -- client.pcaps.ownerships.delete(ownershipId, { ...params }) -> void -- client.pcaps.ownerships.get({ ...params }) -> OwnershipGetResponse | null -- client.pcaps.ownerships.validate({ ...params }) -> MagicVisibilityPCAPsOwnership +- client.pcaps.ownership.create({ ...params }) -> MagicVisibilityPCAPsOwnership +- client.pcaps.ownership.delete(ownershipId, { ...params }) -> void +- client.pcaps.ownership.get({ ...params }) -> OwnershipGetResponse | null +- client.pcaps.ownership.validate({ ...params }) -> MagicVisibilityPCAPsOwnership -## Downloads +## Download Methods: -- client.pcaps.downloads.get(pcapId, { ...params }) -> Response +- client.pcaps.download.get(pcapId, { ...params }) -> Response # Registrar @@ -3712,31 +3710,31 @@ Methods: - client.stream.videos.storageUsage({ ...params }) -> VideoStorageUsageResponse -## Clips +## Clip Types: -- StreamClipping +- StreamClipping Methods: -- client.stream.clips.create({ ...params }) -> StreamClipping +- client.stream.clip.create({ ...params }) -> StreamClipping -## Copies +## Copy Methods: -- client.stream.copies.create({ ...params }) -> StreamVideos +- client.stream.copy.create({ ...params }) -> StreamVideos -## DirectUploads +## DirectUpload Types: -- DirectUploadCreateResponse +- DirectUploadCreateResponse Methods: -- client.stream.directUploads.create({ ...params }) -> DirectUploadCreateResponse +- client.stream.directUpload.create({ ...params }) -> DirectUploadCreateResponse ## Keys @@ -3841,112 +3839,112 @@ Methods: - client.stream.downloads.delete(identifier, { ...params }) -> DownloadDeleteResponse - client.stream.downloads.get(identifier, { ...params }) -> DownloadGetResponse -## Embeds +## Embed Types: -- EmbedGetResponse +- EmbedGetResponse Methods: -- client.stream.embeds.get(identifier, { ...params }) -> unknown +- client.stream.embed.get(identifier, { ...params }) -> unknown -## Tokens +## Token Types: -- TokenCreateResponse +- TokenCreateResponse Methods: -- client.stream.tokens.create(identifier, { ...params }) -> TokenCreateResponse +- client.stream.token.create(identifier, { ...params }) -> TokenCreateResponse # Alerting -## V3 +## AvailableAlerts Types: -- V3ListResponse +- AvailableAlertListResponse Methods: -- client.alerting.v3.list({ ...params }) -> V3ListResponse | null +- client.alerting.availableAlerts.list({ ...params }) -> AvailableAlertListResponse | null -### Destinations +## Destinations -#### Eligible +### Eligible Types: -- EligibleGetResponse +- EligibleGetResponse Methods: -- client.alerting.v3.destinations.eligible.get({ ...params }) -> EligibleGetResponse | null +- client.alerting.destinations.eligible.get({ ...params }) -> EligibleGetResponse | null -#### Pagerduty +### Pagerduty Types: -- AaaPagerduty -- PagerdutyCreateResponse -- PagerdutyDeleteResponse -- PagerdutyGetResponse -- PagerdutyLinkResponse +- AaaPagerduty +- PagerdutyCreateResponse +- PagerdutyDeleteResponse +- PagerdutyGetResponse +- PagerdutyLinkResponse Methods: -- client.alerting.v3.destinations.pagerduty.create({ ...params }) -> PagerdutyCreateResponse -- client.alerting.v3.destinations.pagerduty.delete({ ...params }) -> PagerdutyDeleteResponse | null -- client.alerting.v3.destinations.pagerduty.get({ ...params }) -> PagerdutyGetResponse | null -- client.alerting.v3.destinations.pagerduty.link(tokenId, { ...params }) -> PagerdutyLinkResponse +- client.alerting.destinations.pagerduty.create({ ...params }) -> PagerdutyCreateResponse +- client.alerting.destinations.pagerduty.delete({ ...params }) -> PagerdutyDeleteResponse | null +- client.alerting.destinations.pagerduty.get({ ...params }) -> PagerdutyGetResponse | null +- client.alerting.destinations.pagerduty.link(tokenId, { ...params }) -> PagerdutyLinkResponse -#### Webhooks +### Webhooks Types: -- AaaWebhooks -- WebhookCreateResponse -- WebhookUpdateResponse -- WebhookListResponse -- WebhookDeleteResponse +- AaaWebhooks +- WebhookCreateResponse +- WebhookUpdateResponse +- WebhookListResponse +- WebhookDeleteResponse Methods: -- client.alerting.v3.destinations.webhooks.create({ ...params }) -> WebhookCreateResponse -- client.alerting.v3.destinations.webhooks.update(webhookId, { ...params }) -> WebhookUpdateResponse -- client.alerting.v3.destinations.webhooks.list({ ...params }) -> WebhookListResponse | null -- client.alerting.v3.destinations.webhooks.delete(webhookId, { ...params }) -> WebhookDeleteResponse | null -- client.alerting.v3.destinations.webhooks.get(webhookId, { ...params }) -> AaaWebhooks +- client.alerting.destinations.webhooks.create({ ...params }) -> WebhookCreateResponse +- client.alerting.destinations.webhooks.update(webhookId, { ...params }) -> WebhookUpdateResponse +- client.alerting.destinations.webhooks.list({ ...params }) -> WebhookListResponse | null +- client.alerting.destinations.webhooks.delete(webhookId, { ...params }) -> WebhookDeleteResponse | null +- client.alerting.destinations.webhooks.get(webhookId, { ...params }) -> AaaWebhooks -### Histories +## History Types: -- AaaHistory +- AaaHistory Methods: -- client.alerting.v3.histories.list({ ...params }) -> AaaHistoriesV4PagePaginationArray +- client.alerting.history.list({ ...params }) -> AaaHistoriesV4PagePaginationArray -### Policies +## Policies Types: -- AaaPolicies -- PolicyCreateResponse -- PolicyUpdateResponse -- PolicyListResponse -- PolicyDeleteResponse +- AaaPolicies +- PolicyCreateResponse +- PolicyUpdateResponse +- PolicyListResponse +- PolicyDeleteResponse Methods: -- client.alerting.v3.policies.create({ ...params }) -> PolicyCreateResponse -- client.alerting.v3.policies.update(policyId, { ...params }) -> PolicyUpdateResponse -- client.alerting.v3.policies.list({ ...params }) -> PolicyListResponse | null -- client.alerting.v3.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse | null -- client.alerting.v3.policies.get(policyId, { ...params }) -> AaaPolicies +- client.alerting.policies.create({ ...params }) -> PolicyCreateResponse +- client.alerting.policies.update(policyId, { ...params }) -> PolicyUpdateResponse +- client.alerting.policies.list({ ...params }) -> PolicyListResponse | null +- client.alerting.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse | null +- client.alerting.policies.get(policyId, { ...params }) -> AaaPolicies # D1 @@ -4051,34 +4049,32 @@ Methods: ##### Content -###### Scripts - Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.update(dispatchNamespace, scriptName, { ...params }) -> WorkersScript -- client.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.get(dispatchNamespace, scriptName, { ...params }) -> Response +- client.workersForPlatforms.dispatch.namespaces.scripts.content.update(dispatchNamespace, scriptName, { ...params }) -> WorkersScript +- client.workersForPlatforms.dispatch.namespaces.scripts.content.get(dispatchNamespace, scriptName, { ...params }) -> Response -###### Settings +##### Settings Types: -- SettingEditResponse -- SettingGetResponse +- SettingEditResponse +- SettingGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.settings.edit(dispatchNamespace, scriptName, { ...params }) -> SettingEditResponse -- client.workersForPlatforms.dispatch.namespaces.scripts.content.settings.get(dispatchNamespace, scriptName, { ...params }) -> SettingGetResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.settings.edit(dispatchNamespace, scriptName, { ...params }) -> SettingEditResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.settings.get(dispatchNamespace, scriptName, { ...params }) -> SettingGetResponse -###### Bindings +##### Bindings Types: -- BindingGetResponse +- BindingGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.bindings.get(dispatchNamespace, scriptName, { ...params }) -> BindingGetResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.bindings.get(dispatchNamespace, scriptName, { ...params }) -> BindingGetResponse # ZeroTrust @@ -4230,15 +4226,15 @@ Methods: - client.zeroTrust.devices.posture.integrations.edit(integrationId, { ...params }) -> TeamsDevicesDevicePostureIntegrations | null - client.zeroTrust.devices.posture.integrations.get(integrationId, { ...params }) -> TeamsDevicesDevicePostureIntegrations | null -### Revokes +### Revoke Types: -- RevokeCreateResponse +- RevokeCreateResponse Methods: -- client.zeroTrust.devices.revokes.create([ ...body ]) -> RevokeCreateResponse | null +- client.zeroTrust.devices.revoke.create([ ...body ]) -> RevokeCreateResponse | null ### Settings @@ -4251,15 +4247,15 @@ Methods: - client.zeroTrust.devices.settings.update({ ...params }) -> TeamsDevicesZeroTrustAccountDeviceSettings | null - client.zeroTrust.devices.settings.list({ ...params }) -> TeamsDevicesZeroTrustAccountDeviceSettings | null -### Unrevokes +### Unrevoke Types: -- UnrevokeCreateResponse +- UnrevokeCreateResponse Methods: -- client.zeroTrust.devices.unrevokes.create([ ...body ]) -> UnrevokeCreateResponse | null +- client.zeroTrust.devices.unrevoke.create([ ...body ]) -> UnrevokeCreateResponse | null ### OverrideCodes @@ -5062,20 +5058,20 @@ Methods: # RUM -## SiteInfos +## SiteInfo Types: -- RUMSite -- SiteInfoDeleteResponse +- RUMSite +- SiteInfoDeleteResponse Methods: -- client.rum.siteInfos.create({ ...params }) -> RUMSite -- client.rum.siteInfos.update(siteId, { ...params }) -> RUMSite -- client.rum.siteInfos.list({ ...params }) -> RUMSitesV4PagePaginationArray -- client.rum.siteInfos.delete(siteId, { ...params }) -> SiteInfoDeleteResponse -- client.rum.siteInfos.get(siteId, { ...params }) -> RUMSite +- client.rum.siteInfo.create({ ...params }) -> RUMSite +- client.rum.siteInfo.update(siteId, { ...params }) -> RUMSite +- client.rum.siteInfo.list({ ...params }) -> RUMSitesV4PagePaginationArray +- client.rum.siteInfo.delete(siteId, { ...params }) -> SiteInfoDeleteResponse +- client.rum.siteInfo.get(siteId, { ...params }) -> RUMSite ## Rules diff --git a/src/index.ts b/src/index.ts index a13058372b..a3bc063328 100644 --- a/src/index.ts +++ b/src/index.ts @@ -154,8 +154,8 @@ export class Cloudflare extends Core.APIClient { subscriptions: API.Subscriptions = new API.Subscriptions(this); acm: API.ACM = new API.ACM(this); argo: API.Argo = new API.Argo(this); - availablePlans: API.AvailablePlans = new API.AvailablePlans(this); - availableRatePlans: API.AvailableRatePlans = new API.AvailableRatePlans(this); + plans: API.Plans = new API.Plans(this); + ratePlans: API.RatePlans = new API.RatePlans(this); certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this); clientCertificates: API.ClientCertificates = new API.ClientCertificates(this); customCertificates: API.CustomCertificates = new API.CustomCertificates(this); @@ -467,13 +467,13 @@ export namespace Cloudflare { export import Argo = API.Argo; - export import AvailablePlans = API.AvailablePlans; + export import Plans = API.Plans; export import BillSubsAPIAvailableRatePlan = API.BillSubsAPIAvailableRatePlan; - export import AvailablePlanListResponse = API.AvailablePlanListResponse; + export import PlanListResponse = API.PlanListResponse; - export import AvailableRatePlans = API.AvailableRatePlans; + export import RatePlans = API.RatePlans; export import BillSubsRatePlan = API.BillSubsRatePlan; - export import AvailableRatePlanGetResponse = API.AvailableRatePlanGetResponse; + export import RatePlanGetResponse = API.RatePlanGetResponse; export import CertificateAuthorities = API.CertificateAuthorities; @@ -535,6 +535,10 @@ export namespace Cloudflare { export import DNSSECGetParams = API.DNSSECGetParams; export import EmailRouting = API.EmailRouting; + export import EmailSettings = API.EmailSettings; + export import EmailRoutingDisableResponse = API.EmailRoutingDisableResponse; + export import EmailRoutingEnableResponse = API.EmailRoutingEnableResponse; + export import EmailRoutingGetResponse = API.EmailRoutingGetResponse; export import Filters = API.Filters; export import LegacyJhsFilter = API.LegacyJhsFilter; diff --git a/src/resources/alerting/alerting.ts b/src/resources/alerting/alerting.ts index 8d095a5266..7baa9e91ee 100644 --- a/src/resources/alerting/alerting.ts +++ b/src/resources/alerting/alerting.ts @@ -1,14 +1,36 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; -import * as V3API from 'cloudflare/resources/alerting/v3/v3'; +import * as AvailableAlertsAPI from 'cloudflare/resources/alerting/available-alerts'; +import * as HistoryAPI from 'cloudflare/resources/alerting/history'; +import * as PoliciesAPI from 'cloudflare/resources/alerting/policies'; +import * as DestinationsAPI from 'cloudflare/resources/alerting/destinations/destinations'; export class Alerting extends APIResource { - v3: V3API.V3 = new V3API.V3(this._client); + availableAlerts: AvailableAlertsAPI.AvailableAlerts = new AvailableAlertsAPI.AvailableAlerts(this._client); + destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); + history: HistoryAPI.History = new HistoryAPI.History(this._client); + policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); } export namespace Alerting { - export import V3 = V3API.V3; - export import V3ListResponse = V3API.V3ListResponse; - export import V3ListParams = V3API.V3ListParams; + export import AvailableAlerts = AvailableAlertsAPI.AvailableAlerts; + export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse; + export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams; + export import Destinations = DestinationsAPI.Destinations; + export import History = HistoryAPI.History; + export import AaaHistory = HistoryAPI.AaaHistory; + export import AaaHistoriesV4PagePaginationArray = HistoryAPI.AaaHistoriesV4PagePaginationArray; + export import HistoryListParams = HistoryAPI.HistoryListParams; + export import Policies = PoliciesAPI.Policies; + export import AaaPolicies = PoliciesAPI.AaaPolicies; + export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; + export import PolicyListResponse = PoliciesAPI.PolicyListResponse; + export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; + export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; + export import PolicyListParams = PoliciesAPI.PolicyListParams; + export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; + export import PolicyGetParams = PoliciesAPI.PolicyGetParams; } diff --git a/src/resources/alerting/available-alerts.ts b/src/resources/alerting/available-alerts.ts new file mode 100644 index 0000000000..ece9bd30c2 --- /dev/null +++ b/src/resources/alerting/available-alerts.ts @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import * as Core from 'cloudflare/core'; +import { APIResource } from 'cloudflare/resource'; +import * as AvailableAlertsAPI from 'cloudflare/resources/alerting/available-alerts'; + +export class AvailableAlerts extends APIResource { + /** + * Gets a list of all alert types for which an account is eligible. + */ + list( + params: AvailableAlertListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options) as Core.APIPromise<{ + result: AvailableAlertListResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type AvailableAlertListResponse = unknown | Array | string; + +export interface AvailableAlertListParams { + /** + * The account id + */ + account_id: string; +} + +export namespace AvailableAlerts { + export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse; + export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams; +} diff --git a/src/resources/alerting/v3/destinations/destinations.ts b/src/resources/alerting/destinations/destinations.ts similarity index 88% rename from src/resources/alerting/v3/destinations/destinations.ts rename to src/resources/alerting/destinations/destinations.ts index 248b4e9393..650879b0c7 100644 --- a/src/resources/alerting/v3/destinations/destinations.ts +++ b/src/resources/alerting/destinations/destinations.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; -import * as EligibleAPI from 'cloudflare/resources/alerting/v3/destinations/eligible'; -import * as PagerdutyAPI from 'cloudflare/resources/alerting/v3/destinations/pagerduty'; -import * as WebhooksAPI from 'cloudflare/resources/alerting/v3/destinations/webhooks'; +import * as EligibleAPI from 'cloudflare/resources/alerting/destinations/eligible'; +import * as PagerdutyAPI from 'cloudflare/resources/alerting/destinations/pagerduty'; +import * as WebhooksAPI from 'cloudflare/resources/alerting/destinations/webhooks'; export class Destinations extends APIResource { eligible: EligibleAPI.Eligible = new EligibleAPI.Eligible(this._client); diff --git a/src/resources/alerting/v3/destinations/eligible.ts b/src/resources/alerting/destinations/eligible.ts similarity index 92% rename from src/resources/alerting/v3/destinations/eligible.ts rename to src/resources/alerting/destinations/eligible.ts index 196d105a56..2d6ea0a8d9 100644 --- a/src/resources/alerting/v3/destinations/eligible.ts +++ b/src/resources/alerting/destinations/eligible.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as EligibleAPI from 'cloudflare/resources/alerting/v3/destinations/eligible'; +import * as EligibleAPI from 'cloudflare/resources/alerting/destinations/eligible'; export class Eligible extends APIResource { /** diff --git a/src/resources/alerting/v3/destinations/index.ts b/src/resources/alerting/destinations/index.ts similarity index 100% rename from src/resources/alerting/v3/destinations/index.ts rename to src/resources/alerting/destinations/index.ts diff --git a/src/resources/alerting/v3/destinations/pagerduty.ts b/src/resources/alerting/destinations/pagerduty.ts similarity index 97% rename from src/resources/alerting/v3/destinations/pagerduty.ts rename to src/resources/alerting/destinations/pagerduty.ts index faab967c65..61aad316d1 100644 --- a/src/resources/alerting/v3/destinations/pagerduty.ts +++ b/src/resources/alerting/destinations/pagerduty.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as PagerdutyAPI from 'cloudflare/resources/alerting/v3/destinations/pagerduty'; +import * as PagerdutyAPI from 'cloudflare/resources/alerting/destinations/pagerduty'; export class Pagerduty extends APIResource { /** diff --git a/src/resources/alerting/v3/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts similarity index 98% rename from src/resources/alerting/v3/destinations/webhooks.ts rename to src/resources/alerting/destinations/webhooks.ts index c49a049290..01331edb85 100644 --- a/src/resources/alerting/v3/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as WebhooksAPI from 'cloudflare/resources/alerting/v3/destinations/webhooks'; +import * as WebhooksAPI from 'cloudflare/resources/alerting/destinations/webhooks'; export class Webhooks extends APIResource { /** diff --git a/src/resources/alerting/v3/histories.ts b/src/resources/alerting/history.ts similarity index 86% rename from src/resources/alerting/v3/histories.ts rename to src/resources/alerting/history.ts index 0823ccd71e..211f3ba796 100644 --- a/src/resources/alerting/v3/histories.ts +++ b/src/resources/alerting/history.ts @@ -2,10 +2,10 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as HistoriesAPI from 'cloudflare/resources/alerting/v3/histories'; +import * as HistoryAPI from 'cloudflare/resources/alerting/history'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; -export class Histories extends APIResource { +export class History extends APIResource { /** * Gets a list of history records for notifications sent to an account. The records * are displayed for last `x` number of days based on the zone plan (free = 30, pro @@ -93,8 +93,8 @@ export interface HistoryListParams extends V4PagePaginationArrayParams { since?: string; } -export namespace Histories { - export import AaaHistory = HistoriesAPI.AaaHistory; - export import AaaHistoriesV4PagePaginationArray = HistoriesAPI.AaaHistoriesV4PagePaginationArray; - export import HistoryListParams = HistoriesAPI.HistoryListParams; +export namespace History { + export import AaaHistory = HistoryAPI.AaaHistory; + export import AaaHistoriesV4PagePaginationArray = HistoryAPI.AaaHistoriesV4PagePaginationArray; + export import HistoryListParams = HistoryAPI.HistoryListParams; } diff --git a/src/resources/alerting/index.ts b/src/resources/alerting/index.ts index dd6d880829..7f564ce415 100644 --- a/src/resources/alerting/index.ts +++ b/src/resources/alerting/index.ts @@ -1,4 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { AaaHistory, HistoryListParams, AaaHistoriesV4PagePaginationArray, History } from './history'; +export { + AaaPolicies, + PolicyCreateResponse, + PolicyUpdateResponse, + PolicyListResponse, + PolicyDeleteResponse, + PolicyCreateParams, + PolicyUpdateParams, + PolicyListParams, + PolicyDeleteParams, + PolicyGetParams, + Policies, +} from './policies'; export { Alerting } from './alerting'; -export { V3ListResponse, V3ListParams, V3 } from './v3/index'; +export { AvailableAlertListResponse, AvailableAlertListParams, AvailableAlerts } from './available-alerts'; +export { Destinations } from './destinations/index'; diff --git a/src/resources/alerting/v3/policies.ts b/src/resources/alerting/policies.ts similarity index 99% rename from src/resources/alerting/v3/policies.ts rename to src/resources/alerting/policies.ts index 21bc36e66b..f17b4b2d7f 100644 --- a/src/resources/alerting/v3/policies.ts +++ b/src/resources/alerting/policies.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as PoliciesAPI from 'cloudflare/resources/alerting/v3/policies'; +import * as PoliciesAPI from 'cloudflare/resources/alerting/policies'; export class Policies extends APIResource { /** diff --git a/src/resources/alerting/v3/index.ts b/src/resources/alerting/v3/index.ts deleted file mode 100644 index 5ec70aa5ba..0000000000 --- a/src/resources/alerting/v3/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { AaaHistory, HistoryListParams, AaaHistoriesV4PagePaginationArray, Histories } from './histories'; -export { - AaaPolicies, - PolicyCreateResponse, - PolicyUpdateResponse, - PolicyListResponse, - PolicyDeleteResponse, - PolicyCreateParams, - PolicyUpdateParams, - PolicyListParams, - PolicyDeleteParams, - PolicyGetParams, - Policies, -} from './policies'; -export { Destinations } from './destinations/index'; -export { V3ListResponse, V3ListParams, V3 } from './v3'; diff --git a/src/resources/alerting/v3/v3.ts b/src/resources/alerting/v3/v3.ts deleted file mode 100644 index 6021da92ac..0000000000 --- a/src/resources/alerting/v3/v3.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as V3API from 'cloudflare/resources/alerting/v3/v3'; -import * as HistoriesAPI from 'cloudflare/resources/alerting/v3/histories'; -import * as PoliciesAPI from 'cloudflare/resources/alerting/v3/policies'; -import * as DestinationsAPI from 'cloudflare/resources/alerting/v3/destinations/destinations'; - -export class V3 extends APIResource { - destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); - histories: HistoriesAPI.Histories = new HistoriesAPI.Histories(this._client); - policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); - - /** - * Gets a list of all alert types for which an account is eligible. - */ - list(params: V3ListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options) as Core.APIPromise<{ - result: V3ListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export type V3ListResponse = unknown | Array | string; - -export interface V3ListParams { - /** - * The account id - */ - account_id: string; -} - -export namespace V3 { - export import V3ListResponse = V3API.V3ListResponse; - export import V3ListParams = V3API.V3ListParams; - export import Destinations = DestinationsAPI.Destinations; - export import Histories = HistoriesAPI.Histories; - export import AaaHistory = HistoriesAPI.AaaHistory; - export import AaaHistoriesV4PagePaginationArray = HistoriesAPI.AaaHistoriesV4PagePaginationArray; - export import HistoryListParams = HistoriesAPI.HistoryListParams; - export import Policies = PoliciesAPI.Policies; - export import AaaPolicies = PoliciesAPI.AaaPolicies; - export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; - export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; - export import PolicyListResponse = PoliciesAPI.PolicyListResponse; - export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; - export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; - export import PolicyListParams = PoliciesAPI.PolicyListParams; - export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; - export import PolicyGetParams = PoliciesAPI.PolicyGetParams; -} diff --git a/src/resources/email-routing/routing/addresses.ts b/src/resources/email-routing/addresses.ts similarity index 99% rename from src/resources/email-routing/routing/addresses.ts rename to src/resources/email-routing/addresses.ts index 4bb515d146..d0fbd9ad62 100644 --- a/src/resources/email-routing/routing/addresses.ts +++ b/src/resources/email-routing/addresses.ts @@ -3,7 +3,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as AddressesAPI from 'cloudflare/resources/email-routing/routing/addresses'; +import * as AddressesAPI from 'cloudflare/resources/email-routing/addresses'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Addresses extends APIResource { diff --git a/src/resources/email-routing/routing/dns.ts b/src/resources/email-routing/dns.ts similarity index 95% rename from src/resources/email-routing/routing/dns.ts rename to src/resources/email-routing/dns.ts index 93cfc64f9d..126f62294f 100644 --- a/src/resources/email-routing/routing/dns.ts +++ b/src/resources/email-routing/dns.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as DNSAPI from 'cloudflare/resources/email-routing/routing/dns'; +import * as DNSAPI from 'cloudflare/resources/email-routing/dns'; export class DNS extends APIResource { /** diff --git a/src/resources/email-routing/email-routing.ts b/src/resources/email-routing/email-routing.ts index c524798c05..6c0c51da7c 100644 --- a/src/resources/email-routing/email-routing.ts +++ b/src/resources/email-routing/email-routing.ts @@ -1,16 +1,253 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as RoutingAPI from 'cloudflare/resources/email-routing/routing/routing'; +import * as EmailRoutingAPI from 'cloudflare/resources/email-routing/email-routing'; +import * as AddressesAPI from 'cloudflare/resources/email-routing/addresses'; +import * as DNSAPI from 'cloudflare/resources/email-routing/dns'; +import * as RulesAPI from 'cloudflare/resources/email-routing/rules/rules'; export class EmailRouting extends APIResource { - routing: RoutingAPI.Routing = new RoutingAPI.Routing(this._client); + dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); + rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); + addresses: AddressesAPI.Addresses = new AddressesAPI.Addresses(this._client); + + /** + * Disable your Email Routing zone. Also removes additional MX records previously + * required for Email Routing to work. + */ + disable( + zoneIdentifier: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.post(`/zones/${zoneIdentifier}/email/routing/disable`, options) as Core.APIPromise<{ + result: EmailRoutingDisableResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Enable you Email Routing zone. Add and lock the necessary MX and SPF records. + */ + enable(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.post(`/zones/${zoneIdentifier}/email/routing/enable`, options) as Core.APIPromise<{ + result: EmailRoutingEnableResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get information about the settings for your Email Routing zone. + */ + get(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneIdentifier}/email/routing`, options) as Core.APIPromise<{ + result: EmailRoutingGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface EmailSettings { + /** + * Email Routing settings identifier. + */ + id?: string; + + /** + * The date and time the settings have been created. + */ + created?: string; + + /** + * State of the zone settings for Email Routing. + */ + enabled?: true | false; + + /** + * The date and time the settings have been modified. + */ + modified?: string; + + /** + * Domain of your zone. + */ + name?: string; + + /** + * Flag to check if the user skipped the configuration wizard. + */ + skip_wizard?: true | false; + + /** + * Show the state of your account, and the type or configuration error. + */ + status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; + + /** + * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing + * settings identifier) + */ + tag?: string; +} + +export interface EmailRoutingDisableResponse { + /** + * Email Routing settings identifier. + */ + id?: string; + + /** + * The date and time the settings have been created. + */ + created?: string; + + /** + * State of the zone settings for Email Routing. + */ + enabled?: true | false; + + /** + * The date and time the settings have been modified. + */ + modified?: string; + + /** + * Domain of your zone. + */ + name?: string; + + /** + * Flag to check if the user skipped the configuration wizard. + */ + skip_wizard?: true | false; + + /** + * Show the state of your account, and the type or configuration error. + */ + status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; + + /** + * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing + * settings identifier) + */ + tag?: string; +} + +export interface EmailRoutingEnableResponse { + /** + * Email Routing settings identifier. + */ + id?: string; + + /** + * The date and time the settings have been created. + */ + created?: string; + + /** + * State of the zone settings for Email Routing. + */ + enabled?: true | false; + + /** + * The date and time the settings have been modified. + */ + modified?: string; + + /** + * Domain of your zone. + */ + name?: string; + + /** + * Flag to check if the user skipped the configuration wizard. + */ + skip_wizard?: true | false; + + /** + * Show the state of your account, and the type or configuration error. + */ + status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; + + /** + * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing + * settings identifier) + */ + tag?: string; +} + +export interface EmailRoutingGetResponse { + /** + * Email Routing settings identifier. + */ + id?: string; + + /** + * The date and time the settings have been created. + */ + created?: string; + + /** + * State of the zone settings for Email Routing. + */ + enabled?: true | false; + + /** + * The date and time the settings have been modified. + */ + modified?: string; + + /** + * Domain of your zone. + */ + name?: string; + + /** + * Flag to check if the user skipped the configuration wizard. + */ + skip_wizard?: true | false; + + /** + * Show the state of your account, and the type or configuration error. + */ + status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; + + /** + * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing + * settings identifier) + */ + tag?: string; } export namespace EmailRouting { - export import Routing = RoutingAPI.Routing; - export import EmailSettings = RoutingAPI.EmailSettings; - export import RoutingDisableResponse = RoutingAPI.RoutingDisableResponse; - export import RoutingEnableResponse = RoutingAPI.RoutingEnableResponse; - export import RoutingGetResponse = RoutingAPI.RoutingGetResponse; + export import EmailSettings = EmailRoutingAPI.EmailSettings; + export import EmailRoutingDisableResponse = EmailRoutingAPI.EmailRoutingDisableResponse; + export import EmailRoutingEnableResponse = EmailRoutingAPI.EmailRoutingEnableResponse; + export import EmailRoutingGetResponse = EmailRoutingAPI.EmailRoutingGetResponse; + export import DNS = DNSAPI.DNS; + export import EmailDNSRecord = DNSAPI.EmailDNSRecord; + export import DNSGetResponse = DNSAPI.DNSGetResponse; + export import Rules = RulesAPI.Rules; + export import EmailRules = RulesAPI.EmailRules; + 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 RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; + export import RuleCreateParams = RulesAPI.RuleCreateParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleListParams = RulesAPI.RuleListParams; + export import Addresses = AddressesAPI.Addresses; + export import EmailAddresses = AddressesAPI.EmailAddresses; + export import AddressCreateResponse = AddressesAPI.AddressCreateResponse; + export import AddressListResponse = AddressesAPI.AddressListResponse; + export import AddressDeleteResponse = AddressesAPI.AddressDeleteResponse; + export import AddressGetResponse = AddressesAPI.AddressGetResponse; + export import AddressListResponsesV4PagePaginationArray = AddressesAPI.AddressListResponsesV4PagePaginationArray; + export import AddressCreateParams = AddressesAPI.AddressCreateParams; + export import AddressListParams = AddressesAPI.AddressListParams; } diff --git a/src/resources/email-routing/index.ts b/src/resources/email-routing/index.ts index c30cee972e..c64f651445 100644 --- a/src/resources/email-routing/index.ts +++ b/src/resources/email-routing/index.ts @@ -1,10 +1,34 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { EmailRouting } from './email-routing'; +export { + EmailAddresses, + AddressCreateResponse, + AddressListResponse, + AddressDeleteResponse, + AddressGetResponse, + AddressCreateParams, + AddressListParams, + AddressListResponsesV4PagePaginationArray, + Addresses, +} from './addresses'; +export { EmailDNSRecord, DNSGetResponse, DNS } from './dns'; +export { + EmailRules, + RuleCreateResponse, + RuleUpdateResponse, + RuleListResponse, + RuleDeleteResponse, + RuleGetResponse, + RuleCreateParams, + RuleUpdateParams, + RuleListParams, + RuleListResponsesV4PagePaginationArray, + Rules, +} from './rules/index'; export { EmailSettings, - RoutingDisableResponse, - RoutingEnableResponse, - RoutingGetResponse, - Routing, -} from './routing/index'; + EmailRoutingDisableResponse, + EmailRoutingEnableResponse, + EmailRoutingGetResponse, + EmailRouting, +} from './email-routing'; diff --git a/src/resources/email-routing/routing/index.ts b/src/resources/email-routing/routing/index.ts deleted file mode 100644 index fc1a8f2cfe..0000000000 --- a/src/resources/email-routing/routing/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - EmailAddresses, - AddressCreateResponse, - AddressListResponse, - AddressDeleteResponse, - AddressGetResponse, - AddressCreateParams, - AddressListParams, - AddressListResponsesV4PagePaginationArray, - Addresses, -} from './addresses'; -export { EmailDNSRecord, DNSGetResponse, DNS } from './dns'; -export { - EmailRules, - RuleCreateResponse, - RuleUpdateResponse, - RuleListResponse, - RuleDeleteResponse, - RuleGetResponse, - RuleCreateParams, - RuleUpdateParams, - RuleListParams, - RuleListResponsesV4PagePaginationArray, - Rules, -} from './rules/index'; -export { - EmailSettings, - RoutingDisableResponse, - RoutingEnableResponse, - RoutingGetResponse, - Routing, -} from './routing'; diff --git a/src/resources/email-routing/routing/routing.ts b/src/resources/email-routing/routing/routing.ts deleted file mode 100644 index a468815887..0000000000 --- a/src/resources/email-routing/routing/routing.ts +++ /dev/null @@ -1,250 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as RoutingAPI from 'cloudflare/resources/email-routing/routing/routing'; -import * as AddressesAPI from 'cloudflare/resources/email-routing/routing/addresses'; -import * as DNSAPI from 'cloudflare/resources/email-routing/routing/dns'; -import * as RulesAPI from 'cloudflare/resources/email-routing/routing/rules/rules'; - -export class Routing extends APIResource { - dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); - rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); - addresses: AddressesAPI.Addresses = new AddressesAPI.Addresses(this._client); - - /** - * Disable your Email Routing zone. Also removes additional MX records previously - * required for Email Routing to work. - */ - disable(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.post(`/zones/${zoneIdentifier}/email/routing/disable`, options) as Core.APIPromise<{ - result: RoutingDisableResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Enable you Email Routing zone. Add and lock the necessary MX and SPF records. - */ - enable(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.post(`/zones/${zoneIdentifier}/email/routing/enable`, options) as Core.APIPromise<{ - result: RoutingEnableResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get information about the settings for your Email Routing zone. - */ - get(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneIdentifier}/email/routing`, options) as Core.APIPromise<{ - result: RoutingGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface EmailSettings { - /** - * Email Routing settings identifier. - */ - id?: string; - - /** - * The date and time the settings have been created. - */ - created?: string; - - /** - * State of the zone settings for Email Routing. - */ - enabled?: true | false; - - /** - * The date and time the settings have been modified. - */ - modified?: string; - - /** - * Domain of your zone. - */ - name?: string; - - /** - * Flag to check if the user skipped the configuration wizard. - */ - skip_wizard?: true | false; - - /** - * Show the state of your account, and the type or configuration error. - */ - status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; - - /** - * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing - * settings identifier) - */ - tag?: string; -} - -export interface RoutingDisableResponse { - /** - * Email Routing settings identifier. - */ - id?: string; - - /** - * The date and time the settings have been created. - */ - created?: string; - - /** - * State of the zone settings for Email Routing. - */ - enabled?: true | false; - - /** - * The date and time the settings have been modified. - */ - modified?: string; - - /** - * Domain of your zone. - */ - name?: string; - - /** - * Flag to check if the user skipped the configuration wizard. - */ - skip_wizard?: true | false; - - /** - * Show the state of your account, and the type or configuration error. - */ - status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; - - /** - * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing - * settings identifier) - */ - tag?: string; -} - -export interface RoutingEnableResponse { - /** - * Email Routing settings identifier. - */ - id?: string; - - /** - * The date and time the settings have been created. - */ - created?: string; - - /** - * State of the zone settings for Email Routing. - */ - enabled?: true | false; - - /** - * The date and time the settings have been modified. - */ - modified?: string; - - /** - * Domain of your zone. - */ - name?: string; - - /** - * Flag to check if the user skipped the configuration wizard. - */ - skip_wizard?: true | false; - - /** - * Show the state of your account, and the type or configuration error. - */ - status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; - - /** - * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing - * settings identifier) - */ - tag?: string; -} - -export interface RoutingGetResponse { - /** - * Email Routing settings identifier. - */ - id?: string; - - /** - * The date and time the settings have been created. - */ - created?: string; - - /** - * State of the zone settings for Email Routing. - */ - enabled?: true | false; - - /** - * The date and time the settings have been modified. - */ - modified?: string; - - /** - * Domain of your zone. - */ - name?: string; - - /** - * Flag to check if the user skipped the configuration wizard. - */ - skip_wizard?: true | false; - - /** - * Show the state of your account, and the type or configuration error. - */ - status?: 'ready' | 'unconfigured' | 'misconfigured' | 'misconfigured/locked' | 'unlocked'; - - /** - * @deprecated: Email Routing settings tag. (Deprecated, replaced by Email Routing - * settings identifier) - */ - tag?: string; -} - -export namespace Routing { - export import EmailSettings = RoutingAPI.EmailSettings; - export import RoutingDisableResponse = RoutingAPI.RoutingDisableResponse; - export import RoutingEnableResponse = RoutingAPI.RoutingEnableResponse; - export import RoutingGetResponse = RoutingAPI.RoutingGetResponse; - export import DNS = DNSAPI.DNS; - export import EmailDNSRecord = DNSAPI.EmailDNSRecord; - export import DNSGetResponse = DNSAPI.DNSGetResponse; - export import Rules = RulesAPI.Rules; - export import EmailRules = RulesAPI.EmailRules; - 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 RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; - export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; - export import RuleListParams = RulesAPI.RuleListParams; - export import Addresses = AddressesAPI.Addresses; - export import EmailAddresses = AddressesAPI.EmailAddresses; - export import AddressCreateResponse = AddressesAPI.AddressCreateResponse; - export import AddressListResponse = AddressesAPI.AddressListResponse; - export import AddressDeleteResponse = AddressesAPI.AddressDeleteResponse; - export import AddressGetResponse = AddressesAPI.AddressGetResponse; - export import AddressListResponsesV4PagePaginationArray = AddressesAPI.AddressListResponsesV4PagePaginationArray; - export import AddressCreateParams = AddressesAPI.AddressCreateParams; - export import AddressListParams = AddressesAPI.AddressListParams; -} diff --git a/src/resources/email-routing/routing/rules/catch-alls.ts b/src/resources/email-routing/rules/catch-alls.ts similarity index 99% rename from src/resources/email-routing/routing/rules/catch-alls.ts rename to src/resources/email-routing/rules/catch-alls.ts index 3cfc53b74d..d06ef022e3 100644 --- a/src/resources/email-routing/routing/rules/catch-alls.ts +++ b/src/resources/email-routing/rules/catch-alls.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as CatchAllsAPI from 'cloudflare/resources/email-routing/routing/rules/catch-alls'; +import * as CatchAllsAPI from 'cloudflare/resources/email-routing/rules/catch-alls'; export class CatchAlls extends APIResource { /** diff --git a/src/resources/email-routing/routing/rules/index.ts b/src/resources/email-routing/rules/index.ts similarity index 100% rename from src/resources/email-routing/routing/rules/index.ts rename to src/resources/email-routing/rules/index.ts diff --git a/src/resources/email-routing/routing/rules/rules.ts b/src/resources/email-routing/rules/rules.ts similarity index 99% rename from src/resources/email-routing/routing/rules/rules.ts rename to src/resources/email-routing/rules/rules.ts index 4d85f84810..cb0e7a52e6 100644 --- a/src/resources/email-routing/routing/rules/rules.ts +++ b/src/resources/email-routing/rules/rules.ts @@ -3,8 +3,8 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as RulesAPI from 'cloudflare/resources/email-routing/routing/rules/rules'; -import * as CatchAllsAPI from 'cloudflare/resources/email-routing/routing/rules/catch-alls'; +import * as RulesAPI from 'cloudflare/resources/email-routing/rules/rules'; +import * as CatchAllsAPI from 'cloudflare/resources/email-routing/rules/catch-alls'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Rules extends APIResource { diff --git a/src/resources/index.ts b/src/resources/index.ts index 6e0c5e0e4c..3f0ac94fcd 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -22,8 +22,8 @@ export { AuditLogListResponsesV4PagePaginationArray, AuditLogs, } from './audit-logs'; -export { BillSubsAPIAvailableRatePlan, AvailablePlanListResponse, AvailablePlans } from './available-plans'; -export { BillSubsRatePlan, AvailableRatePlanGetResponse, AvailableRatePlans } from './available-rate-plans'; +export { BillSubsAPIAvailableRatePlan, PlanListResponse, Plans } from './plans'; +export { BillSubsRatePlan, RatePlanGetResponse, RatePlans } from './rate-plans'; export { Billing } from './billing/billing'; export { BotManagementUpdateResponse, @@ -73,7 +73,13 @@ export { } from './dnssec'; export { Diagnostics } from './diagnostics/diagnostics'; export { DurableObjects } from './durable-objects/durable-objects'; -export { EmailRouting } from './email-routing/email-routing'; +export { + EmailSettings, + EmailRoutingDisableResponse, + EmailRoutingEnableResponse, + EmailRoutingGetResponse, + EmailRouting, +} from './email-routing/email-routing'; export { Firewall } from './firewall/firewall'; export { HealthchecksHealthchecks, diff --git a/src/resources/logs/index.ts b/src/resources/logs/index.ts index fcd5b95094..c8b3d7afa4 100644 --- a/src/resources/logs/index.ts +++ b/src/resources/logs/index.ts @@ -2,5 +2,5 @@ export { Control } from './control/index'; export { Logs } from './logs'; -export { RayidGetResponse, RayidGetParams, Rayid } from './rayid'; +export { RayIDGetResponse, RayIDGetParams, RayID } from './rayid'; export { ReceivedGetResponse, ReceivedGetParams, Received } from './received/index'; diff --git a/src/resources/logs/logs.ts b/src/resources/logs/logs.ts index 6ee1d9d3c7..85706a04ee 100644 --- a/src/resources/logs/logs.ts +++ b/src/resources/logs/logs.ts @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; -import * as RayidAPI from 'cloudflare/resources/logs/rayid'; +import * as RayIDAPI from 'cloudflare/resources/logs/rayid'; import * as ControlAPI from 'cloudflare/resources/logs/control/control'; import * as ReceivedAPI from 'cloudflare/resources/logs/received/received'; export class Logs extends APIResource { control: ControlAPI.Control = new ControlAPI.Control(this._client); - rayid: RayidAPI.Rayid = new RayidAPI.Rayid(this._client); + RayID: RayIDAPI.RayID = new RayIDAPI.RayID(this._client); received: ReceivedAPI.Received = new ReceivedAPI.Received(this._client); } export namespace Logs { export import Control = ControlAPI.Control; - export import Rayid = RayidAPI.Rayid; - export import RayidGetResponse = RayidAPI.RayidGetResponse; - export import RayidGetParams = RayidAPI.RayidGetParams; + export import RayID = RayIDAPI.RayID; + export import RayIDGetResponse = RayIDAPI.RayIDGetResponse; + export import RayIDGetParams = RayIDAPI.RayIDGetParams; export import Received = ReceivedAPI.Received; export import ReceivedGetResponse = ReceivedAPI.ReceivedGetResponse; export import ReceivedGetParams = ReceivedAPI.ReceivedGetParams; diff --git a/src/resources/logs/rayid.ts b/src/resources/logs/rayid.ts index df7f82859a..ed70ce8bfb 100644 --- a/src/resources/logs/rayid.ts +++ b/src/resources/logs/rayid.ts @@ -3,9 +3,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { isRequestOptions } from 'cloudflare/core'; -import * as RayidAPI from 'cloudflare/resources/logs/rayid'; +import * as RayIDAPI from 'cloudflare/resources/logs/rayid'; -export class Rayid extends APIResource { +export class RayID extends APIResource { /** * The `/rayids` api route allows lookups by specific rayid. The rayids route will * return zero, one, or more records (ray ids are not unique). @@ -13,20 +13,20 @@ export class Rayid extends APIResource { get( zoneIdentifier: string, rayIdentifier: string, - query?: RayidGetParams, + query?: RayIDGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; + ): Core.APIPromise; get( zoneIdentifier: string, rayIdentifier: string, options?: Core.RequestOptions, - ): Core.APIPromise; + ): Core.APIPromise; get( zoneIdentifier: string, rayIdentifier: string, - query: RayidGetParams | Core.RequestOptions = {}, + query: RayIDGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(query)) { return this.get(zoneIdentifier, rayIdentifier, {}, query); } @@ -34,9 +34,9 @@ export class Rayid extends APIResource { } } -export type RayidGetResponse = string | unknown; +export type RayIDGetResponse = string | unknown; -export interface RayidGetParams { +export interface RayIDGetParams { /** * The `/received` route by default returns a limited set of fields, and allows * customers to override the default field set by specifying individual fields. The @@ -62,7 +62,7 @@ export interface RayidGetParams { timestamps?: 'unix' | 'unixnano' | 'rfc3339'; } -export namespace Rayid { - export import RayidGetResponse = RayidAPI.RayidGetResponse; - export import RayidGetParams = RayidAPI.RayidGetParams; +export namespace RayID { + export import RayIDGetResponse = RayIDAPI.RayIDGetResponse; + export import RayIDGetParams = RayIDAPI.RayIDGetParams; } diff --git a/src/resources/magic-transit/sites/acls.ts b/src/resources/magic-transit/sites/acls.ts index 924f8fa120..b7227115ba 100644 --- a/src/resources/magic-transit/sites/acls.ts +++ b/src/resources/magic-transit/sites/acls.ts @@ -112,9 +112,9 @@ export namespace ACLCreateResponse { */ description?: string; - lan_1?: ACL.Lan1; + lan_1?: ACL.LAN1; - lan_2?: ACL.Lan2; + lan_2?: ACL.LAN2; /** * The name of the ACL. @@ -125,7 +125,7 @@ export namespace ACLCreateResponse { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -149,7 +149,7 @@ export namespace ACLCreateResponse { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -197,9 +197,9 @@ export namespace ACLUpdateResponse { */ description?: string; - lan_1?: ACL.Lan1; + lan_1?: ACL.LAN1; - lan_2?: ACL.Lan2; + lan_2?: ACL.LAN2; /** * The name of the ACL. @@ -210,7 +210,7 @@ export namespace ACLUpdateResponse { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -234,7 +234,7 @@ export namespace ACLUpdateResponse { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -279,9 +279,9 @@ export namespace ACLListResponse { */ description?: string; - lan_1?: ACL.Lan1; + lan_1?: ACL.LAN1; - lan_2?: ACL.Lan2; + lan_2?: ACL.LAN2; /** * The name of the ACL. @@ -292,7 +292,7 @@ export namespace ACLListResponse { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -316,7 +316,7 @@ export namespace ACLListResponse { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -366,9 +366,9 @@ export namespace ACLDeleteResponse { */ description?: string; - lan_1?: DeletedACL.Lan1; + lan_1?: DeletedACL.LAN1; - lan_2?: DeletedACL.Lan2; + lan_2?: DeletedACL.LAN2; /** * The name of the ACL. @@ -379,7 +379,7 @@ export namespace ACLDeleteResponse { } export namespace DeletedACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -403,7 +403,7 @@ export namespace ACLDeleteResponse { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -451,9 +451,9 @@ export namespace ACLGetResponse { */ description?: string; - lan_1?: ACL.Lan1; + lan_1?: ACL.LAN1; - lan_2?: ACL.Lan2; + lan_2?: ACL.LAN2; /** * The name of the ACL. @@ -464,7 +464,7 @@ export namespace ACLGetResponse { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -488,7 +488,7 @@ export namespace ACLGetResponse { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -528,9 +528,9 @@ export interface ACLCreateParams { export namespace ACLCreateParams { export interface ACL { - lan_1: ACL.Lan1; + lan_1: ACL.LAN1; - lan_2: ACL.Lan2; + lan_2: ACL.LAN2; /** * The name of the ACL. @@ -546,7 +546,7 @@ export namespace ACLCreateParams { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -570,7 +570,7 @@ export namespace ACLCreateParams { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -615,9 +615,9 @@ export namespace ACLUpdateParams { */ description?: string; - lan_1?: ACL.Lan1; + lan_1?: ACL.LAN1; - lan_2?: ACL.Lan2; + lan_2?: ACL.LAN2; /** * The name of the ACL. @@ -628,7 +628,7 @@ export namespace ACLUpdateParams { } export namespace ACL { - export interface Lan1 { + export interface LAN1 { /** * The identifier for the LAN you want to create an ACL policy with. */ @@ -652,7 +652,7 @@ export namespace ACLUpdateParams { subnets?: Array; } - export interface Lan2 { + export interface LAN2 { /** * The identifier for the LAN you want to create an ACL policy with. */ diff --git a/src/resources/magic-transit/sites/index.ts b/src/resources/magic-transit/sites/index.ts index 889298a61d..3fef198e5a 100644 --- a/src/resources/magic-transit/sites/index.ts +++ b/src/resources/magic-transit/sites/index.ts @@ -14,17 +14,17 @@ export { ACLs, } from './acls'; export { - LanCreateResponse, - LanUpdateResponse, - LanListResponse, - LanDeleteResponse, - LanGetResponse, - LanCreateParams, - LanUpdateParams, - LanListParams, - LanDeleteParams, - LanGetParams, - Lans, + LANCreateResponse, + LANUpdateResponse, + LANListResponse, + LANDeleteResponse, + LANGetResponse, + LANCreateParams, + LANUpdateParams, + LANListParams, + LANDeleteParams, + LANGetParams, + LANs, } from './lans'; export { SiteCreateResponse, @@ -40,15 +40,15 @@ export { Sites, } from './sites'; export { - WanCreateResponse, - WanUpdateResponse, - WanListResponse, - WanDeleteResponse, - WanGetResponse, - WanCreateParams, - WanUpdateParams, - WanListParams, - WanDeleteParams, - WanGetParams, - Wans, + WANCreateResponse, + WANUpdateResponse, + WANListResponse, + WANDeleteResponse, + WANGetResponse, + WANCreateParams, + WANUpdateParams, + WANListParams, + WANDeleteParams, + WANGetParams, + WANs, } from './wans'; diff --git a/src/resources/magic-transit/sites/lans.ts b/src/resources/magic-transit/sites/lans.ts index 3b9c4995d5..e9f729d7c8 100644 --- a/src/resources/magic-transit/sites/lans.ts +++ b/src/resources/magic-transit/sites/lans.ts @@ -2,24 +2,24 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as LansAPI from 'cloudflare/resources/magic-transit/sites/lans'; +import * as LANsAPI from 'cloudflare/resources/magic-transit/sites/lans'; -export class Lans extends APIResource { +export class LANs extends APIResource { /** * Creates a new LAN. If the site is in high availability mode, static_addressing * is required along with secondary and virtual address. */ create( siteId: string, - params: LanCreateParams, + params: LANCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/magic/sites/${siteId}/lans`, { body, ...options, - }) as Core.APIPromise<{ result: LanCreateResponse }> + }) as Core.APIPromise<{ result: LANCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -29,15 +29,15 @@ export class Lans extends APIResource { update( siteId: string, lanId: string, - params: LanUpdateParams, + params: LANUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, { body, ...options, - }) as Core.APIPromise<{ result: LanUpdateResponse }> + }) as Core.APIPromise<{ result: LANUpdateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -46,13 +46,13 @@ export class Lans extends APIResource { */ list( siteId: string, - params: LanListParams, + params: LANListParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/magic/sites/${siteId}/lans`, options) as Core.APIPromise<{ - result: LanListResponse; + result: LANListResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -63,15 +63,15 @@ export class Lans extends APIResource { delete( siteId: string, lanId: string, - params: LanDeleteParams, + params: LANDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.delete( `/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, options, - ) as Core.APIPromise<{ result: LanDeleteResponse }> + ) as Core.APIPromise<{ result: LANDeleteResponse }> )._thenUnwrap((obj) => obj.result); } @@ -81,25 +81,25 @@ export class Lans extends APIResource { get( siteId: string, lanId: string, - params: LanGetParams, + params: LANGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/magic/sites/${siteId}/lans/${lanId}`, options, - ) as Core.APIPromise<{ result: LanGetResponse }> + ) as Core.APIPromise<{ result: LANGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface LanCreateResponse { - lans?: Array; +export interface LANCreateResponse { + lans?: Array; } -export namespace LanCreateResponse { - export interface Lan { +export namespace LANCreateResponse { + export interface LAN { /** * Identifier */ @@ -113,11 +113,11 @@ export namespace LanCreateResponse { */ ha_link?: boolean; - nat?: Lan.Nat; + nat?: LAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * Identifier @@ -129,7 +129,7 @@ export namespace LanCreateResponse { * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; /** * VLAN port number. @@ -137,7 +137,7 @@ export namespace LanCreateResponse { vlan_tag?: number; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -227,12 +227,12 @@ export namespace LanCreateResponse { } } -export interface LanUpdateResponse { - lan?: LanUpdateResponse.Lan; +export interface LANUpdateResponse { + lan?: LANUpdateResponse.LAN; } -export namespace LanUpdateResponse { - export interface Lan { +export namespace LANUpdateResponse { + export interface LAN { /** * Identifier */ @@ -246,11 +246,11 @@ export namespace LanUpdateResponse { */ ha_link?: boolean; - nat?: Lan.Nat; + nat?: LAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * Identifier @@ -262,7 +262,7 @@ export namespace LanUpdateResponse { * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; /** * VLAN port number. @@ -270,7 +270,7 @@ export namespace LanUpdateResponse { vlan_tag?: number; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -360,12 +360,12 @@ export namespace LanUpdateResponse { } } -export interface LanListResponse { - lans?: Array; +export interface LANListResponse { + lans?: Array; } -export namespace LanListResponse { - export interface Lan { +export namespace LANListResponse { + export interface LAN { /** * Identifier */ @@ -379,11 +379,11 @@ export namespace LanListResponse { */ ha_link?: boolean; - nat?: Lan.Nat; + nat?: LAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * Identifier @@ -395,7 +395,7 @@ export namespace LanListResponse { * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; /** * VLAN port number. @@ -403,7 +403,7 @@ export namespace LanListResponse { vlan_tag?: number; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -493,14 +493,14 @@ export namespace LanListResponse { } } -export interface LanDeleteResponse { +export interface LANDeleteResponse { deleted?: boolean; - deleted_lan?: LanDeleteResponse.DeletedLan; + deleted_lan?: LANDeleteResponse.DeletedLAN; } -export namespace LanDeleteResponse { - export interface DeletedLan { +export namespace LANDeleteResponse { + export interface DeletedLAN { /** * Identifier */ @@ -514,11 +514,11 @@ export namespace LanDeleteResponse { */ ha_link?: boolean; - nat?: DeletedLan.Nat; + nat?: DeletedLAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * Identifier @@ -530,7 +530,7 @@ export namespace LanDeleteResponse { * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: DeletedLan.StaticAddressing; + static_addressing?: DeletedLAN.StaticAddressing; /** * VLAN port number. @@ -538,7 +538,7 @@ export namespace LanDeleteResponse { vlan_tag?: number; } - export namespace DeletedLan { + export namespace DeletedLAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -628,12 +628,12 @@ export namespace LanDeleteResponse { } } -export interface LanGetResponse { - lan?: LanGetResponse.Lan; +export interface LANGetResponse { + lan?: LANGetResponse.LAN; } -export namespace LanGetResponse { - export interface Lan { +export namespace LANGetResponse { + export interface LAN { /** * Identifier */ @@ -647,11 +647,11 @@ export namespace LanGetResponse { */ ha_link?: boolean; - nat?: Lan.Nat; + nat?: LAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * Identifier @@ -663,7 +663,7 @@ export namespace LanGetResponse { * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; /** * VLAN port number. @@ -671,7 +671,7 @@ export namespace LanGetResponse { vlan_tag?: number; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -761,7 +761,7 @@ export namespace LanGetResponse { } } -export interface LanCreateParams { +export interface LANCreateParams { /** * Path param: Identifier */ @@ -770,11 +770,11 @@ export interface LanCreateParams { /** * Body param: */ - lan?: LanCreateParams.Lan; + lan?: LANCreateParams.LAN; } -export namespace LanCreateParams { - export interface Lan { +export namespace LANCreateParams { + export interface LAN { physport: number; /** @@ -790,19 +790,19 @@ export namespace LanCreateParams { */ ha_link?: boolean; - nat?: Lan.Nat; + nat?: LAN.Nat; - routed_subnets?: Array; + routed_subnets?: Array; /** * If the site is not configured in high availability mode, this configuration is * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -892,7 +892,7 @@ export namespace LanCreateParams { } } -export interface LanUpdateParams { +export interface LANUpdateParams { /** * Path param: Identifier */ @@ -901,25 +901,25 @@ export interface LanUpdateParams { /** * Body param: */ - lan?: LanUpdateParams.Lan; + lan?: LANUpdateParams.LAN; } -export namespace LanUpdateParams { - export interface Lan { +export namespace LANUpdateParams { + export interface LAN { description?: string; - nat?: Lan.Nat; + nat?: LAN.Nat; physport?: number; - routed_subnets?: Array; + routed_subnets?: Array; /** * If the site is not configured in high availability mode, this configuration is * optional (if omitted, use DHCP). However, if in high availability mode, * static_address is required along with secondary and virtual address. */ - static_addressing?: Lan.StaticAddressing; + static_addressing?: LAN.StaticAddressing; /** * VLAN port number. @@ -927,7 +927,7 @@ export namespace LanUpdateParams { vlan_tag?: number; } - export namespace Lan { + export namespace LAN { export interface Nat { /** * A valid CIDR notation representing an IP range. @@ -1017,36 +1017,36 @@ export namespace LanUpdateParams { } } -export interface LanListParams { +export interface LANListParams { /** * Identifier */ account_id: string; } -export interface LanDeleteParams { +export interface LANDeleteParams { /** * Identifier */ account_id: string; } -export interface LanGetParams { +export interface LANGetParams { /** * Identifier */ account_id: string; } -export namespace Lans { - export import LanCreateResponse = LansAPI.LanCreateResponse; - export import LanUpdateResponse = LansAPI.LanUpdateResponse; - export import LanListResponse = LansAPI.LanListResponse; - export import LanDeleteResponse = LansAPI.LanDeleteResponse; - export import LanGetResponse = LansAPI.LanGetResponse; - export import LanCreateParams = LansAPI.LanCreateParams; - export import LanUpdateParams = LansAPI.LanUpdateParams; - export import LanListParams = LansAPI.LanListParams; - export import LanDeleteParams = LansAPI.LanDeleteParams; - export import LanGetParams = LansAPI.LanGetParams; +export namespace LANs { + export import LANCreateResponse = LANsAPI.LANCreateResponse; + export import LANUpdateResponse = LANsAPI.LANUpdateResponse; + export import LANListResponse = LANsAPI.LANListResponse; + export import LANDeleteResponse = LANsAPI.LANDeleteResponse; + export import LANGetResponse = LANsAPI.LANGetResponse; + export import LANCreateParams = LANsAPI.LANCreateParams; + export import LANUpdateParams = LANsAPI.LANUpdateParams; + export import LANListParams = LANsAPI.LANListParams; + export import LANDeleteParams = LANsAPI.LANDeleteParams; + export import LANGetParams = LANsAPI.LANGetParams; } diff --git a/src/resources/magic-transit/sites/sites.ts b/src/resources/magic-transit/sites/sites.ts index c124c8614a..1f8496fd8a 100644 --- a/src/resources/magic-transit/sites/sites.ts +++ b/src/resources/magic-transit/sites/sites.ts @@ -4,13 +4,13 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as SitesAPI from 'cloudflare/resources/magic-transit/sites/sites'; import * as ACLsAPI from 'cloudflare/resources/magic-transit/sites/acls'; -import * as LansAPI from 'cloudflare/resources/magic-transit/sites/lans'; -import * as WansAPI from 'cloudflare/resources/magic-transit/sites/wans'; +import * as LANsAPI from 'cloudflare/resources/magic-transit/sites/lans'; +import * as WANsAPI from 'cloudflare/resources/magic-transit/sites/wans'; export class Sites extends APIResource { acls: ACLsAPI.ACLs = new ACLsAPI.ACLs(this._client); - lans: LansAPI.Lans = new LansAPI.Lans(this._client); - wans: WansAPI.Wans = new WansAPI.Wans(this._client); + lans: LANsAPI.LANs = new LANsAPI.LANs(this._client); + wans: WANsAPI.WANs = new WANsAPI.WANs(this._client); /** * Creates a new Site @@ -539,26 +539,26 @@ export namespace Sites { export import ACLListParams = ACLsAPI.ACLListParams; export import ACLDeleteParams = ACLsAPI.ACLDeleteParams; export import ACLGetParams = ACLsAPI.ACLGetParams; - export import Lans = LansAPI.Lans; - export import LanCreateResponse = LansAPI.LanCreateResponse; - export import LanUpdateResponse = LansAPI.LanUpdateResponse; - export import LanListResponse = LansAPI.LanListResponse; - export import LanDeleteResponse = LansAPI.LanDeleteResponse; - export import LanGetResponse = LansAPI.LanGetResponse; - export import LanCreateParams = LansAPI.LanCreateParams; - export import LanUpdateParams = LansAPI.LanUpdateParams; - export import LanListParams = LansAPI.LanListParams; - export import LanDeleteParams = LansAPI.LanDeleteParams; - export import LanGetParams = LansAPI.LanGetParams; - export import Wans = WansAPI.Wans; - export import WanCreateResponse = WansAPI.WanCreateResponse; - export import WanUpdateResponse = WansAPI.WanUpdateResponse; - export import WanListResponse = WansAPI.WanListResponse; - export import WanDeleteResponse = WansAPI.WanDeleteResponse; - export import WanGetResponse = WansAPI.WanGetResponse; - export import WanCreateParams = WansAPI.WanCreateParams; - export import WanUpdateParams = WansAPI.WanUpdateParams; - export import WanListParams = WansAPI.WanListParams; - export import WanDeleteParams = WansAPI.WanDeleteParams; - export import WanGetParams = WansAPI.WanGetParams; + export import LANs = LANsAPI.LANs; + export import LANCreateResponse = LANsAPI.LANCreateResponse; + export import LANUpdateResponse = LANsAPI.LANUpdateResponse; + export import LANListResponse = LANsAPI.LANListResponse; + export import LANDeleteResponse = LANsAPI.LANDeleteResponse; + export import LANGetResponse = LANsAPI.LANGetResponse; + export import LANCreateParams = LANsAPI.LANCreateParams; + export import LANUpdateParams = LANsAPI.LANUpdateParams; + export import LANListParams = LANsAPI.LANListParams; + export import LANDeleteParams = LANsAPI.LANDeleteParams; + export import LANGetParams = LANsAPI.LANGetParams; + export import WANs = WANsAPI.WANs; + export import WANCreateResponse = WANsAPI.WANCreateResponse; + export import WANUpdateResponse = WANsAPI.WANUpdateResponse; + export import WANListResponse = WANsAPI.WANListResponse; + export import WANDeleteResponse = WANsAPI.WANDeleteResponse; + export import WANGetResponse = WANsAPI.WANGetResponse; + export import WANCreateParams = WANsAPI.WANCreateParams; + export import WANUpdateParams = WANsAPI.WANUpdateParams; + export import WANListParams = WANsAPI.WANListParams; + export import WANDeleteParams = WANsAPI.WANDeleteParams; + export import WANGetParams = WANsAPI.WANGetParams; } diff --git a/src/resources/magic-transit/sites/wans.ts b/src/resources/magic-transit/sites/wans.ts index 34b6e0fc37..af6348ab9b 100644 --- a/src/resources/magic-transit/sites/wans.ts +++ b/src/resources/magic-transit/sites/wans.ts @@ -2,23 +2,23 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as WansAPI from 'cloudflare/resources/magic-transit/sites/wans'; +import * as WANsAPI from 'cloudflare/resources/magic-transit/sites/wans'; -export class Wans extends APIResource { +export class WANs extends APIResource { /** * Creates a new WAN. */ create( siteId: string, - params: WanCreateParams, + params: WANCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/magic/sites/${siteId}/wans`, { body, ...options, - }) as Core.APIPromise<{ result: WanCreateResponse }> + }) as Core.APIPromise<{ result: WANCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -28,15 +28,15 @@ export class Wans extends APIResource { update( siteId: string, wanId: string, - params: WanUpdateParams, + params: WANUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, { body, ...options, - }) as Core.APIPromise<{ result: WanUpdateResponse }> + }) as Core.APIPromise<{ result: WANUpdateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,13 +45,13 @@ export class Wans extends APIResource { */ list( siteId: string, - params: WanListParams, + params: WANListParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/magic/sites/${siteId}/wans`, options) as Core.APIPromise<{ - result: WanListResponse; + result: WANListResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -62,15 +62,15 @@ export class Wans extends APIResource { delete( siteId: string, wanId: string, - params: WanDeleteParams, + params: WANDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.delete( `/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, options, - ) as Core.APIPromise<{ result: WanDeleteResponse }> + ) as Core.APIPromise<{ result: WANDeleteResponse }> )._thenUnwrap((obj) => obj.result); } @@ -80,25 +80,25 @@ export class Wans extends APIResource { get( siteId: string, wanId: string, - params: WanGetParams, + params: WANGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/magic/sites/${siteId}/wans/${wanId}`, options, - ) as Core.APIPromise<{ result: WanGetResponse }> + ) as Core.APIPromise<{ result: WANGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface WanCreateResponse { - wans?: Array; +export interface WANCreateResponse { + wans?: Array; } -export namespace WanCreateResponse { - export interface Wan { +export namespace WANCreateResponse { + export interface WAN { /** * Identifier */ @@ -122,7 +122,7 @@ export namespace WanCreateResponse { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; /** * VLAN port number. @@ -130,7 +130,7 @@ export namespace WanCreateResponse { vlan_tag?: number; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -154,12 +154,12 @@ export namespace WanCreateResponse { } } -export interface WanUpdateResponse { - wan?: WanUpdateResponse.Wan; +export interface WANUpdateResponse { + wan?: WANUpdateResponse.WAN; } -export namespace WanUpdateResponse { - export interface Wan { +export namespace WANUpdateResponse { + export interface WAN { /** * Identifier */ @@ -183,7 +183,7 @@ export namespace WanUpdateResponse { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; /** * VLAN port number. @@ -191,7 +191,7 @@ export namespace WanUpdateResponse { vlan_tag?: number; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -215,12 +215,12 @@ export namespace WanUpdateResponse { } } -export interface WanListResponse { - wans?: Array; +export interface WANListResponse { + wans?: Array; } -export namespace WanListResponse { - export interface Wan { +export namespace WANListResponse { + export interface WAN { /** * Identifier */ @@ -244,7 +244,7 @@ export namespace WanListResponse { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; /** * VLAN port number. @@ -252,7 +252,7 @@ export namespace WanListResponse { vlan_tag?: number; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -276,14 +276,14 @@ export namespace WanListResponse { } } -export interface WanDeleteResponse { +export interface WANDeleteResponse { deleted?: boolean; - deleted_wan?: WanDeleteResponse.DeletedWan; + deleted_wan?: WANDeleteResponse.DeletedWAN; } -export namespace WanDeleteResponse { - export interface DeletedWan { +export namespace WANDeleteResponse { + export interface DeletedWAN { /** * Identifier */ @@ -307,7 +307,7 @@ export namespace WanDeleteResponse { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: DeletedWan.StaticAddressing; + static_addressing?: DeletedWAN.StaticAddressing; /** * VLAN port number. @@ -315,7 +315,7 @@ export namespace WanDeleteResponse { vlan_tag?: number; } - export namespace DeletedWan { + export namespace DeletedWAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -339,12 +339,12 @@ export namespace WanDeleteResponse { } } -export interface WanGetResponse { - wan?: WanGetResponse.Wan; +export interface WANGetResponse { + wan?: WANGetResponse.WAN; } -export namespace WanGetResponse { - export interface Wan { +export namespace WANGetResponse { + export interface WAN { /** * Identifier */ @@ -368,7 +368,7 @@ export namespace WanGetResponse { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; /** * VLAN port number. @@ -376,7 +376,7 @@ export namespace WanGetResponse { vlan_tag?: number; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -400,7 +400,7 @@ export namespace WanGetResponse { } } -export interface WanCreateParams { +export interface WANCreateParams { /** * Path param: Identifier */ @@ -409,11 +409,11 @@ export interface WanCreateParams { /** * Body param: */ - wan?: WanCreateParams.Wan; + wan?: WANCreateParams.WAN; } -export namespace WanCreateParams { - export interface Wan { +export namespace WANCreateParams { + export interface WAN { physport: number; /** @@ -429,10 +429,10 @@ export namespace WanCreateParams { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -456,7 +456,7 @@ export namespace WanCreateParams { } } -export interface WanUpdateParams { +export interface WANUpdateParams { /** * Path param: Identifier */ @@ -465,11 +465,11 @@ export interface WanUpdateParams { /** * Body param: */ - wan?: WanUpdateParams.Wan; + wan?: WANUpdateParams.WAN; } -export namespace WanUpdateParams { - export interface Wan { +export namespace WANUpdateParams { + export interface WAN { description?: string; physport?: number; @@ -480,7 +480,7 @@ export namespace WanUpdateParams { * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. */ - static_addressing?: Wan.StaticAddressing; + static_addressing?: WAN.StaticAddressing; /** * VLAN port number. @@ -488,7 +488,7 @@ export namespace WanUpdateParams { vlan_tag?: number; } - export namespace Wan { + export namespace WAN { /** * (optional) if omitted, use DHCP. Submit secondary_address when site is in high * availability mode. @@ -512,36 +512,36 @@ export namespace WanUpdateParams { } } -export interface WanListParams { +export interface WANListParams { /** * Identifier */ account_id: string; } -export interface WanDeleteParams { +export interface WANDeleteParams { /** * Identifier */ account_id: string; } -export interface WanGetParams { +export interface WANGetParams { /** * Identifier */ account_id: string; } -export namespace Wans { - export import WanCreateResponse = WansAPI.WanCreateResponse; - export import WanUpdateResponse = WansAPI.WanUpdateResponse; - export import WanListResponse = WansAPI.WanListResponse; - export import WanDeleteResponse = WansAPI.WanDeleteResponse; - export import WanGetResponse = WansAPI.WanGetResponse; - export import WanCreateParams = WansAPI.WanCreateParams; - export import WanUpdateParams = WansAPI.WanUpdateParams; - export import WanListParams = WansAPI.WanListParams; - export import WanDeleteParams = WansAPI.WanDeleteParams; - export import WanGetParams = WansAPI.WanGetParams; +export namespace WANs { + export import WANCreateResponse = WANsAPI.WANCreateResponse; + export import WANUpdateResponse = WANsAPI.WANUpdateResponse; + export import WANListResponse = WANsAPI.WANListResponse; + export import WANDeleteResponse = WANsAPI.WANDeleteResponse; + export import WANGetResponse = WANsAPI.WANGetResponse; + export import WANCreateParams = WANsAPI.WANCreateParams; + export import WANUpdateParams = WANsAPI.WANUpdateParams; + export import WANListParams = WANsAPI.WANListParams; + export import WANDeleteParams = WANsAPI.WANDeleteParams; + export import WANGetParams = WANsAPI.WANGetParams; } diff --git a/src/resources/pcaps/downloads.ts b/src/resources/pcaps/download.ts similarity index 76% rename from src/resources/pcaps/downloads.ts rename to src/resources/pcaps/download.ts index df75e069c3..dacc0985d1 100644 --- a/src/resources/pcaps/downloads.ts +++ b/src/resources/pcaps/download.ts @@ -3,9 +3,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { type Response } from 'cloudflare/_shims/index'; -import * as DownloadsAPI from 'cloudflare/resources/pcaps/downloads'; +import * as DownloadAPI from 'cloudflare/resources/pcaps/download'; -export class Downloads extends APIResource { +export class Download extends APIResource { /** * Download PCAP information into a file. Response is a binary PCAP file. */ @@ -25,6 +25,6 @@ export interface DownloadGetParams { account_id: string; } -export namespace Downloads { - export import DownloadGetParams = DownloadsAPI.DownloadGetParams; +export namespace Download { + export import DownloadGetParams = DownloadAPI.DownloadGetParams; } diff --git a/src/resources/pcaps/index.ts b/src/resources/pcaps/index.ts index 67569e2478..19265575de 100644 --- a/src/resources/pcaps/index.ts +++ b/src/resources/pcaps/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { DownloadGetParams, Downloads } from './downloads'; +export { DownloadGetParams, Download } from './download'; export { MagicVisibilityPCAPsOwnership, OwnershipGetResponse, @@ -8,8 +8,8 @@ export { OwnershipDeleteParams, OwnershipGetParams, OwnershipValidateParams, - Ownerships, -} from './ownerships'; + Ownership, +} from './ownership'; export { PCAPCreateResponse, PCAPListResponse, diff --git a/src/resources/pcaps/ownerships.ts b/src/resources/pcaps/ownership.ts similarity index 85% rename from src/resources/pcaps/ownerships.ts rename to src/resources/pcaps/ownership.ts index 47d4d1af44..e1e0e32d2a 100644 --- a/src/resources/pcaps/ownerships.ts +++ b/src/resources/pcaps/ownership.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as OwnershipsAPI from 'cloudflare/resources/pcaps/ownerships'; +import * as OwnershipAPI from 'cloudflare/resources/pcaps/ownership'; -export class Ownerships extends APIResource { +export class Ownership extends APIResource { /** * Adds an AWS or GCP bucket to use with full packet captures. */ @@ -146,11 +146,11 @@ export interface OwnershipValidateParams { ownership_challenge: string; } -export namespace Ownerships { - export import MagicVisibilityPCAPsOwnership = OwnershipsAPI.MagicVisibilityPCAPsOwnership; - export import OwnershipGetResponse = OwnershipsAPI.OwnershipGetResponse; - export import OwnershipCreateParams = OwnershipsAPI.OwnershipCreateParams; - export import OwnershipDeleteParams = OwnershipsAPI.OwnershipDeleteParams; - export import OwnershipGetParams = OwnershipsAPI.OwnershipGetParams; - export import OwnershipValidateParams = OwnershipsAPI.OwnershipValidateParams; +export namespace Ownership { + export import MagicVisibilityPCAPsOwnership = OwnershipAPI.MagicVisibilityPCAPsOwnership; + export import OwnershipGetResponse = OwnershipAPI.OwnershipGetResponse; + export import OwnershipCreateParams = OwnershipAPI.OwnershipCreateParams; + export import OwnershipDeleteParams = OwnershipAPI.OwnershipDeleteParams; + export import OwnershipGetParams = OwnershipAPI.OwnershipGetParams; + export import OwnershipValidateParams = OwnershipAPI.OwnershipValidateParams; } diff --git a/src/resources/pcaps/pcaps.ts b/src/resources/pcaps/pcaps.ts index db1d194ce2..b9423ad12f 100644 --- a/src/resources/pcaps/pcaps.ts +++ b/src/resources/pcaps/pcaps.ts @@ -3,12 +3,12 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as PCAPsAPI from 'cloudflare/resources/pcaps/pcaps'; -import * as DownloadsAPI from 'cloudflare/resources/pcaps/downloads'; -import * as OwnershipsAPI from 'cloudflare/resources/pcaps/ownerships'; +import * as DownloadAPI from 'cloudflare/resources/pcaps/download'; +import * as OwnershipAPI from 'cloudflare/resources/pcaps/ownership'; export class PCAPs extends APIResource { - ownerships: OwnershipsAPI.Ownerships = new OwnershipsAPI.Ownerships(this._client); - downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client); + ownership: OwnershipAPI.Ownership = new OwnershipAPI.Ownership(this._client); + download: DownloadAPI.Download = new DownloadAPI.Download(this._client); /** * Create new PCAP request for account. @@ -787,13 +787,13 @@ export namespace PCAPs { export import PCAPCreateParams = PCAPsAPI.PCAPCreateParams; export import PCAPListParams = PCAPsAPI.PCAPListParams; export import PCAPGetParams = PCAPsAPI.PCAPGetParams; - export import Ownerships = OwnershipsAPI.Ownerships; - export import MagicVisibilityPCAPsOwnership = OwnershipsAPI.MagicVisibilityPCAPsOwnership; - export import OwnershipGetResponse = OwnershipsAPI.OwnershipGetResponse; - export import OwnershipCreateParams = OwnershipsAPI.OwnershipCreateParams; - export import OwnershipDeleteParams = OwnershipsAPI.OwnershipDeleteParams; - export import OwnershipGetParams = OwnershipsAPI.OwnershipGetParams; - export import OwnershipValidateParams = OwnershipsAPI.OwnershipValidateParams; - export import Downloads = DownloadsAPI.Downloads; - export import DownloadGetParams = DownloadsAPI.DownloadGetParams; + export import Ownership = OwnershipAPI.Ownership; + export import MagicVisibilityPCAPsOwnership = OwnershipAPI.MagicVisibilityPCAPsOwnership; + export import OwnershipGetResponse = OwnershipAPI.OwnershipGetResponse; + export import OwnershipCreateParams = OwnershipAPI.OwnershipCreateParams; + export import OwnershipDeleteParams = OwnershipAPI.OwnershipDeleteParams; + export import OwnershipGetParams = OwnershipAPI.OwnershipGetParams; + export import OwnershipValidateParams = OwnershipAPI.OwnershipValidateParams; + export import Download = DownloadAPI.Download; + export import DownloadGetParams = DownloadAPI.DownloadGetParams; } diff --git a/src/resources/available-plans.ts b/src/resources/plans.ts similarity index 75% rename from src/resources/available-plans.ts rename to src/resources/plans.ts index dc16a0b78b..670f756532 100644 --- a/src/resources/available-plans.ts +++ b/src/resources/plans.ts @@ -2,19 +2,16 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as AvailablePlansAPI from 'cloudflare/resources/available-plans'; +import * as PlansAPI from 'cloudflare/resources/plans'; -export class AvailablePlans extends APIResource { +export class Plans extends APIResource { /** * Lists available plans the zone can subscribe to. */ - list( - zoneIdentifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.get(`/zones/${zoneIdentifier}/available_plans`, options) as Core.APIPromise<{ - result: AvailablePlanListResponse | null; + result: PlanListResponse | null; }> )._thenUnwrap((obj) => obj.result); } @@ -88,9 +85,9 @@ export interface BillSubsAPIAvailableRatePlan { price?: number; } -export type AvailablePlanListResponse = Array; +export type PlanListResponse = Array; -export namespace AvailablePlans { - export import BillSubsAPIAvailableRatePlan = AvailablePlansAPI.BillSubsAPIAvailableRatePlan; - export import AvailablePlanListResponse = AvailablePlansAPI.AvailablePlanListResponse; +export namespace Plans { + export import BillSubsAPIAvailableRatePlan = PlansAPI.BillSubsAPIAvailableRatePlan; + export import PlanListResponse = PlansAPI.PlanListResponse; } diff --git a/src/resources/available-rate-plans.ts b/src/resources/rate-plans.ts similarity index 72% rename from src/resources/available-rate-plans.ts rename to src/resources/rate-plans.ts index 6bac57e9b0..690f5c7e56 100644 --- a/src/resources/available-rate-plans.ts +++ b/src/resources/rate-plans.ts @@ -2,19 +2,16 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as AvailableRatePlansAPI from 'cloudflare/resources/available-rate-plans'; +import * as RatePlansAPI from 'cloudflare/resources/rate-plans'; -export class AvailableRatePlans extends APIResource { +export class RatePlans extends APIResource { /** * Lists all rate plans the zone can subscribe to. */ - get( - zoneIdentifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.get(`/zones/${zoneIdentifier}/available_rate_plans`, options) as Core.APIPromise<{ - result: AvailableRatePlanGetResponse | null; + result: RatePlanGetResponse | null; }> )._thenUnwrap((obj) => obj.result); } @@ -71,11 +68,10 @@ export namespace BillSubsRatePlan { } } -export type AvailableRatePlanGetResponse = - Array; +export type RatePlanGetResponse = Array; -export namespace AvailableRatePlanGetResponse { - export interface AvailableRatePlanGetResponseItem { +export namespace RatePlanGetResponse { + export interface RatePlanGetResponseItem { /** * Plan identifier tag. */ @@ -84,7 +80,7 @@ export namespace AvailableRatePlanGetResponse { /** * Array of available components values for the plan. */ - components?: Array; + components?: Array; /** * The monetary unit in which pricing information is displayed. @@ -107,7 +103,7 @@ export namespace AvailableRatePlanGetResponse { name?: string; } - export namespace AvailableRatePlanGetResponseItem { + export namespace RatePlanGetResponseItem { export interface Component { /** * The default amount allocated. @@ -127,7 +123,7 @@ export namespace AvailableRatePlanGetResponse { } } -export namespace AvailableRatePlans { - export import BillSubsRatePlan = AvailableRatePlansAPI.BillSubsRatePlan; - export import AvailableRatePlanGetResponse = AvailableRatePlansAPI.AvailableRatePlanGetResponse; +export namespace RatePlans { + export import BillSubsRatePlan = RatePlansAPI.BillSubsRatePlan; + export import RatePlanGetResponse = RatePlansAPI.RatePlanGetResponse; } diff --git a/src/resources/rulesets/versions/by-tags.ts b/src/resources/rulesets/versions/by-tag.ts similarity index 82% rename from src/resources/rulesets/versions/by-tags.ts rename to src/resources/rulesets/versions/by-tag.ts index 2050d9944b..c788c7e30e 100644 --- a/src/resources/rulesets/versions/by-tags.ts +++ b/src/resources/rulesets/versions/by-tag.ts @@ -2,10 +2,10 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as ByTagsAPI from 'cloudflare/resources/rulesets/versions/by-tags'; +import * as ByTagAPI from 'cloudflare/resources/rulesets/versions/by-tag'; import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets'; -export class ByTags extends APIResource { +export class ByTag extends APIResource { /** * Fetches the rules of a managed account ruleset version for a given tag. */ @@ -33,6 +33,6 @@ export interface ByTagGetParams { account_id: string; } -export namespace ByTags { - export import ByTagGetParams = ByTagsAPI.ByTagGetParams; +export namespace ByTag { + export import ByTagGetParams = ByTagAPI.ByTagGetParams; } diff --git a/src/resources/rulesets/versions/index.ts b/src/resources/rulesets/versions/index.ts index 50740b2e6e..ec12e0d4d7 100644 --- a/src/resources/rulesets/versions/index.ts +++ b/src/resources/rulesets/versions/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { ByTagGetParams, ByTags } from './by-tags'; +export { ByTagGetParams, ByTag } from './by-tag'; export { VersionListParams, VersionDeleteParams, VersionGetParams, Versions } from './versions'; diff --git a/src/resources/rulesets/versions/versions.ts b/src/resources/rulesets/versions/versions.ts index a8dea80c33..eae07d750b 100644 --- a/src/resources/rulesets/versions/versions.ts +++ b/src/resources/rulesets/versions/versions.ts @@ -6,10 +6,10 @@ import { isRequestOptions } from 'cloudflare/core'; import { CloudflareError } from 'cloudflare/error'; import * as VersionsAPI from 'cloudflare/resources/rulesets/versions/versions'; import * as RulesetsAPI from 'cloudflare/resources/rulesets/rulesets'; -import * as ByTagsAPI from 'cloudflare/resources/rulesets/versions/by-tags'; +import * as ByTagAPI from 'cloudflare/resources/rulesets/versions/by-tag'; export class Versions extends APIResource { - byTags: ByTagsAPI.ByTags = new ByTagsAPI.ByTags(this._client); + byTag: ByTagAPI.ByTag = new ByTagAPI.ByTag(this._client); /** * Fetches the versions of an account or zone ruleset. @@ -187,6 +187,6 @@ export namespace Versions { export import VersionListParams = VersionsAPI.VersionListParams; export import VersionDeleteParams = VersionsAPI.VersionDeleteParams; export import VersionGetParams = VersionsAPI.VersionGetParams; - export import ByTags = ByTagsAPI.ByTags; - export import ByTagGetParams = ByTagsAPI.ByTagGetParams; + export import ByTag = ByTagAPI.ByTag; + export import ByTagGetParams = ByTagAPI.ByTagGetParams; } diff --git a/src/resources/rum/index.ts b/src/resources/rum/index.ts index 3cfec381d6..cf3567e22f 100644 --- a/src/resources/rum/index.ts +++ b/src/resources/rum/index.ts @@ -20,5 +20,5 @@ export { SiteInfoDeleteParams, SiteInfoGetParams, RUMSitesV4PagePaginationArray, - SiteInfos, -} from './site-infos'; + SiteInfo, +} from './site-info'; diff --git a/src/resources/rum/rum.ts b/src/resources/rum/rum.ts index c5d7bb823b..c2978d8de1 100644 --- a/src/resources/rum/rum.ts +++ b/src/resources/rum/rum.ts @@ -2,23 +2,23 @@ import { APIResource } from 'cloudflare/resource'; import * as RulesAPI from 'cloudflare/resources/rum/rules'; -import * as SiteInfosAPI from 'cloudflare/resources/rum/site-infos'; +import * as SiteInfoAPI from 'cloudflare/resources/rum/site-info'; export class RUM extends APIResource { - siteInfos: SiteInfosAPI.SiteInfos = new SiteInfosAPI.SiteInfos(this._client); + siteInfo: SiteInfoAPI.SiteInfo = new SiteInfoAPI.SiteInfo(this._client); rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); } export namespace RUM { - export import SiteInfos = SiteInfosAPI.SiteInfos; - export import RUMSite = SiteInfosAPI.RUMSite; - export import SiteInfoDeleteResponse = SiteInfosAPI.SiteInfoDeleteResponse; - export import RUMSitesV4PagePaginationArray = SiteInfosAPI.RUMSitesV4PagePaginationArray; - export import SiteInfoCreateParams = SiteInfosAPI.SiteInfoCreateParams; - export import SiteInfoUpdateParams = SiteInfosAPI.SiteInfoUpdateParams; - export import SiteInfoListParams = SiteInfosAPI.SiteInfoListParams; - export import SiteInfoDeleteParams = SiteInfosAPI.SiteInfoDeleteParams; - export import SiteInfoGetParams = SiteInfosAPI.SiteInfoGetParams; + export import SiteInfo = SiteInfoAPI.SiteInfo; + export import RUMSite = SiteInfoAPI.RUMSite; + export import SiteInfoDeleteResponse = SiteInfoAPI.SiteInfoDeleteResponse; + export import RUMSitesV4PagePaginationArray = SiteInfoAPI.RUMSitesV4PagePaginationArray; + export import SiteInfoCreateParams = SiteInfoAPI.SiteInfoCreateParams; + export import SiteInfoUpdateParams = SiteInfoAPI.SiteInfoUpdateParams; + export import SiteInfoListParams = SiteInfoAPI.SiteInfoListParams; + export import SiteInfoDeleteParams = SiteInfoAPI.SiteInfoDeleteParams; + export import SiteInfoGetParams = SiteInfoAPI.SiteInfoGetParams; export import Rules = RulesAPI.Rules; export import RUMRule = RulesAPI.RUMRule; export import RuleListResponse = RulesAPI.RuleListResponse; diff --git a/src/resources/rum/site-infos.ts b/src/resources/rum/site-info.ts similarity index 86% rename from src/resources/rum/site-infos.ts rename to src/resources/rum/site-info.ts index 7afdfa1933..58d1570cb8 100644 --- a/src/resources/rum/site-infos.ts +++ b/src/resources/rum/site-info.ts @@ -2,11 +2,11 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as SiteInfosAPI from 'cloudflare/resources/rum/site-infos'; +import * as SiteInfoAPI from 'cloudflare/resources/rum/site-info'; import * as RulesAPI from 'cloudflare/resources/rum/rules'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; -export class SiteInfos extends APIResource { +export class SiteInfo extends APIResource { /** * Creates a new Web Analytics site. */ @@ -214,13 +214,13 @@ export interface SiteInfoGetParams { account_id: string; } -export namespace SiteInfos { - export import RUMSite = SiteInfosAPI.RUMSite; - export import SiteInfoDeleteResponse = SiteInfosAPI.SiteInfoDeleteResponse; - export import RUMSitesV4PagePaginationArray = SiteInfosAPI.RUMSitesV4PagePaginationArray; - export import SiteInfoCreateParams = SiteInfosAPI.SiteInfoCreateParams; - export import SiteInfoUpdateParams = SiteInfosAPI.SiteInfoUpdateParams; - export import SiteInfoListParams = SiteInfosAPI.SiteInfoListParams; - export import SiteInfoDeleteParams = SiteInfosAPI.SiteInfoDeleteParams; - export import SiteInfoGetParams = SiteInfosAPI.SiteInfoGetParams; +export namespace SiteInfo { + export import RUMSite = SiteInfoAPI.RUMSite; + export import SiteInfoDeleteResponse = SiteInfoAPI.SiteInfoDeleteResponse; + export import RUMSitesV4PagePaginationArray = SiteInfoAPI.RUMSitesV4PagePaginationArray; + export import SiteInfoCreateParams = SiteInfoAPI.SiteInfoCreateParams; + export import SiteInfoUpdateParams = SiteInfoAPI.SiteInfoUpdateParams; + export import SiteInfoListParams = SiteInfoAPI.SiteInfoListParams; + export import SiteInfoDeleteParams = SiteInfoAPI.SiteInfoDeleteParams; + export import SiteInfoGetParams = SiteInfoAPI.SiteInfoGetParams; } diff --git a/src/resources/stream/clips.ts b/src/resources/stream/clip.ts similarity index 95% rename from src/resources/stream/clips.ts rename to src/resources/stream/clip.ts index 33a19a8c88..c0194348d4 100644 --- a/src/resources/stream/clips.ts +++ b/src/resources/stream/clip.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as ClipsAPI from 'cloudflare/resources/stream/clips'; +import * as ClipAPI from 'cloudflare/resources/stream/clip'; -export class Clips extends APIResource { +export class Clip extends APIResource { /** * Clips a video based on the specified start and end times provided in seconds. */ @@ -192,7 +192,7 @@ export namespace ClipCreateParams { } } -export namespace Clips { - export import StreamClipping = ClipsAPI.StreamClipping; - export import ClipCreateParams = ClipsAPI.ClipCreateParams; +export namespace Clip { + export import StreamClipping = ClipAPI.StreamClipping; + export import ClipCreateParams = ClipAPI.ClipCreateParams; } diff --git a/src/resources/stream/copies.ts b/src/resources/stream/copy.ts similarity index 94% rename from src/resources/stream/copies.ts rename to src/resources/stream/copy.ts index 12f1023489..ea338938e5 100644 --- a/src/resources/stream/copies.ts +++ b/src/resources/stream/copy.ts @@ -2,10 +2,10 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as CopiesAPI from 'cloudflare/resources/stream/copies'; +import * as CopyAPI from 'cloudflare/resources/stream/copy'; import * as StreamAPI from 'cloudflare/resources/stream/stream'; -export class Copies extends APIResource { +export class Copy extends APIResource { /** * Uploads a video to Stream from a provided URL. */ @@ -114,6 +114,6 @@ export namespace CopyCreateParams { } } -export namespace Copies { - export import CopyCreateParams = CopiesAPI.CopyCreateParams; +export namespace Copy { + export import CopyCreateParams = CopyAPI.CopyCreateParams; } diff --git a/src/resources/stream/direct-uploads.ts b/src/resources/stream/direct-upload.ts similarity index 91% rename from src/resources/stream/direct-uploads.ts rename to src/resources/stream/direct-upload.ts index cec8f2832a..3e68922978 100644 --- a/src/resources/stream/direct-uploads.ts +++ b/src/resources/stream/direct-upload.ts @@ -2,10 +2,10 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as DirectUploadsAPI from 'cloudflare/resources/stream/direct-uploads'; +import * as DirectUploadAPI from 'cloudflare/resources/stream/direct-upload'; import * as WatermarksAPI from 'cloudflare/resources/stream/watermarks'; -export class DirectUploads extends APIResource { +export class DirectUpload extends APIResource { /** * Creates a direct upload that allows video uploads without an API key. */ @@ -127,7 +127,7 @@ export namespace DirectUploadCreateParams { } } -export namespace DirectUploads { - export import DirectUploadCreateResponse = DirectUploadsAPI.DirectUploadCreateResponse; - export import DirectUploadCreateParams = DirectUploadsAPI.DirectUploadCreateParams; +export namespace DirectUpload { + export import DirectUploadCreateResponse = DirectUploadAPI.DirectUploadCreateResponse; + export import DirectUploadCreateParams = DirectUploadAPI.DirectUploadCreateParams; } diff --git a/src/resources/stream/embeds.ts b/src/resources/stream/embed.ts similarity index 76% rename from src/resources/stream/embeds.ts rename to src/resources/stream/embed.ts index 4a8083ccc2..fc89519c27 100644 --- a/src/resources/stream/embeds.ts +++ b/src/resources/stream/embed.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as EmbedsAPI from 'cloudflare/resources/stream/embeds'; +import * as EmbedAPI from 'cloudflare/resources/stream/embed'; -export class Embeds extends APIResource { +export class Embed extends APIResource { /** * Fetches an HTML code snippet to embed a video in a web page delivered through * Cloudflare. On success, returns an HTML fragment for use on web pages to display @@ -25,7 +25,7 @@ export interface EmbedGetParams { account_id: string; } -export namespace Embeds { - export import EmbedGetResponse = EmbedsAPI.EmbedGetResponse; - export import EmbedGetParams = EmbedsAPI.EmbedGetParams; +export namespace Embed { + export import EmbedGetResponse = EmbedAPI.EmbedGetResponse; + export import EmbedGetParams = EmbedAPI.EmbedGetParams; } diff --git a/src/resources/stream/index.ts b/src/resources/stream/index.ts index 72fafba5ab..52e8d459b1 100644 --- a/src/resources/stream/index.ts +++ b/src/resources/stream/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { CopyCreateParams, Copies } from './copies'; -export { DirectUploadCreateResponse, DirectUploadCreateParams, DirectUploads } from './direct-uploads'; +export { CopyCreateParams, Copy } from './copy'; +export { DirectUploadCreateResponse, DirectUploadCreateParams, DirectUpload } from './direct-upload'; export { DownloadCreateResponse, DownloadDeleteResponse, @@ -11,7 +11,7 @@ export { DownloadGetParams, Downloads, } from './downloads'; -export { EmbedGetResponse, EmbedGetParams, Embeds } from './embeds'; +export { EmbedGetResponse, EmbedGetParams, Embed } from './embed'; export { StreamAdditionalAudio, AudioTrackDeleteResponse, @@ -32,7 +32,7 @@ export { CaptionGetParams, Captions, } from './captions'; -export { StreamClipping, ClipCreateParams, Clips } from './clips'; +export { StreamClipping, ClipCreateParams, Clip } from './clip'; export { StreamKeys, KeyDeleteResponse, @@ -73,7 +73,7 @@ export { WatermarkGetParams, Watermarks, } from './watermarks'; -export { TokenCreateResponse, TokenCreateParams, Tokens } from './tokens'; +export { TokenCreateResponse, TokenCreateParams, Token } from './token'; export { VideoStorageUsageResponse, VideoStorageUsageParams, Videos } from './videos'; export { WebhookUpdateResponse, diff --git a/src/resources/stream/stream.ts b/src/resources/stream/stream.ts index 19379b2953..da0cb0e065 100644 --- a/src/resources/stream/stream.ts +++ b/src/resources/stream/stream.ts @@ -5,13 +5,13 @@ import { APIResource } from 'cloudflare/resource'; import * as StreamAPI from 'cloudflare/resources/stream/stream'; import * as AudioTracksAPI from 'cloudflare/resources/stream/audio-tracks'; import * as CaptionsAPI from 'cloudflare/resources/stream/captions'; -import * as ClipsAPI from 'cloudflare/resources/stream/clips'; -import * as CopiesAPI from 'cloudflare/resources/stream/copies'; -import * as DirectUploadsAPI from 'cloudflare/resources/stream/direct-uploads'; +import * as ClipAPI from 'cloudflare/resources/stream/clip'; +import * as CopyAPI from 'cloudflare/resources/stream/copy'; +import * as DirectUploadAPI from 'cloudflare/resources/stream/direct-upload'; import * as DownloadsAPI from 'cloudflare/resources/stream/downloads'; -import * as EmbedsAPI from 'cloudflare/resources/stream/embeds'; +import * as EmbedAPI from 'cloudflare/resources/stream/embed'; import * as KeysAPI from 'cloudflare/resources/stream/keys'; -import * as TokensAPI from 'cloudflare/resources/stream/tokens'; +import * as TokenAPI from 'cloudflare/resources/stream/token'; import * as VideosAPI from 'cloudflare/resources/stream/videos'; import * as WatermarksAPI from 'cloudflare/resources/stream/watermarks'; import * as WebhooksAPI from 'cloudflare/resources/stream/webhooks'; @@ -20,17 +20,17 @@ import * as LiveInputsAPI from 'cloudflare/resources/stream/live-inputs/live-inp export class Stream extends APIResource { audioTracks: AudioTracksAPI.AudioTracks = new AudioTracksAPI.AudioTracks(this._client); videos: VideosAPI.Videos = new VideosAPI.Videos(this._client); - clips: ClipsAPI.Clips = new ClipsAPI.Clips(this._client); - copies: CopiesAPI.Copies = new CopiesAPI.Copies(this._client); - directUploads: DirectUploadsAPI.DirectUploads = new DirectUploadsAPI.DirectUploads(this._client); + clip: ClipAPI.Clip = new ClipAPI.Clip(this._client); + copy: CopyAPI.Copy = new CopyAPI.Copy(this._client); + directUpload: DirectUploadAPI.DirectUpload = new DirectUploadAPI.DirectUpload(this._client); keys: KeysAPI.Keys = new KeysAPI.Keys(this._client); liveInputs: LiveInputsAPI.LiveInputs = new LiveInputsAPI.LiveInputs(this._client); watermarks: WatermarksAPI.Watermarks = new WatermarksAPI.Watermarks(this._client); webhooks: WebhooksAPI.Webhooks = new WebhooksAPI.Webhooks(this._client); captions: CaptionsAPI.Captions = new CaptionsAPI.Captions(this._client); downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client); - embeds: EmbedsAPI.Embeds = new EmbedsAPI.Embeds(this._client); - tokens: TokensAPI.Tokens = new TokensAPI.Tokens(this._client); + embed: EmbedAPI.Embed = new EmbedAPI.Embed(this._client); + token: TokenAPI.Token = new TokenAPI.Token(this._client); /** * Initiates a video upload using the TUS protocol. On success, the server responds @@ -410,14 +410,14 @@ export namespace Stream { export import Videos = VideosAPI.Videos; export import VideoStorageUsageResponse = VideosAPI.VideoStorageUsageResponse; export import VideoStorageUsageParams = VideosAPI.VideoStorageUsageParams; - export import Clips = ClipsAPI.Clips; - export import StreamClipping = ClipsAPI.StreamClipping; - export import ClipCreateParams = ClipsAPI.ClipCreateParams; - export import Copies = CopiesAPI.Copies; - export import CopyCreateParams = CopiesAPI.CopyCreateParams; - export import DirectUploads = DirectUploadsAPI.DirectUploads; - export import DirectUploadCreateResponse = DirectUploadsAPI.DirectUploadCreateResponse; - export import DirectUploadCreateParams = DirectUploadsAPI.DirectUploadCreateParams; + export import Clip = ClipAPI.Clip; + export import StreamClipping = ClipAPI.StreamClipping; + export import ClipCreateParams = ClipAPI.ClipCreateParams; + export import Copy = CopyAPI.Copy; + export import CopyCreateParams = CopyAPI.CopyCreateParams; + export import DirectUpload = DirectUploadAPI.DirectUpload; + export import DirectUploadCreateResponse = DirectUploadAPI.DirectUploadCreateResponse; + export import DirectUploadCreateParams = DirectUploadAPI.DirectUploadCreateParams; export import Keys = KeysAPI.Keys; export import StreamKeys = KeysAPI.StreamKeys; export import KeyDeleteResponse = KeysAPI.KeyDeleteResponse; @@ -465,10 +465,10 @@ export namespace Stream { export import DownloadCreateParams = DownloadsAPI.DownloadCreateParams; export import DownloadDeleteParams = DownloadsAPI.DownloadDeleteParams; export import DownloadGetParams = DownloadsAPI.DownloadGetParams; - export import Embeds = EmbedsAPI.Embeds; - export import EmbedGetResponse = EmbedsAPI.EmbedGetResponse; - export import EmbedGetParams = EmbedsAPI.EmbedGetParams; - export import Tokens = TokensAPI.Tokens; - export import TokenCreateResponse = TokensAPI.TokenCreateResponse; - export import TokenCreateParams = TokensAPI.TokenCreateParams; + export import Embed = EmbedAPI.Embed; + export import EmbedGetResponse = EmbedAPI.EmbedGetResponse; + export import EmbedGetParams = EmbedAPI.EmbedGetParams; + export import Token = TokenAPI.Token; + export import TokenCreateResponse = TokenAPI.TokenCreateResponse; + export import TokenCreateParams = TokenAPI.TokenCreateParams; } diff --git a/src/resources/stream/tokens.ts b/src/resources/stream/token.ts similarity index 92% rename from src/resources/stream/tokens.ts rename to src/resources/stream/token.ts index 6ad857fae7..d96873aa79 100644 --- a/src/resources/stream/tokens.ts +++ b/src/resources/stream/token.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as TokensAPI from 'cloudflare/resources/stream/tokens'; +import * as TokenAPI from 'cloudflare/resources/stream/token'; -export class Tokens extends APIResource { +export class Token extends APIResource { /** * Creates a signed URL token for a video. If a body is not provided in the * request, a token is created with default values. @@ -112,7 +112,7 @@ export namespace TokenCreateParams { } } -export namespace Tokens { - export import TokenCreateResponse = TokensAPI.TokenCreateResponse; - export import TokenCreateParams = TokensAPI.TokenCreateParams; +export namespace Token { + export import TokenCreateResponse = TokenAPI.TokenCreateResponse; + export import TokenCreateParams = TokenAPI.TokenCreateParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts similarity index 98% rename from src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.ts rename to src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index f38aea0e8b..5707866d93 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as BindingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings'; +import * as BindingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings'; export class Bindings extends APIResource { /** diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts similarity index 86% rename from src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.ts rename to src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts index cf31ad8535..0cfa601498 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts @@ -3,18 +3,18 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import { type Response } from 'cloudflare/_shims/index'; -import * as ContentScriptsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts'; +import * as ContentAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content'; import * as ScriptsAPI from 'cloudflare/resources/workers/scripts/scripts'; import { type Uploadable, multipartFormRequestOptions } from 'cloudflare/core'; -export class Scripts extends APIResource { +export class Content extends APIResource { /** * Put script content for a script uploaded to a Workers for Platforms namespace. */ update( dispatchNamespace: string, scriptName: string, - params: ScriptUpdateParams, + params: ContentUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { @@ -46,7 +46,7 @@ export class Scripts extends APIResource { get( dispatchNamespace: string, scriptName: string, - params: ScriptGetParams, + params: ContentGetParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -57,7 +57,7 @@ export class Scripts extends APIResource { } } -export interface ScriptUpdateParams { +export interface ContentUpdateParams { /** * Path param: Identifier */ @@ -77,7 +77,7 @@ export interface ScriptUpdateParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata?: ScriptUpdateParams.Metadata; + metadata?: ContentUpdateParams.Metadata; /** * Header param: The multipart name of a script upload part containing script @@ -92,7 +92,7 @@ export interface ScriptUpdateParams { 'CF-WORKER-MAIN-MODULE-PART'?: string; } -export namespace ScriptUpdateParams { +export namespace ContentUpdateParams { /** * JSON encoded metadata about the uploaded parts and Worker configuration. */ @@ -112,14 +112,14 @@ export namespace ScriptUpdateParams { } } -export interface ScriptGetParams { +export interface ContentGetParams { /** * Identifier */ account_id: string; } -export namespace Scripts { - export import ScriptUpdateParams = ContentScriptsAPI.ScriptUpdateParams; - export import ScriptGetParams = ContentScriptsAPI.ScriptGetParams; +export namespace Content { + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; + export import ContentGetParams = ContentAPI.ContentGetParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/content.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/content.ts deleted file mode 100644 index 8b840a8d24..0000000000 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/content.ts +++ /dev/null @@ -1,26 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from 'cloudflare/resource'; -import * as BindingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings'; -import * as ScriptsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts'; -import * as SettingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings'; - -export class Content extends APIResource { - scripts: ScriptsAPI.Scripts = new ScriptsAPI.Scripts(this._client); - settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); - bindings: BindingsAPI.Bindings = new BindingsAPI.Bindings(this._client); -} - -export namespace Content { - export import Scripts = ScriptsAPI.Scripts; - export import ScriptUpdateParams = ScriptsAPI.ScriptUpdateParams; - export import ScriptGetParams = ScriptsAPI.ScriptGetParams; - export import Settings = SettingsAPI.Settings; - export import SettingEditResponse = SettingsAPI.SettingEditResponse; - export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingEditParams = SettingsAPI.SettingEditParams; - export import SettingGetParams = SettingsAPI.SettingGetParams; - export import Bindings = BindingsAPI.Bindings; - export import BindingGetResponse = BindingsAPI.BindingGetResponse; - export import BindingGetParams = BindingsAPI.BindingGetParams; -} diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/index.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/index.ts deleted file mode 100644 index 50946297b8..0000000000 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { BindingGetResponse, BindingGetParams, Bindings } from './bindings'; -export { Content } from './content'; -export { ScriptUpdateParams, ScriptGetParams, Scripts } from './scripts'; -export { - SettingEditResponse, - SettingGetResponse, - SettingEditParams, - SettingGetParams, - Settings, -} from './settings'; 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 7ba5700d56..6cc4c1ee4c 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Content } from './content/index'; +export { BindingGetResponse, BindingGetParams, Bindings } from './bindings'; +export { ContentUpdateParams, ContentGetParams, Content } from './content'; +export { + SettingEditResponse, + SettingGetResponse, + SettingEditParams, + SettingGetParams, + Settings, +} from './settings'; export { WorkersNamespaceScript, ScriptUpdateParams, 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 fc3cce65e6..9129909b21 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -4,11 +4,15 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as ScriptsScriptsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts'; import * as ScriptsAPI from 'cloudflare/resources/workers/scripts/scripts'; -import * as ContentAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/content'; +import * as BindingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings'; +import * as ContentAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content'; +import * as SettingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/settings'; import { type Uploadable, maybeMultipartFormRequestOptions } from 'cloudflare/core'; export class Scripts extends APIResource { content: ContentAPI.Content = new ContentAPI.Content(this._client); + settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); + bindings: BindingsAPI.Bindings = new BindingsAPI.Bindings(this._client); /** * Upload a worker module to a Workers for Platforms namespace. @@ -369,4 +373,14 @@ export namespace Scripts { export import ScriptDeleteParams = ScriptsScriptsAPI.ScriptDeleteParams; export import ScriptGetParams = ScriptsScriptsAPI.ScriptGetParams; export import Content = ContentAPI.Content; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; + export import ContentGetParams = ContentAPI.ContentGetParams; + export import Settings = SettingsAPI.Settings; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; + export import SettingGetResponse = SettingsAPI.SettingGetResponse; + export import SettingEditParams = SettingsAPI.SettingEditParams; + export import SettingGetParams = SettingsAPI.SettingGetParams; + export import Bindings = BindingsAPI.Bindings; + export import BindingGetResponse = BindingsAPI.BindingGetResponse; + export import BindingGetParams = BindingsAPI.BindingGetParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts similarity index 99% rename from src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.ts rename to src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index 729835639d..a73db1dd0f 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -2,7 +2,7 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as SettingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings'; +import * as SettingsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/settings'; export class Settings extends APIResource { /** diff --git a/src/resources/zero-trust/devices/devices.ts b/src/resources/zero-trust/devices/devices.ts index 725949a861..e868e7d505 100644 --- a/src/resources/zero-trust/devices/devices.ts +++ b/src/resources/zero-trust/devices/devices.ts @@ -6,9 +6,9 @@ import * as DevicesAPI from 'cloudflare/resources/zero-trust/devices/devices'; import * as DEXTestsAPI from 'cloudflare/resources/zero-trust/devices/dex-tests'; import * as NetworksAPI from 'cloudflare/resources/zero-trust/devices/networks'; import * as OverrideCodesAPI from 'cloudflare/resources/zero-trust/devices/override-codes'; -import * as RevokesAPI from 'cloudflare/resources/zero-trust/devices/revokes'; +import * as RevokeAPI from 'cloudflare/resources/zero-trust/devices/revoke'; import * as SettingsAPI from 'cloudflare/resources/zero-trust/devices/settings'; -import * as UnrevokesAPI from 'cloudflare/resources/zero-trust/devices/unrevokes'; +import * as UnrevokeAPI from 'cloudflare/resources/zero-trust/devices/unrevoke'; import * as PoliciesAPI from 'cloudflare/resources/zero-trust/devices/policies/policies'; import * as PostureAPI from 'cloudflare/resources/zero-trust/devices/posture/posture'; @@ -17,9 +17,9 @@ export class Devices extends APIResource { networks: NetworksAPI.Networks = new NetworksAPI.Networks(this._client); policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); posture: PostureAPI.Posture = new PostureAPI.Posture(this._client); - revokes: RevokesAPI.Revokes = new RevokesAPI.Revokes(this._client); + revoke: RevokeAPI.Revoke = new RevokeAPI.Revoke(this._client); settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); - unrevokes: UnrevokesAPI.Unrevokes = new UnrevokesAPI.Unrevokes(this._client); + unrevoke: UnrevokeAPI.Unrevoke = new UnrevokeAPI.Unrevoke(this._client); overrideCodes: OverrideCodesAPI.OverrideCodes = new OverrideCodesAPI.OverrideCodes(this._client); /** @@ -220,16 +220,16 @@ export namespace Devices { export import PostureListParams = PostureAPI.PostureListParams; export import PostureDeleteParams = PostureAPI.PostureDeleteParams; export import PostureGetParams = PostureAPI.PostureGetParams; - export import Revokes = RevokesAPI.Revokes; - export import RevokeCreateResponse = RevokesAPI.RevokeCreateResponse; - export import RevokeCreateParams = RevokesAPI.RevokeCreateParams; + export import Revoke = RevokeAPI.Revoke; + export import RevokeCreateResponse = RevokeAPI.RevokeCreateResponse; + export import RevokeCreateParams = RevokeAPI.RevokeCreateParams; export import Settings = SettingsAPI.Settings; export import TeamsDevicesZeroTrustAccountDeviceSettings = SettingsAPI.TeamsDevicesZeroTrustAccountDeviceSettings; export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; export import SettingListParams = SettingsAPI.SettingListParams; - export import Unrevokes = UnrevokesAPI.Unrevokes; - export import UnrevokeCreateResponse = UnrevokesAPI.UnrevokeCreateResponse; - export import UnrevokeCreateParams = UnrevokesAPI.UnrevokeCreateParams; + export import Unrevoke = UnrevokeAPI.Unrevoke; + export import UnrevokeCreateResponse = UnrevokeAPI.UnrevokeCreateResponse; + export import UnrevokeCreateParams = UnrevokeAPI.UnrevokeCreateParams; export import OverrideCodes = OverrideCodesAPI.OverrideCodes; export import OverrideCodeListResponse = OverrideCodesAPI.OverrideCodeListResponse; export import OverrideCodeListParams = OverrideCodesAPI.OverrideCodeListParams; diff --git a/src/resources/zero-trust/devices/index.ts b/src/resources/zero-trust/devices/index.ts index 1726055104..537be5296d 100644 --- a/src/resources/zero-trust/devices/index.ts +++ b/src/resources/zero-trust/devices/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { OverrideCodeListResponse, OverrideCodeListParams, OverrideCodes } from './override-codes'; -export { RevokeCreateResponse, RevokeCreateParams, Revokes } from './revokes'; +export { RevokeCreateResponse, RevokeCreateParams, Revoke } from './revoke'; export { TeamsDevicesDeviceDEXTestSchemasHTTP, DEXTestListResponse, @@ -60,4 +60,4 @@ export { SettingListParams, Settings, } from './settings'; -export { UnrevokeCreateResponse, UnrevokeCreateParams, Unrevokes } from './unrevokes'; +export { UnrevokeCreateResponse, UnrevokeCreateParams, Unrevoke } from './unrevoke'; diff --git a/src/resources/zero-trust/devices/revokes.ts b/src/resources/zero-trust/devices/revoke.ts similarity index 74% rename from src/resources/zero-trust/devices/revokes.ts rename to src/resources/zero-trust/devices/revoke.ts index 5c81d6fb93..5daaff0cab 100644 --- a/src/resources/zero-trust/devices/revokes.ts +++ b/src/resources/zero-trust/devices/revoke.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as RevokesAPI from 'cloudflare/resources/zero-trust/devices/revokes'; +import * as RevokeAPI from 'cloudflare/resources/zero-trust/devices/revoke'; -export class Revokes extends APIResource { +export class Revoke extends APIResource { /** * Revokes a list of devices. */ @@ -36,7 +36,7 @@ export interface RevokeCreateParams { body: Array; } -export namespace Revokes { - export import RevokeCreateResponse = RevokesAPI.RevokeCreateResponse; - export import RevokeCreateParams = RevokesAPI.RevokeCreateParams; +export namespace Revoke { + export import RevokeCreateResponse = RevokeAPI.RevokeCreateResponse; + export import RevokeCreateParams = RevokeAPI.RevokeCreateParams; } diff --git a/src/resources/zero-trust/devices/unrevokes.ts b/src/resources/zero-trust/devices/unrevoke.ts similarity index 74% rename from src/resources/zero-trust/devices/unrevokes.ts rename to src/resources/zero-trust/devices/unrevoke.ts index d20f990d0c..ecbedd9c14 100644 --- a/src/resources/zero-trust/devices/unrevokes.ts +++ b/src/resources/zero-trust/devices/unrevoke.ts @@ -2,9 +2,9 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as UnrevokesAPI from 'cloudflare/resources/zero-trust/devices/unrevokes'; +import * as UnrevokeAPI from 'cloudflare/resources/zero-trust/devices/unrevoke'; -export class Unrevokes extends APIResource { +export class Unrevoke extends APIResource { /** * Unrevokes a list of devices. */ @@ -36,7 +36,7 @@ export interface UnrevokeCreateParams { body: Array; } -export namespace Unrevokes { - export import UnrevokeCreateResponse = UnrevokesAPI.UnrevokeCreateResponse; - export import UnrevokeCreateParams = UnrevokesAPI.UnrevokeCreateParams; +export namespace Unrevoke { + export import UnrevokeCreateResponse = UnrevokeAPI.UnrevokeCreateResponse; + export import UnrevokeCreateParams = UnrevokeAPI.UnrevokeCreateParams; } diff --git a/src/resources/zones/settings/index.ts b/src/resources/zones/settings/index.ts index 7c8174c06e..e7697004c8 100644 --- a/src/resources/zones/settings/index.ts +++ b/src/resources/zones/settings/index.ts @@ -217,5 +217,5 @@ export { TrueClientIPHeader, } from './true-client-ip-header'; export { ZonesWAF, WAFEditParams, WAFGetParams, WAF } from './waf'; -export { ZonesWebp, WebpEditParams, WebpGetParams, Webp } from './webp'; +export { ZonesWebP, WebPEditParams, WebPGetParams, WebP } from './webp'; export { ZonesWebsockets, WebsocketEditParams, WebsocketGetParams, Websocket } from './websocket'; diff --git a/src/resources/zones/settings/settings.ts b/src/resources/zones/settings/settings.ts index e0d603e309..712003f053 100644 --- a/src/resources/zones/settings/settings.ts +++ b/src/resources/zones/settings/settings.ts @@ -51,7 +51,7 @@ import * as TLS1_3API from 'cloudflare/resources/zones/settings/tls-1-3'; import * as TLSClientAuthAPI from 'cloudflare/resources/zones/settings/tls-client-auth'; import * as TrueClientIPHeaderAPI from 'cloudflare/resources/zones/settings/true-client-ip-header'; import * as WAFAPI from 'cloudflare/resources/zones/settings/waf'; -import * as WebpAPI from 'cloudflare/resources/zones/settings/webp'; +import * as WebPAPI from 'cloudflare/resources/zones/settings/webp'; import * as WebsocketAPI from 'cloudflare/resources/zones/settings/websocket'; import * as ZeroRTTAPI from 'cloudflare/resources/zones/settings/zero-rtt'; @@ -126,7 +126,7 @@ export class Settings extends APIResource { this._client, ); waf: WAFAPI.WAF = new WAFAPI.WAF(this._client); - webp: WebpAPI.Webp = new WebpAPI.Webp(this._client); + WebP: WebPAPI.WebP = new WebPAPI.WebP(this._client); websocket: WebsocketAPI.Websocket = new WebsocketAPI.Websocket(this._client); fontSettings: FontSettingsAPI.FontSettings = new FontSettingsAPI.FontSettings(this._client); @@ -208,7 +208,7 @@ export type SettingEditResponse = Array< | TLSClientAuthAPI.ZonesTLSClientAuth | TrueClientIPHeaderAPI.ZonesTrueClientIPHeader | WAFAPI.ZonesWAF - | WebpAPI.ZonesWebp + | WebPAPI.ZonesWebP | WebsocketAPI.ZonesWebsockets >; @@ -447,7 +447,7 @@ export type SettingGetResponse = Array< | TLSClientAuthAPI.ZonesTLSClientAuth | TrueClientIPHeaderAPI.ZonesTrueClientIPHeader | WAFAPI.ZonesWAF - | WebpAPI.ZonesWebp + | WebPAPI.ZonesWebP | WebsocketAPI.ZonesWebsockets >; @@ -695,7 +695,7 @@ export interface SettingEditParams { | TLSClientAuthAPI.ZonesTLSClientAuth | TrueClientIPHeaderAPI.ZonesTrueClientIPHeader | WAFAPI.ZonesWAF - | WebpAPI.ZonesWebp + | WebPAPI.ZonesWebP | WebsocketAPI.ZonesWebsockets >; } @@ -1020,10 +1020,10 @@ export namespace Settings { export import ZonesWAF = WAFAPI.ZonesWAF; export import WAFEditParams = WAFAPI.WAFEditParams; export import WAFGetParams = WAFAPI.WAFGetParams; - export import Webp = WebpAPI.Webp; - export import ZonesWebp = WebpAPI.ZonesWebp; - export import WebpEditParams = WebpAPI.WebpEditParams; - export import WebpGetParams = WebpAPI.WebpGetParams; + export import WebP = WebPAPI.WebP; + export import ZonesWebP = WebPAPI.ZonesWebP; + export import WebPEditParams = WebPAPI.WebPEditParams; + export import WebPGetParams = WebPAPI.WebPGetParams; export import Websocket = WebsocketAPI.Websocket; export import ZonesWebsockets = WebsocketAPI.ZonesWebsockets; export import WebsocketEditParams = WebsocketAPI.WebsocketEditParams; diff --git a/src/resources/zones/settings/webp.ts b/src/resources/zones/settings/webp.ts index be72eea084..56cfc08732 100644 --- a/src/resources/zones/settings/webp.ts +++ b/src/resources/zones/settings/webp.ts @@ -2,19 +2,19 @@ import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; -import * as WebpAPI from 'cloudflare/resources/zones/settings/webp'; +import * as WebPAPI from 'cloudflare/resources/zones/settings/webp'; -export class Webp extends APIResource { +export class WebP extends APIResource { /** * When the client requesting the image supports the WebP image codec, and WebP * offers a performance advantage over the original image format, Cloudflare will * serve a WebP version of the original image. */ - edit(params: WebpEditParams, options?: Core.RequestOptions): Core.APIPromise { + edit(params: WebPEditParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.patch(`/zones/${zone_id}/settings/webp`, { body, ...options }) as Core.APIPromise<{ - result: ZonesWebp; + result: ZonesWebP; }> )._thenUnwrap((obj) => obj.result); } @@ -24,10 +24,10 @@ export class Webp extends APIResource { * offers a performance advantage over the original image format, Cloudflare will * serve a WebP version of the original image. */ - get(params: WebpGetParams, options?: Core.RequestOptions): Core.APIPromise { + get(params: WebPGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; return ( - this._client.get(`/zones/${zone_id}/settings/webp`, options) as Core.APIPromise<{ result: ZonesWebp }> + this._client.get(`/zones/${zone_id}/settings/webp`, options) as Core.APIPromise<{ result: ZonesWebP }> )._thenUnwrap((obj) => obj.result); } } @@ -37,7 +37,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 ZonesWebp { +export interface ZonesWebP { /** * ID of the zone setting. */ @@ -60,7 +60,7 @@ export interface ZonesWebp { modified_on?: string | null; } -export interface WebpEditParams { +export interface WebPEditParams { /** * Path param: Identifier */ @@ -72,15 +72,15 @@ export interface WebpEditParams { value: 'off' | 'on'; } -export interface WebpGetParams { +export interface WebPGetParams { /** * Identifier */ zone_id: string; } -export namespace Webp { - export import ZonesWebp = WebpAPI.ZonesWebp; - export import WebpEditParams = WebpAPI.WebpEditParams; - export import WebpGetParams = WebpAPI.WebpGetParams; +export namespace WebP { + export import ZonesWebP = WebPAPI.ZonesWebP; + export import WebPEditParams = WebPAPI.WebPEditParams; + export import WebPGetParams = WebPAPI.WebPGetParams; } diff --git a/tests/api-resources/alerting/v3/v3.test.ts b/tests/api-resources/alerting/available-alerts.test.ts similarity index 75% rename from tests/api-resources/alerting/v3/v3.test.ts rename to tests/api-resources/alerting/available-alerts.test.ts index 04ead6229b..27ba0cac0f 100644 --- a/tests/api-resources/alerting/v3/v3.test.ts +++ b/tests/api-resources/alerting/available-alerts.test.ts @@ -9,10 +9,12 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource v3', () => { +describe('resource availableAlerts', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = cloudflare.alerting.availableAlerts.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,6 +26,8 @@ describe('resource v3', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { - const response = await cloudflare.alerting.v3.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await cloudflare.alerting.availableAlerts.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); diff --git a/tests/api-resources/alerting/v3/destinations/eligible.test.ts b/tests/api-resources/alerting/destinations/eligible.test.ts similarity index 87% rename from tests/api-resources/alerting/v3/destinations/eligible.test.ts rename to tests/api-resources/alerting/destinations/eligible.test.ts index 5311d9c119..70c49d879a 100644 --- a/tests/api-resources/alerting/v3/destinations/eligible.test.ts +++ b/tests/api-resources/alerting/destinations/eligible.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource eligible', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.eligible.get({ + const responsePromise = cloudflare.alerting.destinations.eligible.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,7 +26,7 @@ describe('resource eligible', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.eligible.get({ + const response = await cloudflare.alerting.destinations.eligible.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts b/tests/api-resources/alerting/destinations/pagerduty.test.ts similarity index 84% rename from tests/api-resources/alerting/v3/destinations/pagerduty.test.ts rename to tests/api-resources/alerting/destinations/pagerduty.test.ts index 3a5bcbe950..e9ca642aec 100644 --- a/tests/api-resources/alerting/v3/destinations/pagerduty.test.ts +++ b/tests/api-resources/alerting/destinations/pagerduty.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource pagerduty', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.pagerduty.create({ + const responsePromise = cloudflare.alerting.destinations.pagerduty.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,14 +26,14 @@ describe('resource pagerduty', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.pagerduty.create({ + const response = await cloudflare.alerting.destinations.pagerduty.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.pagerduty.delete({ + const responsePromise = cloudflare.alerting.destinations.pagerduty.delete({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -47,14 +47,14 @@ describe('resource pagerduty', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.pagerduty.delete({ + const response = await cloudflare.alerting.destinations.pagerduty.delete({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.pagerduty.get({ + const responsePromise = cloudflare.alerting.destinations.pagerduty.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -68,14 +68,14 @@ describe('resource pagerduty', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.pagerduty.get({ + const response = await cloudflare.alerting.destinations.pagerduty.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('link: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.pagerduty.link( + const responsePromise = cloudflare.alerting.destinations.pagerduty.link( '8c71e667571b4f61b94d9e4b12158038', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); @@ -90,7 +90,7 @@ describe('resource pagerduty', () => { // skipped: tests are disabled for the time being test.skip('link: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.pagerduty.link( + const response = await cloudflare.alerting.destinations.pagerduty.link( '8c71e667571b4f61b94d9e4b12158038', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); diff --git a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts b/tests/api-resources/alerting/destinations/webhooks.test.ts similarity index 85% rename from tests/api-resources/alerting/v3/destinations/webhooks.test.ts rename to tests/api-resources/alerting/destinations/webhooks.test.ts index 3860b3020a..f7e9ea48dc 100644 --- a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/destinations/webhooks.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.webhooks.create({ + const responsePromise = cloudflare.alerting.destinations.webhooks.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Slack Webhook', url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', @@ -28,7 +28,7 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.webhooks.create({ + const response = await cloudflare.alerting.destinations.webhooks.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'Slack Webhook', url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', @@ -38,7 +38,7 @@ 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( + const responsePromise = cloudflare.alerting.destinations.webhooks.update( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -57,7 +57,7 @@ describe('resource webhooks', () => { // 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( + const response = await cloudflare.alerting.destinations.webhooks.update( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -70,7 +70,7 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.webhooks.list({ + const responsePromise = cloudflare.alerting.destinations.webhooks.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -84,14 +84,14 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.webhooks.list({ + const response = await cloudflare.alerting.destinations.webhooks.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.webhooks.delete( + const responsePromise = cloudflare.alerting.destinations.webhooks.delete( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); @@ -106,7 +106,7 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.webhooks.delete( + const response = await cloudflare.alerting.destinations.webhooks.delete( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); @@ -114,7 +114,7 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.webhooks.get( + const responsePromise = cloudflare.alerting.destinations.webhooks.get( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); @@ -129,7 +129,7 @@ describe('resource webhooks', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.webhooks.get( + const response = await cloudflare.alerting.destinations.webhooks.get( 'b115d5ec-15c6-41ee-8b76-92c449b5227b', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); diff --git a/tests/api-resources/alerting/v3/histories.test.ts b/tests/api-resources/alerting/history.test.ts similarity index 87% rename from tests/api-resources/alerting/v3/histories.test.ts rename to tests/api-resources/alerting/history.test.ts index 487821461e..60475dfda3 100644 --- a/tests/api-resources/alerting/v3/histories.test.ts +++ b/tests/api-resources/alerting/history.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource histories', () => { +describe('resource history', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.histories.list({ + const responsePromise = cloudflare.alerting.history.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,7 +26,7 @@ describe('resource histories', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { - const response = await cloudflare.alerting.v3.histories.list({ + const response = await cloudflare.alerting.history.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', before: '2022-05-20T20:29:58.679897Z', page: 1, diff --git a/tests/api-resources/alerting/v3/policies.test.ts b/tests/api-resources/alerting/policies.test.ts similarity index 91% rename from tests/api-resources/alerting/v3/policies.test.ts rename to tests/api-resources/alerting/policies.test.ts index d3068ba0e8..b3ff75669b 100644 --- a/tests/api-resources/alerting/v3/policies.test.ts +++ b/tests/api-resources/alerting/policies.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.policies.create({ + const responsePromise = cloudflare.alerting.policies.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_type: 'universal_ssl_event_type', enabled: true, @@ -30,7 +30,7 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.alerting.v3.policies.create({ + const response = await cloudflare.alerting.policies.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_type: 'universal_ssl_event_type', enabled: true, @@ -88,7 +88,7 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = cloudflare.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -102,7 +102,7 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.alerting.v3.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await cloudflare.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', alert_type: 'universal_ssl_event_type', description: 'Something describing the policy.', @@ -160,7 +160,7 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.policies.list({ + const responsePromise = cloudflare.alerting.policies.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -174,14 +174,14 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { - const response = await cloudflare.alerting.v3.policies.list({ + const response = await cloudflare.alerting.policies.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = cloudflare.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -195,14 +195,14 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await cloudflare.alerting.v3.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await cloudflare.alerting.policies.delete('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const responsePromise = cloudflare.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -216,7 +216,7 @@ describe('resource policies', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.alerting.v3.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { + const response = await cloudflare.alerting.policies.get('0da2b59e-f118-439d-8097-bdfb215203c9', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/email-routing/routing/addresses.test.ts b/tests/api-resources/email-routing/addresses.test.ts similarity index 83% rename from tests/api-resources/email-routing/routing/addresses.test.ts rename to tests/api-resources/email-routing/addresses.test.ts index a3e33a4656..2c0f696bb6 100644 --- a/tests/api-resources/email-routing/routing/addresses.test.ts +++ b/tests/api-resources/email-routing/addresses.test.ts @@ -12,10 +12,9 @@ const cloudflare = new Cloudflare({ describe('resource addresses', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.emailRouting.routing.addresses.create( - '023e105f4ecef8ad9ca31a8372d0c353', - { email: 'user@example.com' }, - ); + const responsePromise = cloudflare.emailRouting.addresses.create('023e105f4ecef8ad9ca31a8372d0c353', { + email: 'user@example.com', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -27,17 +26,14 @@ describe('resource addresses', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.emailRouting.routing.addresses.create( - '023e105f4ecef8ad9ca31a8372d0c353', - { email: 'user@example.com' }, - ); + const response = await cloudflare.emailRouting.addresses.create('023e105f4ecef8ad9ca31a8372d0c353', { + email: 'user@example.com', + }); }); // skipped: tests are disabled for the time being test.skip('list', async () => { - const responsePromise = cloudflare.emailRouting.routing.addresses.list( - '023e105f4ecef8ad9ca31a8372d0c353', - ); + const responsePromise = cloudflare.emailRouting.addresses.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -51,7 +47,7 @@ describe('resource addresses', () => { 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.emailRouting.routing.addresses.list('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.emailRouting.addresses.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); @@ -61,7 +57,7 @@ describe('resource addresses', () => { 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.emailRouting.routing.addresses.list( + cloudflare.emailRouting.addresses.list( '023e105f4ecef8ad9ca31a8372d0c353', { direction: 'asc', page: 1, per_page: 5, verified: true }, { path: '/_stainless_unknown_path' }, @@ -71,7 +67,7 @@ describe('resource addresses', () => { // skipped: tests are disabled for the time being test.skip('delete', async () => { - const responsePromise = cloudflare.emailRouting.routing.addresses.delete( + const responsePromise = cloudflare.emailRouting.addresses.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', ); @@ -88,7 +84,7 @@ describe('resource addresses', () => { 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.emailRouting.routing.addresses.delete( + cloudflare.emailRouting.addresses.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', { path: '/_stainless_unknown_path' }, @@ -98,7 +94,7 @@ describe('resource addresses', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.emailRouting.routing.addresses.get( + const responsePromise = cloudflare.emailRouting.addresses.get( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', ); @@ -115,7 +111,7 @@ describe('resource addresses', () => { 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.emailRouting.routing.addresses.get( + cloudflare.emailRouting.addresses.get( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/email-routing/routing/dns.test.ts b/tests/api-resources/email-routing/dns.test.ts similarity index 86% rename from tests/api-resources/email-routing/routing/dns.test.ts rename to tests/api-resources/email-routing/dns.test.ts index cd47a7cedc..62d07f7d3c 100644 --- a/tests/api-resources/email-routing/routing/dns.test.ts +++ b/tests/api-resources/email-routing/dns.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource dns', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.emailRouting.routing.dns.get('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.emailRouting.dns.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,7 +26,7 @@ describe('resource dns', () => { 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.emailRouting.routing.dns.get('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.emailRouting.dns.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); diff --git a/tests/api-resources/email-routing/routing/routing.test.ts b/tests/api-resources/email-routing/email-routing.test.ts similarity index 81% rename from tests/api-resources/email-routing/routing/routing.test.ts rename to tests/api-resources/email-routing/email-routing.test.ts index e1b71e062f..e9bf7eb5b7 100644 --- a/tests/api-resources/email-routing/routing/routing.test.ts +++ b/tests/api-resources/email-routing/email-routing.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource routing', () => { +describe('resource emailRouting', () => { // skipped: tests are disabled for the time being test.skip('disable', async () => { - const responsePromise = cloudflare.emailRouting.routing.disable('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.emailRouting.disable('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,7 +24,7 @@ describe('resource routing', () => { // skipped: tests are disabled for the time being test.skip('enable', async () => { - const responsePromise = cloudflare.emailRouting.routing.enable('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.emailRouting.enable('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -36,7 +36,7 @@ describe('resource routing', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.emailRouting.routing.get('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.emailRouting.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -50,9 +50,7 @@ describe('resource routing', () => { 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.emailRouting.routing.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), + cloudflare.emailRouting.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/email-routing/routing/rules/catch-alls.test.ts b/tests/api-resources/email-routing/rules/catch-alls.test.ts similarity index 88% rename from tests/api-resources/email-routing/routing/rules/catch-alls.test.ts rename to tests/api-resources/email-routing/rules/catch-alls.test.ts index 9b76300cf3..daf2c42cc0 100644 --- a/tests/api-resources/email-routing/routing/rules/catch-alls.test.ts +++ b/tests/api-resources/email-routing/rules/catch-alls.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource catchAlls', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.catchAlls.update( + const responsePromise = cloudflare.emailRouting.rules.catchAlls.update( '023e105f4ecef8ad9ca31a8372d0c353', { actions: [{ type: 'forward' }, { type: 'forward' }, { type: 'forward' }], @@ -30,7 +30,7 @@ describe('resource catchAlls', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.emailRouting.routing.rules.catchAlls.update( + const response = await cloudflare.emailRouting.rules.catchAlls.update( '023e105f4ecef8ad9ca31a8372d0c353', { actions: [ @@ -68,9 +68,7 @@ describe('resource catchAlls', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.catchAlls.get( - '023e105f4ecef8ad9ca31a8372d0c353', - ); + const responsePromise = cloudflare.emailRouting.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -84,7 +82,7 @@ describe('resource catchAlls', () => { 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.emailRouting.routing.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.emailRouting.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); diff --git a/tests/api-resources/email-routing/routing/rules/rules.test.ts b/tests/api-resources/email-routing/rules/rules.test.ts similarity index 91% rename from tests/api-resources/email-routing/routing/rules/rules.test.ts rename to tests/api-resources/email-routing/rules/rules.test.ts index 0fb8537f85..3b1ee31805 100644 --- a/tests/api-resources/email-routing/routing/rules/rules.test.ts +++ b/tests/api-resources/email-routing/rules/rules.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.create('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.emailRouting.rules.create('023e105f4ecef8ad9ca31a8372d0c353', { actions: [ { type: 'forward', @@ -56,7 +56,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.emailRouting.routing.rules.create('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.emailRouting.rules.create('023e105f4ecef8ad9ca31a8372d0c353', { actions: [ { type: 'forward', @@ -96,7 +96,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.update( + const responsePromise = cloudflare.emailRouting.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { @@ -144,7 +144,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.emailRouting.routing.rules.update( + const response = await cloudflare.emailRouting.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { @@ -188,7 +188,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('list', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.emailRouting.rules.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -202,7 +202,7 @@ describe('resource rules', () => { 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.emailRouting.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.emailRouting.rules.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); @@ -212,7 +212,7 @@ describe('resource rules', () => { 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.emailRouting.routing.rules.list( + cloudflare.emailRouting.rules.list( '023e105f4ecef8ad9ca31a8372d0c353', { enabled: true, page: 1, per_page: 5 }, { path: '/_stainless_unknown_path' }, @@ -222,7 +222,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('delete', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.delete( + const responsePromise = cloudflare.emailRouting.rules.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', ); @@ -239,7 +239,7 @@ describe('resource rules', () => { 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.emailRouting.routing.rules.delete( + cloudflare.emailRouting.rules.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { path: '/_stainless_unknown_path' }, @@ -249,7 +249,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.emailRouting.routing.rules.get( + const responsePromise = cloudflare.emailRouting.rules.get( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', ); @@ -266,7 +266,7 @@ describe('resource rules', () => { 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.emailRouting.routing.rules.get( + cloudflare.emailRouting.rules.get( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/logs/rayid.test.ts b/tests/api-resources/logs/rayid.test.ts index a46c84c0ac..7a212ca4cf 100644 --- a/tests/api-resources/logs/rayid.test.ts +++ b/tests/api-resources/logs/rayid.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource rayid', () => { +describe('resource RayID', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.logs.rayid.get('023e105f4ecef8ad9ca31a8372d0c353', '41ddf1740f67442d'); + const responsePromise = cloudflare.logs.RayID.get('023e105f4ecef8ad9ca31a8372d0c353', '41ddf1740f67442d'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,7 +26,7 @@ describe('resource rayid', () => { 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.logs.rayid.get('023e105f4ecef8ad9ca31a8372d0c353', '41ddf1740f67442d', { + cloudflare.logs.RayID.get('023e105f4ecef8ad9ca31a8372d0c353', '41ddf1740f67442d', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); @@ -36,7 +36,7 @@ describe('resource rayid', () => { test.skip('get: 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.logs.rayid.get( + cloudflare.logs.RayID.get( '023e105f4ecef8ad9ca31a8372d0c353', '41ddf1740f67442d', { fields: 'ClientIP,RayID,EdgeStartTimestamp', timestamps: 'unixnano' }, diff --git a/tests/api-resources/pcaps/downloads.test.ts b/tests/api-resources/pcaps/download.test.ts similarity index 78% rename from tests/api-resources/pcaps/downloads.test.ts rename to tests/api-resources/pcaps/download.test.ts index 54cff41a56..971d690ed6 100644 --- a/tests/api-resources/pcaps/downloads.test.ts +++ b/tests/api-resources/pcaps/download.test.ts @@ -8,10 +8,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource downloads', () => { +describe('resource download', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.pcaps.downloads.get('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.pcaps.download.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/pcaps/ownerships.test.ts b/tests/api-resources/pcaps/ownership.test.ts similarity index 85% rename from tests/api-resources/pcaps/ownerships.test.ts rename to tests/api-resources/pcaps/ownership.test.ts index d3347d2759..46826caf73 100644 --- a/tests/api-resources/pcaps/ownerships.test.ts +++ b/tests/api-resources/pcaps/ownership.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource ownerships', () => { +describe('resource ownership', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.pcaps.ownerships.create({ + const responsePromise = cloudflare.pcaps.ownership.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', }); @@ -27,7 +27,7 @@ describe('resource ownerships', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.pcaps.ownerships.create({ + const response = await cloudflare.pcaps.ownership.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', }); @@ -35,7 +35,7 @@ describe('resource ownerships', () => { // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.pcaps.ownerships.delete('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.pcaps.ownership.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -49,14 +49,14 @@ describe('resource ownerships', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await cloudflare.pcaps.ownerships.delete('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.pcaps.ownership.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.pcaps.ownerships.get({ + const responsePromise = cloudflare.pcaps.ownership.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -70,14 +70,12 @@ describe('resource ownerships', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.pcaps.ownerships.get({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await cloudflare.pcaps.ownership.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); }); // skipped: tests are disabled for the time being test.skip('validate: only required params', async () => { - const responsePromise = cloudflare.pcaps.ownerships.validate({ + const responsePromise = cloudflare.pcaps.ownership.validate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', ownership_challenge: 'ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt', @@ -93,7 +91,7 @@ describe('resource ownerships', () => { // skipped: tests are disabled for the time being test.skip('validate: required and optional params', async () => { - const response = await cloudflare.pcaps.ownerships.validate({ + const response = await cloudflare.pcaps.ownership.validate({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', destination_conf: 's3://pcaps-bucket?region=us-east-1', ownership_challenge: 'ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt', diff --git a/tests/api-resources/available-plans.test.ts b/tests/api-resources/plans.test.ts similarity index 82% rename from tests/api-resources/available-plans.test.ts rename to tests/api-resources/plans.test.ts index 70b094b110..b14ac2c7a2 100644 --- a/tests/api-resources/available-plans.test.ts +++ b/tests/api-resources/plans.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource availablePlans', () => { +describe('resource plans', () => { // skipped: tests are disabled for the time being test.skip('list', async () => { - const responsePromise = cloudflare.availablePlans.list('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.plans.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,15 +26,13 @@ describe('resource availablePlans', () => { 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.availablePlans.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), + cloudflare.plans.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.availablePlans.get( + const responsePromise = cloudflare.plans.get( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', ); @@ -51,7 +49,7 @@ describe('resource availablePlans', () => { 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.availablePlans.get('023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.plans.get('023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); diff --git a/tests/api-resources/available-rate-plans.test.ts b/tests/api-resources/rate-plans.test.ts similarity index 80% rename from tests/api-resources/available-rate-plans.test.ts rename to tests/api-resources/rate-plans.test.ts index fbe6439f8f..180319631b 100644 --- a/tests/api-resources/available-rate-plans.test.ts +++ b/tests/api-resources/rate-plans.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource availableRatePlans', () => { +describe('resource ratePlans', () => { // skipped: tests are disabled for the time being test.skip('get', async () => { - const responsePromise = cloudflare.availableRatePlans.get('023e105f4ecef8ad9ca31a8372d0c353'); + const responsePromise = cloudflare.ratePlans.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,9 +26,7 @@ describe('resource availableRatePlans', () => { 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.availableRatePlans.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), + cloudflare.ratePlans.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/rulesets/versions/by-tags.test.ts b/tests/api-resources/rulesets/versions/by-tag.test.ts similarity index 88% rename from tests/api-resources/rulesets/versions/by-tags.test.ts rename to tests/api-resources/rulesets/versions/by-tag.test.ts index a4455725e0..620ad0ac6d 100644 --- a/tests/api-resources/rulesets/versions/by-tags.test.ts +++ b/tests/api-resources/rulesets/versions/by-tag.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource byTags', () => { +describe('resource byTag', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.rulesets.versions.byTags.get( + const responsePromise = cloudflare.rulesets.versions.byTag.get( '2f2feab2026849078ba485f918791bdc', '1', 'directory-traversal', @@ -29,7 +29,7 @@ describe('resource byTags', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.rulesets.versions.byTags.get( + const response = await cloudflare.rulesets.versions.byTag.get( '2f2feab2026849078ba485f918791bdc', '1', 'directory-traversal', diff --git a/tests/api-resources/rum/site-infos.test.ts b/tests/api-resources/rum/site-info.test.ts similarity index 84% rename from tests/api-resources/rum/site-infos.test.ts rename to tests/api-resources/rum/site-info.test.ts index fccba599dd..3f41bd467f 100644 --- a/tests/api-resources/rum/site-infos.test.ts +++ b/tests/api-resources/rum/site-info.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource siteInfos', () => { +describe('resource siteInfo', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.rum.siteInfos.create({ + const responsePromise = cloudflare.rum.siteInfo.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,7 +26,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.rum.siteInfos.create({ + const response = await cloudflare.rum.siteInfo.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', auto_install: true, host: 'example.com', @@ -36,7 +36,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.rum.siteInfos.update('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.rum.siteInfo.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -50,7 +50,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.rum.siteInfos.update('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.rum.siteInfo.update('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', auto_install: true, host: 'example.com', @@ -60,7 +60,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('list: only required params', async () => { - const responsePromise = cloudflare.rum.siteInfos.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = cloudflare.rum.siteInfo.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -72,7 +72,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('list: required and optional params', async () => { - const response = await cloudflare.rum.siteInfos.list({ + const response = await cloudflare.rum.siteInfo.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', order_by: 'host', page: 1, @@ -82,7 +82,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.rum.siteInfos.delete('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.rum.siteInfo.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -96,14 +96,14 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('delete: required and optional params', async () => { - const response = await cloudflare.rum.siteInfos.delete('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.rum.siteInfo.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.rum.siteInfos.get('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = cloudflare.rum.siteInfo.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -117,7 +117,7 @@ describe('resource siteInfos', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.rum.siteInfos.get('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await cloudflare.rum.siteInfo.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/stream/clips.test.ts b/tests/api-resources/stream/clip.test.ts similarity index 90% rename from tests/api-resources/stream/clips.test.ts rename to tests/api-resources/stream/clip.test.ts index cd3926fc18..3a114a6845 100644 --- a/tests/api-resources/stream/clips.test.ts +++ b/tests/api-resources/stream/clip.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource clips', () => { +describe('resource clip', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.stream.clips.create({ + const responsePromise = cloudflare.stream.clip.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', clippedFromVideoUID: '023e105f4ecef8ad9ca31a8372d0c353', endTimeSeconds: 0, @@ -29,7 +29,7 @@ describe('resource clips', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.stream.clips.create({ + const response = await cloudflare.stream.clip.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', clippedFromVideoUID: '023e105f4ecef8ad9ca31a8372d0c353', endTimeSeconds: 0, diff --git a/tests/api-resources/stream/copies.test.ts b/tests/api-resources/stream/copy.test.ts similarity index 91% rename from tests/api-resources/stream/copies.test.ts rename to tests/api-resources/stream/copy.test.ts index 3fe56316d2..dd886b8351 100644 --- a/tests/api-resources/stream/copies.test.ts +++ b/tests/api-resources/stream/copy.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource copies', () => { +describe('resource copy', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.stream.copies.create({ + const responsePromise = cloudflare.stream.copy.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', url: 'https://example.com/myvideo.mp4', }); @@ -27,7 +27,7 @@ describe('resource copies', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.stream.copies.create({ + const response = await cloudflare.stream.copy.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', url: 'https://example.com/myvideo.mp4', allowedOrigins: ['example.com'], diff --git a/tests/api-resources/stream/direct-uploads.test.ts b/tests/api-resources/stream/direct-upload.test.ts similarity index 89% rename from tests/api-resources/stream/direct-uploads.test.ts rename to tests/api-resources/stream/direct-upload.test.ts index 6345fe4c06..365f245766 100644 --- a/tests/api-resources/stream/direct-uploads.test.ts +++ b/tests/api-resources/stream/direct-upload.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource directUploads', () => { +describe('resource directUpload', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.stream.directUploads.create({ + const responsePromise = cloudflare.stream.directUpload.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', maxDurationSeconds: 1, }); @@ -27,7 +27,7 @@ describe('resource directUploads', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.stream.directUploads.create({ + const response = await cloudflare.stream.directUpload.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', maxDurationSeconds: 1, allowedOrigins: ['example.com'], diff --git a/tests/api-resources/stream/embeds.test.ts b/tests/api-resources/stream/embed.test.ts similarity index 85% rename from tests/api-resources/stream/embeds.test.ts rename to tests/api-resources/stream/embed.test.ts index e15d5ae8d6..48c0ab264b 100644 --- a/tests/api-resources/stream/embeds.test.ts +++ b/tests/api-resources/stream/embed.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource embeds', () => { +describe('resource embed', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.stream.embeds.get('ea95132c15732412d22c1476fa83f27a', { + const responsePromise = cloudflare.stream.embed.get('ea95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,7 +26,7 @@ describe('resource embeds', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.stream.embeds.get('ea95132c15732412d22c1476fa83f27a', { + const response = await cloudflare.stream.embed.get('ea95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); diff --git a/tests/api-resources/stream/tokens.test.ts b/tests/api-resources/stream/token.test.ts similarity index 95% rename from tests/api-resources/stream/tokens.test.ts rename to tests/api-resources/stream/token.test.ts index 240ba14ef7..ce4bc2100d 100644 --- a/tests/api-resources/stream/tokens.test.ts +++ b/tests/api-resources/stream/token.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource tokens', () => { +describe('resource token', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.stream.tokens.create('ea95132c15732412d22c1476fa83f27a', { + const responsePromise = cloudflare.stream.token.create('ea95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -26,7 +26,7 @@ describe('resource tokens', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.stream.tokens.create('ea95132c15732412d22c1476fa83f27a', { + const response = await cloudflare.stream.token.create('ea95132c15732412d22c1476fa83f27a', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', id: 'ab0d4ef71g4425f8dcba9041231813000', accessRules: [ diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.test.ts similarity index 93% rename from tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.test.ts rename to tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.test.ts index 1dec3d99e9..2440d7aef2 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/bindings.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource bindings', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.bindings.get( + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.bindings.get( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -28,7 +28,7 @@ describe('resource bindings', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.bindings.get( + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.bindings.get( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts similarity index 92% rename from tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.test.ts rename to tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts index c8afecaaaf..b226624bab 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/scripts.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource scripts', () => { +describe('resource content', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.update( + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.update( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -28,7 +28,7 @@ describe('resource scripts', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.update( + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.update( 'my-dispatch-namespace', 'this-is_my_script-01', { @@ -47,7 +47,7 @@ describe('resource scripts', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.get( + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.get( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts similarity index 96% rename from tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.test.ts rename to tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts index 4ede075f25..02f81d26a6 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content/settings.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts @@ -12,7 +12,7 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('edit: only required params', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.settings.edit( + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.edit( 'my-dispatch-namespace', 'this-is_my_script-01', { @@ -42,7 +42,7 @@ describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('edit: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.settings.edit( + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.edit( 'my-dispatch-namespace', 'this-is_my_script-01', { @@ -98,7 +98,7 @@ describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.settings.get( + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.get( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -114,7 +114,7 @@ describe('resource settings', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.settings.get( + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.get( 'my-dispatch-namespace', 'this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, diff --git a/tests/api-resources/zero-trust/devices/revokes.test.ts b/tests/api-resources/zero-trust/devices/revoke.test.ts similarity index 89% rename from tests/api-resources/zero-trust/devices/revokes.test.ts rename to tests/api-resources/zero-trust/devices/revoke.test.ts index f142c04a00..8725a5bfda 100644 --- a/tests/api-resources/zero-trust/devices/revokes.test.ts +++ b/tests/api-resources/zero-trust/devices/revoke.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource revokes', () => { +describe('resource revoke', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.zeroTrust.devices.revokes.create({ + const responsePromise = cloudflare.zeroTrust.devices.revoke.create({ account_id: '699d98642c564d2e855e9661899b7252', body: [ 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', @@ -31,7 +31,7 @@ describe('resource revokes', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.zeroTrust.devices.revokes.create({ + const response = await cloudflare.zeroTrust.devices.revoke.create({ account_id: '699d98642c564d2e855e9661899b7252', body: [ 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', diff --git a/tests/api-resources/zero-trust/devices/unrevokes.test.ts b/tests/api-resources/zero-trust/devices/unrevoke.test.ts similarity index 96% rename from tests/api-resources/zero-trust/devices/unrevokes.test.ts rename to tests/api-resources/zero-trust/devices/unrevoke.test.ts index 58cc8012f6..4be3149b18 100644 --- a/tests/api-resources/zero-trust/devices/unrevokes.test.ts +++ b/tests/api-resources/zero-trust/devices/unrevoke.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource unrevokes', () => { +describe('resource unrevoke', () => { // skipped: tests are disabled for the time being test.skip('create: only required params', async () => { - const responsePromise = cloudflare.zeroTrust.devices.unrevokes.create({ + const responsePromise = cloudflare.zeroTrust.devices.unrevoke.create({ account_id: '699d98642c564d2e855e9661899b7252', body: [ 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', @@ -31,7 +31,7 @@ describe('resource unrevokes', () => { // skipped: tests are disabled for the time being test.skip('create: required and optional params', async () => { - const response = await cloudflare.zeroTrust.devices.unrevokes.create({ + const response = await cloudflare.zeroTrust.devices.unrevoke.create({ account_id: '699d98642c564d2e855e9661899b7252', body: [ 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', diff --git a/tests/api-resources/zones/settings/webp.test.ts b/tests/api-resources/zones/settings/webp.test.ts index 06ff2fe591..762e5efa98 100644 --- a/tests/api-resources/zones/settings/webp.test.ts +++ b/tests/api-resources/zones/settings/webp.test.ts @@ -9,10 +9,10 @@ const cloudflare = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource webp', () => { +describe('resource WebP', () => { // skipped: tests are disabled for the time being test.skip('edit: only required params', async () => { - const responsePromise = cloudflare.zones.settings.webp.edit({ + const responsePromise = cloudflare.zones.settings.WebP.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', value: 'off', }); @@ -27,7 +27,7 @@ describe('resource webp', () => { // skipped: tests are disabled for the time being test.skip('edit: required and optional params', async () => { - const response = await cloudflare.zones.settings.webp.edit({ + const response = await cloudflare.zones.settings.WebP.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', value: 'off', }); @@ -35,7 +35,7 @@ describe('resource webp', () => { // skipped: tests are disabled for the time being test.skip('get: only required params', async () => { - const responsePromise = cloudflare.zones.settings.webp.get({ + const responsePromise = cloudflare.zones.settings.WebP.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -49,7 +49,7 @@ describe('resource webp', () => { // skipped: tests are disabled for the time being test.skip('get: required and optional params', async () => { - const response = await cloudflare.zones.settings.webp.get({ + const response = await cloudflare.zones.settings.WebP.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); });