diff --git a/api.md b/api.md index d4def719fe..d73188524b 100644 --- a/api.md +++ b/api.md @@ -2485,16 +2485,14 @@ Methods: Types: -- VersionListResponse -- VersionGetResponse +- VersionListResponse +- VersionGetResponse Methods: -- client.rulesets.versions.list(rulesetId, { ...params }) -> VersionListResponsesSinglePage -- client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void -- client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse - -### ByTag +- client.rulesets.versions.list(rulesetId, { ...params }) -> VersionListResponsesSinglePage +- client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void +- client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse # URLNormalization @@ -3311,59 +3309,46 @@ Methods: Types: -- ConfigCreateResponse -- ConfigUpdateResponse -- ConfigDeleteResponse -- ConfigEditResponse -- ConfigGetResponse +- Configuration Methods: -- client.magicNetworkMonitoring.configs.create({ ...params }) -> ConfigCreateResponse -- client.magicNetworkMonitoring.configs.update({ ...params }) -> ConfigUpdateResponse -- client.magicNetworkMonitoring.configs.delete({ ...params }) -> ConfigDeleteResponse -- client.magicNetworkMonitoring.configs.edit({ ...params }) -> ConfigEditResponse -- client.magicNetworkMonitoring.configs.get({ ...params }) -> ConfigGetResponse +- client.magicNetworkMonitoring.configs.create({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.update({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.delete({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.edit({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.get({ ...params }) -> Configuration ### Full -Types: - -- FullGetResponse - Methods: -- client.magicNetworkMonitoring.configs.full.get({ ...params }) -> FullGetResponse +- client.magicNetworkMonitoring.configs.full.get({ ...params }) -> Configuration ## Rules Types: -- RuleCreateResponse -- RuleUpdateResponse -- RuleListResponse -- RuleDeleteResponse -- RuleEditResponse -- RuleGetResponse +- MagicNetworkMonitoringRule Methods: -- client.magicNetworkMonitoring.rules.create({ ...params }) -> RuleCreateResponse | null -- client.magicNetworkMonitoring.rules.update({ ...params }) -> RuleUpdateResponse | null -- client.magicNetworkMonitoring.rules.list({ ...params }) -> RuleListResponsesSinglePage -- client.magicNetworkMonitoring.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse | null -- client.magicNetworkMonitoring.rules.edit(ruleId, { ...params }) -> RuleEditResponse | null -- client.magicNetworkMonitoring.rules.get(ruleId, { ...params }) -> RuleGetResponse | null +- client.magicNetworkMonitoring.rules.create({ ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.update({ ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.list({ ...params }) -> MagicNetworkMonitoringRulesSinglePage +- client.magicNetworkMonitoring.rules.delete(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.edit(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.get(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null ### Advertisements Types: -- AdvertisementEditResponse +- Advertisement Methods: -- client.magicNetworkMonitoring.rules.advertisements.edit(ruleId, { ...params }) -> AdvertisementEditResponse | null +- client.magicNetworkMonitoring.rules.advertisements.edit(ruleId, { ...params }) -> Advertisement | null # MTLSCertificates diff --git a/src/resources/magic-network-monitoring/configs/configs.ts b/src/resources/magic-network-monitoring/configs/configs.ts index eb865a28b8..6ca54734fd 100644 --- a/src/resources/magic-network-monitoring/configs/configs.ts +++ b/src/resources/magic-network-monitoring/configs/configs.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as FullAPI from './full'; -import { Full, FullGetParams, FullGetResponse } from './full'; +import { Full, FullGetParams } from './full'; export class Configs extends APIResource { full: FullAPI.Full = new FullAPI.Full(this._client); @@ -11,11 +11,11 @@ export class Configs extends APIResource { /** * Create a new network monitoring configuration. */ - create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{ - result: ConfigCreateResponse; + result: Configuration; }> )._thenUnwrap((obj) => obj.result); } @@ -24,11 +24,11 @@ export class Configs extends APIResource { * Update an existing network monitoring configuration, requires the entire * configuration to be updated at once. */ - update(params: ConfigUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + update(params: ConfigUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{ - result: ConfigUpdateResponse; + result: Configuration; }> )._thenUnwrap((obj) => obj.result); } @@ -36,11 +36,11 @@ export class Configs extends APIResource { /** * Delete an existing network monitoring configuration. */ - delete(params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + delete(params: ConfigDeleteParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( this._client.delete(`/accounts/${account_id}/mnm/config`, options) as Core.APIPromise<{ - result: ConfigDeleteResponse; + result: Configuration; }> )._thenUnwrap((obj) => obj.result); } @@ -48,11 +48,11 @@ export class Configs extends APIResource { /** * Update fields in an existing network monitoring configuration. */ - edit(params: ConfigEditParams, options?: Core.RequestOptions): Core.APIPromise { + edit(params: ConfigEditParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.patch(`/accounts/${account_id}/mnm/config`, { body, ...options }) as Core.APIPromise<{ - result: ConfigEditResponse; + result: Configuration; }> )._thenUnwrap((obj) => obj.result); } @@ -60,17 +60,17 @@ export class Configs extends APIResource { /** * Lists default sampling, router IPs and warp devices for account. */ - get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise { + get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/mnm/config`, options) as Core.APIPromise<{ - result: ConfigGetResponse; + result: Configuration; }> )._thenUnwrap((obj) => obj.result); } } -export interface ConfigCreateResponse { +export interface Configuration { /** * Fallback sampling rate of flow messages being sent in packets per second. This * should match the packet sampling rate configured on the router. @@ -84,170 +84,10 @@ export interface ConfigCreateResponse { router_ips: Array; - warp_devices: Array; + warp_devices: Array; } -export namespace ConfigCreateResponse { - /** - * Object representing a warp device with an ID and name. - */ - export interface WARPDevice { - /** - * Unique identifier for the warp device. - */ - id: string; - - /** - * Name of the warp device. - */ - name: string; - - /** - * IPv4 CIDR of the router sourcing flow data associated with this warp device. - * Only /32 addresses are currently supported. - */ - router_ip: string; - } -} - -export interface ConfigUpdateResponse { - /** - * Fallback sampling rate of flow messages being sent in packets per second. This - * should match the packet sampling rate configured on the router. - */ - default_sampling: number; - - /** - * The account name. - */ - name: string; - - router_ips: Array; - - warp_devices: Array; -} - -export namespace ConfigUpdateResponse { - /** - * Object representing a warp device with an ID and name. - */ - export interface WARPDevice { - /** - * Unique identifier for the warp device. - */ - id: string; - - /** - * Name of the warp device. - */ - name: string; - - /** - * IPv4 CIDR of the router sourcing flow data associated with this warp device. - * Only /32 addresses are currently supported. - */ - router_ip: string; - } -} - -export interface ConfigDeleteResponse { - /** - * Fallback sampling rate of flow messages being sent in packets per second. This - * should match the packet sampling rate configured on the router. - */ - default_sampling: number; - - /** - * The account name. - */ - name: string; - - router_ips: Array; - - warp_devices: Array; -} - -export namespace ConfigDeleteResponse { - /** - * Object representing a warp device with an ID and name. - */ - export interface WARPDevice { - /** - * Unique identifier for the warp device. - */ - id: string; - - /** - * Name of the warp device. - */ - name: string; - - /** - * IPv4 CIDR of the router sourcing flow data associated with this warp device. - * Only /32 addresses are currently supported. - */ - router_ip: string; - } -} - -export interface ConfigEditResponse { - /** - * Fallback sampling rate of flow messages being sent in packets per second. This - * should match the packet sampling rate configured on the router. - */ - default_sampling: number; - - /** - * The account name. - */ - name: string; - - router_ips: Array; - - warp_devices: Array; -} - -export namespace ConfigEditResponse { - /** - * Object representing a warp device with an ID and name. - */ - export interface WARPDevice { - /** - * Unique identifier for the warp device. - */ - id: string; - - /** - * Name of the warp device. - */ - name: string; - - /** - * IPv4 CIDR of the router sourcing flow data associated with this warp device. - * Only /32 addresses are currently supported. - */ - router_ip: string; - } -} - -export interface ConfigGetResponse { - /** - * Fallback sampling rate of flow messages being sent in packets per second. This - * should match the packet sampling rate configured on the router. - */ - default_sampling: number; - - /** - * The account name. - */ - name: string; - - router_ips: Array; - - warp_devices: Array; -} - -export namespace ConfigGetResponse { +export namespace Configuration { /** * Object representing a warp device with an ID and name. */ @@ -435,11 +275,7 @@ Configs.Full = Full; export declare namespace Configs { export { - type ConfigCreateResponse as ConfigCreateResponse, - type ConfigUpdateResponse as ConfigUpdateResponse, - type ConfigDeleteResponse as ConfigDeleteResponse, - type ConfigEditResponse as ConfigEditResponse, - type ConfigGetResponse as ConfigGetResponse, + type Configuration as Configuration, type ConfigCreateParams as ConfigCreateParams, type ConfigUpdateParams as ConfigUpdateParams, type ConfigDeleteParams as ConfigDeleteParams, @@ -447,5 +283,5 @@ export declare namespace Configs { type ConfigGetParams as ConfigGetParams, }; - export { Full as Full, type FullGetResponse as FullGetResponse, type FullGetParams as FullGetParams }; + export { Full as Full, type FullGetParams as FullGetParams }; } diff --git a/src/resources/magic-network-monitoring/configs/full.ts b/src/resources/magic-network-monitoring/configs/full.ts index 2cd8da65c6..be3abef480 100644 --- a/src/resources/magic-network-monitoring/configs/full.ts +++ b/src/resources/magic-network-monitoring/configs/full.ts @@ -2,65 +2,26 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as ConfigsAPI from './configs'; export class Full extends APIResource { /** * Lists default sampling, router IPs, warp devices, and rules for account. */ - get(params: FullGetParams, options?: Core.RequestOptions): Core.APIPromise { + get(params: FullGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/mnm/config/full`, options) as Core.APIPromise<{ - result: FullGetResponse; + result: ConfigsAPI.Configuration; }> )._thenUnwrap((obj) => obj.result); } } -export interface FullGetResponse { - /** - * Fallback sampling rate of flow messages being sent in packets per second. This - * should match the packet sampling rate configured on the router. - */ - default_sampling: number; - - /** - * The account name. - */ - name: string; - - router_ips: Array; - - warp_devices: Array; -} - -export namespace FullGetResponse { - /** - * Object representing a warp device with an ID and name. - */ - export interface WARPDevice { - /** - * Unique identifier for the warp device. - */ - id: string; - - /** - * Name of the warp device. - */ - name: string; - - /** - * IPv4 CIDR of the router sourcing flow data associated with this warp device. - * Only /32 addresses are currently supported. - */ - router_ip: string; - } -} - export interface FullGetParams { account_id: string; } export declare namespace Full { - export { type FullGetResponse as FullGetResponse, type FullGetParams as FullGetParams }; + export { type FullGetParams as FullGetParams }; } diff --git a/src/resources/magic-network-monitoring/configs/index.ts b/src/resources/magic-network-monitoring/configs/index.ts index 1662f29069..da6b24e588 100644 --- a/src/resources/magic-network-monitoring/configs/index.ts +++ b/src/resources/magic-network-monitoring/configs/index.ts @@ -2,15 +2,11 @@ export { Configs, - type ConfigCreateResponse, - type ConfigUpdateResponse, - type ConfigDeleteResponse, - type ConfigEditResponse, - type ConfigGetResponse, + type Configuration, type ConfigCreateParams, type ConfigUpdateParams, type ConfigDeleteParams, type ConfigEditParams, type ConfigGetParams, } from './configs'; -export { Full, type FullGetResponse, type FullGetParams } from './full'; +export { Full, type FullGetParams } from './full'; diff --git a/src/resources/magic-network-monitoring/index.ts b/src/resources/magic-network-monitoring/index.ts index d60ce5538f..3b7a83bab7 100644 --- a/src/resources/magic-network-monitoring/index.ts +++ b/src/resources/magic-network-monitoring/index.ts @@ -2,11 +2,7 @@ export { Configs, - type ConfigCreateResponse, - type ConfigUpdateResponse, - type ConfigDeleteResponse, - type ConfigEditResponse, - type ConfigGetResponse, + type Configuration, type ConfigCreateParams, type ConfigUpdateParams, type ConfigDeleteParams, @@ -15,14 +11,9 @@ export { } from './configs/index'; export { MagicNetworkMonitoring } from './magic-network-monitoring'; export { - RuleListResponsesSinglePage, + MagicNetworkMonitoringRulesSinglePage, Rules, - type RuleCreateResponse, - type RuleUpdateResponse, - type RuleListResponse, - type RuleDeleteResponse, - type RuleEditResponse, - type RuleGetResponse, + type MagicNetworkMonitoringRule, type RuleCreateParams, type RuleUpdateParams, type RuleListParams, diff --git a/src/resources/magic-network-monitoring/magic-network-monitoring.ts b/src/resources/magic-network-monitoring/magic-network-monitoring.ts index e8b453c5cc..4025a732d4 100644 --- a/src/resources/magic-network-monitoring/magic-network-monitoring.ts +++ b/src/resources/magic-network-monitoring/magic-network-monitoring.ts @@ -4,32 +4,23 @@ import { APIResource } from '../../resource'; import * as ConfigsAPI from './configs/configs'; import { ConfigCreateParams, - ConfigCreateResponse, ConfigDeleteParams, - ConfigDeleteResponse, ConfigEditParams, - ConfigEditResponse, ConfigGetParams, - ConfigGetResponse, ConfigUpdateParams, - ConfigUpdateResponse, Configs, + Configuration, } from './configs/configs'; import * as RulesAPI from './rules/rules'; import { + MagicNetworkMonitoringRule, + MagicNetworkMonitoringRulesSinglePage, RuleCreateParams, - RuleCreateResponse, RuleDeleteParams, - RuleDeleteResponse, RuleEditParams, - RuleEditResponse, RuleGetParams, - RuleGetResponse, RuleListParams, - RuleListResponse, - RuleListResponsesSinglePage, RuleUpdateParams, - RuleUpdateResponse, Rules, } from './rules/rules'; @@ -40,16 +31,12 @@ export class MagicNetworkMonitoring extends APIResource { MagicNetworkMonitoring.Configs = Configs; MagicNetworkMonitoring.Rules = Rules; -MagicNetworkMonitoring.RuleListResponsesSinglePage = RuleListResponsesSinglePage; +MagicNetworkMonitoring.MagicNetworkMonitoringRulesSinglePage = MagicNetworkMonitoringRulesSinglePage; export declare namespace MagicNetworkMonitoring { export { Configs as Configs, - type ConfigCreateResponse as ConfigCreateResponse, - type ConfigUpdateResponse as ConfigUpdateResponse, - type ConfigDeleteResponse as ConfigDeleteResponse, - type ConfigEditResponse as ConfigEditResponse, - type ConfigGetResponse as ConfigGetResponse, + type Configuration as Configuration, type ConfigCreateParams as ConfigCreateParams, type ConfigUpdateParams as ConfigUpdateParams, type ConfigDeleteParams as ConfigDeleteParams, @@ -59,13 +46,8 @@ export declare namespace MagicNetworkMonitoring { export { Rules as Rules, - type RuleCreateResponse as RuleCreateResponse, - type RuleUpdateResponse as RuleUpdateResponse, - type RuleListResponse as RuleListResponse, - type RuleDeleteResponse as RuleDeleteResponse, - type RuleEditResponse as RuleEditResponse, - type RuleGetResponse as RuleGetResponse, - RuleListResponsesSinglePage as RuleListResponsesSinglePage, + type MagicNetworkMonitoringRule as MagicNetworkMonitoringRule, + MagicNetworkMonitoringRulesSinglePage as MagicNetworkMonitoringRulesSinglePage, type RuleCreateParams as RuleCreateParams, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, diff --git a/src/resources/magic-network-monitoring/rules/advertisements.ts b/src/resources/magic-network-monitoring/rules/advertisements.ts index 0c8ae2d474..d36e5b7a16 100644 --- a/src/resources/magic-network-monitoring/rules/advertisements.ts +++ b/src/resources/magic-network-monitoring/rules/advertisements.ts @@ -11,18 +11,18 @@ export class Advertisements extends APIResource { ruleId: string, params: AdvertisementEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, body } = params; return ( this._client.patch(`/accounts/${account_id}/mnm/rules/${ruleId}/advertisement`, { body: body, ...options, - }) as Core.APIPromise<{ result: AdvertisementEditResponse | null }> + }) as Core.APIPromise<{ result: Advertisement | null }> )._thenUnwrap((obj) => obj.result); } } -export interface AdvertisementEditResponse { +export interface Advertisement { /** * Toggle on if you would like Cloudflare to automatically advertise the IP * Prefixes within the rule via Magic Transit when the rule is triggered. Only @@ -44,8 +44,5 @@ export interface AdvertisementEditParams { } export declare namespace Advertisements { - export { - type AdvertisementEditResponse as AdvertisementEditResponse, - type AdvertisementEditParams as AdvertisementEditParams, - }; + export { type Advertisement as Advertisement, type AdvertisementEditParams as AdvertisementEditParams }; } diff --git a/src/resources/magic-network-monitoring/rules/index.ts b/src/resources/magic-network-monitoring/rules/index.ts index 0d26184be7..a2f52aaa4b 100644 --- a/src/resources/magic-network-monitoring/rules/index.ts +++ b/src/resources/magic-network-monitoring/rules/index.ts @@ -1,19 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { Advertisements, type Advertisement, type AdvertisementEditParams } from './advertisements'; export { - Advertisements, - type AdvertisementEditResponse, - type AdvertisementEditParams, -} from './advertisements'; -export { - RuleListResponsesSinglePage, + MagicNetworkMonitoringRulesSinglePage, Rules, - type RuleCreateResponse, - type RuleUpdateResponse, - type RuleListResponse, - type RuleDeleteResponse, - type RuleEditResponse, - type RuleGetResponse, + type MagicNetworkMonitoringRule, type RuleCreateParams, type RuleUpdateParams, type RuleListParams, diff --git a/src/resources/magic-network-monitoring/rules/rules.ts b/src/resources/magic-network-monitoring/rules/rules.ts index 27b565e78a..247d5279fd 100644 --- a/src/resources/magic-network-monitoring/rules/rules.ts +++ b/src/resources/magic-network-monitoring/rules/rules.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as AdvertisementsAPI from './advertisements'; -import { AdvertisementEditParams, AdvertisementEditResponse, Advertisements } from './advertisements'; +import { Advertisement, AdvertisementEditParams, Advertisements } from './advertisements'; import { SinglePage } from '../../../pagination'; export class Rules extends APIResource { @@ -16,11 +16,11 @@ export class Rules extends APIResource { create( params: RuleCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/mnm/rules`, { body, ...options }) as Core.APIPromise<{ - result: RuleCreateResponse | null; + result: MagicNetworkMonitoringRule | null; }> )._thenUnwrap((obj) => obj.result); } @@ -31,11 +31,11 @@ export class Rules extends APIResource { update( params: RuleUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/mnm/rules`, { body, ...options }) as Core.APIPromise<{ - result: RuleUpdateResponse | null; + result: MagicNetworkMonitoringRule | null; }> )._thenUnwrap((obj) => obj.result); } @@ -46,9 +46,13 @@ export class Rules extends APIResource { list( params: RuleListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/mnm/rules`, RuleListResponsesSinglePage, options); + return this._client.getAPIList( + `/accounts/${account_id}/mnm/rules`, + MagicNetworkMonitoringRulesSinglePage, + options, + ); } /** @@ -58,11 +62,11 @@ export class Rules extends APIResource { ruleId: string, params: RuleDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.delete(`/accounts/${account_id}/mnm/rules/${ruleId}`, options) as Core.APIPromise<{ - result: RuleDeleteResponse | null; + result: MagicNetworkMonitoringRule | null; }> )._thenUnwrap((obj) => obj.result); } @@ -74,13 +78,13 @@ export class Rules extends APIResource { ruleId: string, params: RuleEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.patch(`/accounts/${account_id}/mnm/rules/${ruleId}`, { body, ...options, - }) as Core.APIPromise<{ result: RuleEditResponse | null }> + }) as Core.APIPromise<{ result: MagicNetworkMonitoringRule | null }> )._thenUnwrap((obj) => obj.result); } @@ -91,239 +95,19 @@ export class Rules extends APIResource { ruleId: string, params: RuleGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/mnm/rules/${ruleId}`, options) as Core.APIPromise<{ - result: RuleGetResponse | null; + result: MagicNetworkMonitoringRule | null; }> )._thenUnwrap((obj) => obj.result); } } -export class RuleListResponsesSinglePage extends SinglePage {} +export class MagicNetworkMonitoringRulesSinglePage extends SinglePage {} -export interface RuleCreateResponse { - /** - * Toggle on if you would like Cloudflare to automatically advertise the IP - * Prefixes within the rule via Magic Transit when the rule is triggered. Only - * available for users of Magic Transit. - */ - automatic_advertisement: boolean | null; - - /** - * The amount of time that the rule threshold must be exceeded to send an alert - * notification. The final value must be equivalent to one of the following 8 - * values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - * AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - * least one unit must be provided. - */ - duration: string; - - /** - * The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, - * underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in - * the rule name. Max 256 characters. - */ - name: string; - - prefixes: Array; - - /** - * The id of the rule. Must be unique. - */ - id?: string; - - /** - * The number of bits per second for the rule. When this value is exceeded for the - * set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - bandwidth_threshold?: number; - - /** - * The number of packets per second for the rule. When this value is exceeded for - * the set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - packet_threshold?: number; -} - -export interface RuleUpdateResponse { - /** - * Toggle on if you would like Cloudflare to automatically advertise the IP - * Prefixes within the rule via Magic Transit when the rule is triggered. Only - * available for users of Magic Transit. - */ - automatic_advertisement: boolean | null; - - /** - * The amount of time that the rule threshold must be exceeded to send an alert - * notification. The final value must be equivalent to one of the following 8 - * values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - * AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - * least one unit must be provided. - */ - duration: string; - - /** - * The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, - * underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in - * the rule name. Max 256 characters. - */ - name: string; - - prefixes: Array; - - /** - * The id of the rule. Must be unique. - */ - id?: string; - - /** - * The number of bits per second for the rule. When this value is exceeded for the - * set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - bandwidth_threshold?: number; - - /** - * The number of packets per second for the rule. When this value is exceeded for - * the set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - packet_threshold?: number; -} - -export interface RuleListResponse { - /** - * Toggle on if you would like Cloudflare to automatically advertise the IP - * Prefixes within the rule via Magic Transit when the rule is triggered. Only - * available for users of Magic Transit. - */ - automatic_advertisement: boolean | null; - - /** - * The amount of time that the rule threshold must be exceeded to send an alert - * notification. The final value must be equivalent to one of the following 8 - * values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - * AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - * least one unit must be provided. - */ - duration: string; - - /** - * The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, - * underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in - * the rule name. Max 256 characters. - */ - name: string; - - prefixes: Array; - - /** - * The id of the rule. Must be unique. - */ - id?: string; - - /** - * The number of bits per second for the rule. When this value is exceeded for the - * set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - bandwidth_threshold?: number; - - /** - * The number of packets per second for the rule. When this value is exceeded for - * the set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - packet_threshold?: number; -} - -export interface RuleDeleteResponse { - /** - * Toggle on if you would like Cloudflare to automatically advertise the IP - * Prefixes within the rule via Magic Transit when the rule is triggered. Only - * available for users of Magic Transit. - */ - automatic_advertisement: boolean | null; - - /** - * The amount of time that the rule threshold must be exceeded to send an alert - * notification. The final value must be equivalent to one of the following 8 - * values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - * AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - * least one unit must be provided. - */ - duration: string; - - /** - * The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, - * underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in - * the rule name. Max 256 characters. - */ - name: string; - - prefixes: Array; - - /** - * The id of the rule. Must be unique. - */ - id?: string; - - /** - * The number of bits per second for the rule. When this value is exceeded for the - * set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - bandwidth_threshold?: number; - - /** - * The number of packets per second for the rule. When this value is exceeded for - * the set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - packet_threshold?: number; -} - -export interface RuleEditResponse { - /** - * Toggle on if you would like Cloudflare to automatically advertise the IP - * Prefixes within the rule via Magic Transit when the rule is triggered. Only - * available for users of Magic Transit. - */ - automatic_advertisement: boolean | null; - - /** - * The amount of time that the rule threshold must be exceeded to send an alert - * notification. The final value must be equivalent to one of the following 8 - * values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - * AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - * least one unit must be provided. - */ - duration: string; - - /** - * The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, - * underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in - * the rule name. Max 256 characters. - */ - name: string; - - prefixes: Array; - - /** - * The id of the rule. Must be unique. - */ - id?: string; - - /** - * The number of bits per second for the rule. When this value is exceeded for the - * set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - bandwidth_threshold?: number; - - /** - * The number of packets per second for the rule. When this value is exceeded for - * the set duration, an alert notification is sent. Minimum of 1 and no maximum. - */ - packet_threshold?: number; -} - -export interface RuleGetResponse { +export interface MagicNetworkMonitoringRule { /** * Toggle on if you would like Cloudflare to automatically advertise the IP * Prefixes within the rule via Magic Transit when the rule is triggered. Only @@ -531,18 +315,13 @@ export interface RuleGetParams { account_id: string; } -Rules.RuleListResponsesSinglePage = RuleListResponsesSinglePage; +Rules.MagicNetworkMonitoringRulesSinglePage = MagicNetworkMonitoringRulesSinglePage; Rules.Advertisements = Advertisements; export declare namespace Rules { export { - type RuleCreateResponse as RuleCreateResponse, - type RuleUpdateResponse as RuleUpdateResponse, - type RuleListResponse as RuleListResponse, - type RuleDeleteResponse as RuleDeleteResponse, - type RuleEditResponse as RuleEditResponse, - type RuleGetResponse as RuleGetResponse, - RuleListResponsesSinglePage as RuleListResponsesSinglePage, + type MagicNetworkMonitoringRule as MagicNetworkMonitoringRule, + MagicNetworkMonitoringRulesSinglePage as MagicNetworkMonitoringRulesSinglePage, type RuleCreateParams as RuleCreateParams, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, @@ -553,7 +332,7 @@ export declare namespace Rules { export { Advertisements as Advertisements, - type AdvertisementEditResponse as AdvertisementEditResponse, + type Advertisement as Advertisement, type AdvertisementEditParams as AdvertisementEditParams, }; } diff --git a/src/resources/rulesets/index.ts b/src/resources/rulesets/index.ts index b284adc86d..f36949cca7 100644 --- a/src/resources/rulesets/index.ts +++ b/src/resources/rulesets/index.ts @@ -44,4 +44,4 @@ export { type VersionListParams, type VersionDeleteParams, type VersionGetParams, -} from './versions/index'; +} from './versions'; diff --git a/src/resources/rulesets/rulesets.ts b/src/resources/rulesets/rulesets.ts index 5e27422172..1fc3e63047 100644 --- a/src/resources/rulesets/rulesets.ts +++ b/src/resources/rulesets/rulesets.ts @@ -33,15 +33,7 @@ import { SetConfigRule, SkipRule, } from './rules'; -import * as PhasesAPI from './phases/phases'; -import { - PhaseGetParams, - PhaseGetResponse, - PhaseUpdateParams, - PhaseUpdateResponse, - Phases, -} from './phases/phases'; -import * as VersionsAPI from './versions/versions'; +import * as VersionsAPI from './versions'; import { VersionDeleteParams, VersionGetParams, @@ -50,7 +42,15 @@ import { VersionListResponse, VersionListResponsesSinglePage, Versions, -} from './versions/versions'; +} from './versions'; +import * as PhasesAPI from './phases/phases'; +import { + PhaseGetParams, + PhaseGetResponse, + PhaseUpdateParams, + PhaseUpdateResponse, + Phases, +} from './phases/phases'; import { SinglePage } from '../../pagination'; export class Rulesets extends APIResource { diff --git a/src/resources/rulesets/versions/versions.ts b/src/resources/rulesets/versions.ts similarity index 96% rename from src/resources/rulesets/versions/versions.ts rename to src/resources/rulesets/versions.ts index 7fe97a0e21..0f2bd438ff 100644 --- a/src/resources/rulesets/versions/versions.ts +++ b/src/resources/rulesets/versions.ts @@ -1,18 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import { CloudflareError } from '../../../error'; -import * as RulesAPI from '../rules'; -import * as RulesetsAPI from '../rulesets'; -import * as ByTagAPI from './by-tag'; -import { ByTag } from './by-tag'; -import { SinglePage } from '../../../pagination'; +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; +import { CloudflareError } from '../../error'; +import * as RulesAPI from './rules'; +import * as RulesetsAPI from './rulesets'; +import { SinglePage } from '../../pagination'; export class Versions extends APIResource { - byTag: ByTagAPI.ByTag = new ByTagAPI.ByTag(this._client); - /** * Fetches the versions of an account or zone ruleset. */ @@ -563,7 +559,6 @@ export interface VersionGetParams { } Versions.VersionListResponsesSinglePage = VersionListResponsesSinglePage; -Versions.ByTag = ByTag; export declare namespace Versions { export { @@ -574,6 +569,4 @@ export declare namespace Versions { type VersionDeleteParams as VersionDeleteParams, type VersionGetParams as VersionGetParams, }; - - export { ByTag as ByTag }; } diff --git a/src/resources/rulesets/versions/by-tag.ts b/src/resources/rulesets/versions/by-tag.ts deleted file mode 100644 index 2ad17b77a0..0000000000 --- a/src/resources/rulesets/versions/by-tag.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; - -export class ByTag extends APIResource {} diff --git a/src/resources/rulesets/versions/index.ts b/src/resources/rulesets/versions/index.ts deleted file mode 100644 index fcf576e0aa..0000000000 --- a/src/resources/rulesets/versions/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { ByTag } from './by-tag'; -export { - VersionListResponsesSinglePage, - Versions, - type VersionListResponse, - type VersionGetResponse, - type VersionListParams, - type VersionDeleteParams, - type VersionGetParams, -} from './versions'; diff --git a/tests/api-resources/rulesets/versions/versions.test.ts b/tests/api-resources/rulesets/versions.test.ts similarity index 100% rename from tests/api-resources/rulesets/versions/versions.test.ts rename to tests/api-resources/rulesets/versions.test.ts