// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { automaticAdvertisement: "automatic_advertisement", bandwidthThreshold: "bandwidth_threshold", defaultSampling: "default_sampling", packetThreshold: "packet_threshold", prefixMatch: "prefix_match", routerIp: "router_ip", routerIps: "router_ips", warpDevices: "warp_devices", zscoreSensitivity: "zscore_sensitivity", zscoreTarget: "zscore_target", }; export class DuplicateMnmRuleName extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "DuplicateMnmRuleName", { code: S.Number, message: S.String, }, ), [{ code: 1008, message: { includes: "rule name must be unique" } }], ) {} export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class InvalidMnmConfig extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidMnmConfig", { code: S.Number, message: S.String, }), [{ code: 1003 }], ) {} export class MnmConfigAlreadyExists extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "MnmConfigAlreadyExists", { code: S.Number, message: S.String, }, ), [{ code: 1005, message: { includes: "already exists" } }], ) {} export class MnmConfigMissing extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MnmConfigMissing", { code: S.Number, message: S.String, }), [ { code: 1008, message: { includes: "without initial account configuration" }, }, ], ) {} export class MnmConfigNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MnmConfigNotFound", { code: S.Number, message: S.String, }), [{ code: 1004, message: { includes: "not found" } }], ) {} export class MnmRuleNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("MnmRuleNotFound", { code: S.Number, message: S.String, }), [{ code: 1009 }], ) {} export type ConfigsCreateRequestRouterIpsList = Array; export const ConfigsCreateRequestRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ConfigsCreateRequestWarpDevicesItem { /** 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. */ routerIp: string; } export const ConfigsCreateRequestWarpDevicesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, routerIp: S.String.pipe(T.Body("router_ip")), }), ).annotate({ identifier: "ConfigsCreateRequestWarpDevicesItem", }) as any as S.Schema; export type ConfigsCreateRequestWarpDevicesList = Array; export const ConfigsCreateRequestWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; export interface CreateConfigRequest { accountId: string; /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps?: ConfigsCreateRequestRouterIpsList; warpDevices?: ConfigsCreateRequestWarpDevicesList; } export const CreateConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: S.optional( ConfigsCreateRequestRouterIpsList.pipe(T.Body("router_ips")), ), warpDevices: S.optional( ConfigsCreateRequestWarpDevicesList.pipe(T.Body("warp_devices")), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/mnm/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateConfigRequest", }) as any as S.Schema; export type ConfigsCreateResponseRouterIpsList = Array; export const ConfigsCreateResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsCreateResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsCreateResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsCreateResponseWarpDevicesList = Array; export const ConfigsCreateResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateConfigResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsCreateResponseRouterIpsList; warpDevices: ConfigsCreateResponseWarpDevicesList; } export const CreateConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsCreateResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsCreateResponseWarpDevicesList.pipe( T.Body("warp_devices"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateConfigResponse", }) as any as S.Schema; export type RulesCreateRequestPrefixesList = Array; export const RulesCreateRequestPrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesCreateRequestType = "threshold" | "zscore" | "advanced_ddos"; export const RulesCreateRequestType = /*@__PURE__*/ S.String; export type RulesCreateRequestDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesCreateRequestDuration = /*@__PURE__*/ S.String; export type RulesCreateRequestPrefixMatch = "exact" | "subnet" | "supernet"; export const RulesCreateRequestPrefixMatch = /*@__PURE__*/ S.String; export type RulesCreateRequestZscoreSensitivity = "low" | "medium" | "high"; export const RulesCreateRequestZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesCreateRequestZscoreTarget = "bits" | "packets"; export const RulesCreateRequestZscoreTarget = /*@__PURE__*/ S.String; export interface CreateRuleRequest { accountId: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesCreateRequestPrefixesList; /** MNM rule type. */ type: RulesCreateRequestType | (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. */ bandwidthThreshold?: number; /** 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"]. */ duration?: RulesCreateRequestDuration | (string & {}); /** 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. */ packetThreshold?: number; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesCreateRequestPrefixMatch | (string & {}); /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesCreateRequestZscoreSensitivity | (string & {}); /** Target of the zscore rule analysis. */ zscoreTarget?: RulesCreateRequestZscoreTarget | (string & {}); } export const CreateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesCreateRequestPrefixesList, type: RulesCreateRequestType, bandwidthThreshold: S.optional( S.Number.pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(RulesCreateRequestDuration), packetThreshold: S.optional(S.Number.pipe(T.Body("packet_threshold"))), prefixMatch: S.optional( RulesCreateRequestPrefixMatch.pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( RulesCreateRequestZscoreSensitivity.pipe(T.Body("zscore_sensitivity")), ), zscoreTarget: S.optional( RulesCreateRequestZscoreTarget.pipe(T.Body("zscore_target")), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/mnm/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleRequest", }) as any as S.Schema; export type RulesCreateResponsePrefixesList = Array; export const RulesCreateResponsePrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesCreateResponseType = "threshold" | "zscore" | "advanced_ddos"; export const RulesCreateResponseType = /*@__PURE__*/ S.String; export type RulesCreateResponseDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesCreateResponseDuration = /*@__PURE__*/ S.String; export type RulesCreateResponsePrefixMatch = "exact" | "subnet" | "supernet"; export const RulesCreateResponsePrefixMatch = /*@__PURE__*/ S.String; export type RulesCreateResponseZscoreSensitivity = "low" | "medium" | "high"; export const RulesCreateResponseZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesCreateResponseZscoreTarget = "bits" | "packets"; export const RulesCreateResponseZscoreTarget = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateRuleResponse { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesCreateResponsePrefixesList; /** MNM rule type. */ type: RulesCreateResponseType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesCreateResponseDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesCreateResponsePrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesCreateResponseZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesCreateResponseZscoreTarget | null; } export const CreateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesCreateResponsePrefixesList, type: RulesCreateResponseType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesCreateResponseDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesCreateResponsePrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesCreateResponseZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesCreateResponseZscoreTarget).pipe(T.Body("zscore_target")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleResponse", }) as any as S.Schema; export interface CreateVpcFlowTokenRequest { accountId: string; } export const CreateVpcFlowTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/mnm/vpc-flows/token", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateVpcFlowTokenRequest", }) as any as S.Schema; export type CreateVpcFlowTokenResponse = string; export const CreateVpcFlowTokenResponse = /*@__PURE__*/ S.suspend(() => S.String.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateVpcFlowTokenResponse", }) as any as S.Schema; export interface DeleteConfigRequest { accountId: string; } export const DeleteConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/mnm/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteConfigRequest", }) as any as S.Schema; export type ConfigsDeleteResponseRouterIpsList = Array; export const ConfigsDeleteResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsDeleteResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsDeleteResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsDeleteResponseWarpDevicesList = Array; export const ConfigsDeleteResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteConfigResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsDeleteResponseRouterIpsList; warpDevices: ConfigsDeleteResponseWarpDevicesList; } export const DeleteConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsDeleteResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsDeleteResponseWarpDevicesList.pipe( T.Body("warp_devices"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteConfigResponse", }) as any as S.Schema; export interface DeleteRuleRequest { accountId: string; /** The id of the rule. Must be unique. */ ruleId: string; } export const DeleteRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/mnm/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleRequest", }) as any as S.Schema; export type RulesDeleteResponsePrefixesList = Array; export const RulesDeleteResponsePrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesDeleteResponseType = "threshold" | "zscore" | "advanced_ddos"; export const RulesDeleteResponseType = /*@__PURE__*/ S.String; export type RulesDeleteResponseDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesDeleteResponseDuration = /*@__PURE__*/ S.String; export type RulesDeleteResponsePrefixMatch = "exact" | "subnet" | "supernet"; export const RulesDeleteResponsePrefixMatch = /*@__PURE__*/ S.String; export type RulesDeleteResponseZscoreSensitivity = "low" | "medium" | "high"; export const RulesDeleteResponseZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesDeleteResponseZscoreTarget = "bits" | "packets"; export const RulesDeleteResponseZscoreTarget = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteRuleResponse { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesDeleteResponsePrefixesList; /** MNM rule type. */ type: RulesDeleteResponseType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesDeleteResponseDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesDeleteResponsePrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesDeleteResponseZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesDeleteResponseZscoreTarget | null; } export const DeleteRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesDeleteResponsePrefixesList, type: RulesDeleteResponseType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesDeleteResponseDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesDeleteResponsePrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesDeleteResponseZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesDeleteResponseZscoreTarget).pipe(T.Body("zscore_target")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleResponse", }) as any as S.Schema; export interface GetConfigRequest { accountId: string; } export const GetConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/mnm/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConfigRequest", }) as any as S.Schema; export type ConfigsGetResponseRouterIpsList = Array; export const ConfigsGetResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsGetResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsGetResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsGetResponseWarpDevicesList = Array; export const ConfigsGetResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetConfigResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsGetResponseRouterIpsList; warpDevices: ConfigsGetResponseWarpDevicesList; } export const GetConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsGetResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsGetResponseWarpDevicesList.pipe(T.Body("warp_devices")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConfigResponse", }) as any as S.Schema; export interface GetConfigFullRequest { accountId: string; } export const GetConfigFullRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/mnm/config/full", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConfigFullRequest", }) as any as S.Schema; export type ConfigsFullGetResponseRouterIpsList = Array; export const ConfigsFullGetResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsFullGetResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsFullGetResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsFullGetResponseWarpDevicesList = Array; export const ConfigsFullGetResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetConfigFullResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsFullGetResponseRouterIpsList; warpDevices: ConfigsFullGetResponseWarpDevicesList; } export const GetConfigFullResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsFullGetResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsFullGetResponseWarpDevicesList.pipe( T.Body("warp_devices"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConfigFullResponse", }) as any as S.Schema; export interface GetRuleRequest { accountId: string; /** The id of the rule. Must be unique. */ ruleId: string; } export const GetRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/mnm/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleRequest" }) as any as S.Schema; export type RulesGetResponsePrefixesList = Array; export const RulesGetResponsePrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesGetResponseType = "threshold" | "zscore" | "advanced_ddos"; export const RulesGetResponseType = /*@__PURE__*/ S.String; export type RulesGetResponseDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesGetResponseDuration = /*@__PURE__*/ S.String; export type RulesGetResponsePrefixMatch = "exact" | "subnet" | "supernet"; export const RulesGetResponsePrefixMatch = /*@__PURE__*/ S.String; export type RulesGetResponseZscoreSensitivity = "low" | "medium" | "high"; export const RulesGetResponseZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesGetResponseZscoreTarget = "bits" | "packets"; export const RulesGetResponseZscoreTarget = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRuleResponse { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesGetResponsePrefixesList; /** MNM rule type. */ type: RulesGetResponseType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesGetResponseDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesGetResponsePrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesGetResponseZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesGetResponseZscoreTarget | null; } export const GetRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesGetResponsePrefixesList, type: RulesGetResponseType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesGetResponseDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesGetResponsePrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesGetResponseZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesGetResponseZscoreTarget).pipe(T.Body("zscore_target")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleResponse", }) as any as S.Schema; export interface ListRulesRequest { accountId: string; } export const ListRulesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/mnm/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesRequest", }) as any as S.Schema; export type RulesListResultItemPrefixesList = Array; export const RulesListResultItemPrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesListResultItemType = "threshold" | "zscore" | "advanced_ddos"; export const RulesListResultItemType = /*@__PURE__*/ S.String; export type RulesListResultItemDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesListResultItemDuration = /*@__PURE__*/ S.String; export type RulesListResultItemPrefixMatch = "exact" | "subnet" | "supernet"; export const RulesListResultItemPrefixMatch = /*@__PURE__*/ S.String; export type RulesListResultItemZscoreSensitivity = "low" | "medium" | "high"; export const RulesListResultItemZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesListResultItemZscoreTarget = "bits" | "packets"; export const RulesListResultItemZscoreTarget = /*@__PURE__*/ S.String; export interface RulesListResultItem { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesListResultItemPrefixesList; /** MNM rule type. */ type: RulesListResultItemType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesListResultItemDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesListResultItemPrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesListResultItemZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesListResultItemZscoreTarget | null; } export const RulesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesListResultItemPrefixesList, type: RulesListResultItemType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesListResultItemDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesListResultItemPrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesListResultItemZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesListResultItemZscoreTarget).pipe(T.Body("zscore_target")), ), }), ).annotate({ identifier: "RulesListResultItem", }) as any as S.Schema; export type RulesListResultList = Array; export const RulesListResultList = /*@__PURE__*/ S.Array( RulesListResultItem, ) as any as S.Schema; export interface ListRulesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListRulesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRulesResponse", }) as any as S.Schema; export type ConfigsEditRequestRouterIpsList = Array; export const ConfigsEditRequestRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsEditRequestWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsEditRequestWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsEditRequestWarpDevicesList = Array; export const ConfigsEditRequestWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; export interface PatchConfigRequest { accountId: string; /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling?: number; /** The account name. */ name?: string; routerIps?: ConfigsEditRequestRouterIpsList; warpDevices?: ConfigsEditRequestWarpDevicesList; } export const PatchConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), defaultSampling: S.optional(S.Number.pipe(T.Body("default_sampling"))), name: S.optional(S.String), routerIps: S.optional( ConfigsEditRequestRouterIpsList.pipe(T.Body("router_ips")), ), warpDevices: S.optional( ConfigsEditRequestWarpDevicesList.pipe(T.Body("warp_devices")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/mnm/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchConfigRequest", }) as any as S.Schema; export type ConfigsEditResponseRouterIpsList = Array; export const ConfigsEditResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsEditResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsEditResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsEditResponseWarpDevicesList = Array; export const ConfigsEditResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchConfigResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsEditResponseRouterIpsList; warpDevices: ConfigsEditResponseWarpDevicesList; } export const PatchConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsEditResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsEditResponseWarpDevicesList.pipe( T.Body("warp_devices"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchConfigResponse", }) as any as S.Schema; export type RulesEditRequestPrefixesList = Array; export const RulesEditRequestPrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesEditRequestType = "threshold" | "zscore" | "advanced_ddos"; export const RulesEditRequestType = /*@__PURE__*/ S.String; export type RulesEditRequestDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesEditRequestDuration = /*@__PURE__*/ S.String; export type RulesEditRequestPrefixMatch = "exact" | "subnet" | "supernet"; export const RulesEditRequestPrefixMatch = /*@__PURE__*/ S.String; export type RulesEditRequestZscoreSensitivity = "low" | "medium" | "high"; export const RulesEditRequestZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesEditRequestZscoreTarget = "bits" | "packets"; export const RulesEditRequestZscoreTarget = /*@__PURE__*/ S.String; export interface PatchRuleRequest { accountId: string; /** The id of the rule. Must be unique. */ ruleId: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesEditRequestPrefixesList; /** MNM rule type. */ type: RulesEditRequestType | (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. */ bandwidthThreshold?: number; /** 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"]. */ duration?: RulesEditRequestDuration | (string & {}); /** 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. */ packetThreshold?: number; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesEditRequestPrefixMatch | (string & {}); /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesEditRequestZscoreSensitivity | (string & {}); /** Target of the zscore rule analysis. */ zscoreTarget?: RulesEditRequestZscoreTarget | (string & {}); } export const PatchRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesEditRequestPrefixesList, type: RulesEditRequestType, bandwidthThreshold: S.optional( S.Number.pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(RulesEditRequestDuration), packetThreshold: S.optional(S.Number.pipe(T.Body("packet_threshold"))), prefixMatch: S.optional( RulesEditRequestPrefixMatch.pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( RulesEditRequestZscoreSensitivity.pipe(T.Body("zscore_sensitivity")), ), zscoreTarget: S.optional( RulesEditRequestZscoreTarget.pipe(T.Body("zscore_target")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/mnm/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleRequest", }) as any as S.Schema; export type RulesEditResponsePrefixesList = Array; export const RulesEditResponsePrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesEditResponseType = "threshold" | "zscore" | "advanced_ddos"; export const RulesEditResponseType = /*@__PURE__*/ S.String; export type RulesEditResponseDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesEditResponseDuration = /*@__PURE__*/ S.String; export type RulesEditResponsePrefixMatch = "exact" | "subnet" | "supernet"; export const RulesEditResponsePrefixMatch = /*@__PURE__*/ S.String; export type RulesEditResponseZscoreSensitivity = "low" | "medium" | "high"; export const RulesEditResponseZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesEditResponseZscoreTarget = "bits" | "packets"; export const RulesEditResponseZscoreTarget = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchRuleResponse { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesEditResponsePrefixesList; /** MNM rule type. */ type: RulesEditResponseType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesEditResponseDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesEditResponsePrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesEditResponseZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesEditResponseZscoreTarget | null; } export const PatchRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesEditResponsePrefixesList, type: RulesEditResponseType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesEditResponseDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesEditResponsePrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesEditResponseZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesEditResponseZscoreTarget).pipe(T.Body("zscore_target")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleResponse", }) as any as S.Schema; export interface PatchRuleAdvertisementRequest { accountId: string; /** The id of the rule. Must be unique. */ ruleId: string; } export const PatchRuleAdvertisementRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/mnm/rules/{rule_id}/advertisement", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleAdvertisementRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchRuleAdvertisementResponse { /** 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. */ automaticAdvertisement: boolean; } export const PatchRuleAdvertisementResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleAdvertisementResponse", }) as any as S.Schema; export type ConfigsUpdateRequestRouterIpsList = Array; export const ConfigsUpdateRequestRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsUpdateRequestWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsUpdateRequestWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsUpdateRequestWarpDevicesList = Array; export const ConfigsUpdateRequestWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; export interface UpdateConfigRequest { accountId: string; /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps?: ConfigsUpdateRequestRouterIpsList; warpDevices?: ConfigsUpdateRequestWarpDevicesList; } export const UpdateConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: S.optional( ConfigsUpdateRequestRouterIpsList.pipe(T.Body("router_ips")), ), warpDevices: S.optional( ConfigsUpdateRequestWarpDevicesList.pipe(T.Body("warp_devices")), ), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/mnm/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateConfigRequest", }) as any as S.Schema; export type ConfigsUpdateResponseRouterIpsList = Array; export const ConfigsUpdateResponseRouterIpsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConfigsUpdateResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export const ConfigsUpdateResponseWarpDevicesItem = ConfigsCreateRequestWarpDevicesItem; export type ConfigsUpdateResponseWarpDevicesList = Array; export const ConfigsUpdateResponseWarpDevicesList = /*@__PURE__*/ S.Array( ConfigsCreateRequestWarpDevicesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateConfigResponse { /** Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. */ defaultSampling: number; /** The account name. */ name: string; routerIps: ConfigsUpdateResponseRouterIpsList; warpDevices: ConfigsUpdateResponseWarpDevicesList; } export const UpdateConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ defaultSampling: S.Number.pipe(T.Body("default_sampling")), name: S.String, routerIps: ConfigsUpdateResponseRouterIpsList.pipe(T.Body("router_ips")), warpDevices: ConfigsUpdateResponseWarpDevicesList.pipe( T.Body("warp_devices"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateConfigResponse", }) as any as S.Schema; export type RulesUpdateRequestPrefixesList = Array; export const RulesUpdateRequestPrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesUpdateRequestType = "threshold" | "zscore" | "advanced_ddos"; export const RulesUpdateRequestType = /*@__PURE__*/ S.String; export type RulesUpdateRequestDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesUpdateRequestDuration = /*@__PURE__*/ S.String; export type RulesUpdateRequestPrefixMatch = "exact" | "subnet" | "supernet"; export const RulesUpdateRequestPrefixMatch = /*@__PURE__*/ S.String; export type RulesUpdateRequestZscoreSensitivity = "low" | "medium" | "high"; export const RulesUpdateRequestZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesUpdateRequestZscoreTarget = "bits" | "packets"; export const RulesUpdateRequestZscoreTarget = /*@__PURE__*/ S.String; export interface UpdateRuleRequest { accountId: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesUpdateRequestPrefixesList; /** MNM rule type. */ type: RulesUpdateRequestType | (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. */ bandwidthThreshold?: number; /** 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"]. */ duration?: RulesUpdateRequestDuration | (string & {}); /** 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. */ packetThreshold?: number; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesUpdateRequestPrefixMatch | (string & {}); /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesUpdateRequestZscoreSensitivity | (string & {}); /** Target of the zscore rule analysis. */ zscoreTarget?: RulesUpdateRequestZscoreTarget | (string & {}); } export const UpdateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesUpdateRequestPrefixesList, type: RulesUpdateRequestType, bandwidthThreshold: S.optional( S.Number.pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(RulesUpdateRequestDuration), packetThreshold: S.optional(S.Number.pipe(T.Body("packet_threshold"))), prefixMatch: S.optional( RulesUpdateRequestPrefixMatch.pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( RulesUpdateRequestZscoreSensitivity.pipe(T.Body("zscore_sensitivity")), ), zscoreTarget: S.optional( RulesUpdateRequestZscoreTarget.pipe(T.Body("zscore_target")), ), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/mnm/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleRequest", }) as any as S.Schema; export type RulesUpdateResponsePrefixesList = Array; export const RulesUpdateResponsePrefixesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type RulesUpdateResponseType = "threshold" | "zscore" | "advanced_ddos"; export const RulesUpdateResponseType = /*@__PURE__*/ S.String; export type RulesUpdateResponseDuration = | "1m" | "5m" | "10m" | "15m" | "20m" | "30m" | "45m" | "60m"; export const RulesUpdateResponseDuration = /*@__PURE__*/ S.String; export type RulesUpdateResponsePrefixMatch = "exact" | "subnet" | "supernet"; export const RulesUpdateResponsePrefixMatch = /*@__PURE__*/ S.String; export type RulesUpdateResponseZscoreSensitivity = "low" | "medium" | "high"; export const RulesUpdateResponseZscoreSensitivity = /*@__PURE__*/ S.String; export type RulesUpdateResponseZscoreTarget = "bits" | "packets"; export const RulesUpdateResponseZscoreTarget = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateRuleResponse { /** The id of the rule. Must be unique. */ id: string; /** 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. */ automaticAdvertisement: boolean; /** 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: RulesUpdateResponsePrefixesList; /** MNM rule type. */ type: RulesUpdateResponseType; /** 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. */ bandwidthThreshold?: number | 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"]. */ duration?: RulesUpdateResponseDuration | null; /** 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. */ packetThreshold?: number | null; /** Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule. */ prefixMatch?: RulesUpdateResponsePrefixMatch | null; /** Level of sensitivity set for zscore rules. */ zscoreSensitivity?: RulesUpdateResponseZscoreSensitivity | null; /** Target of the zscore rule analysis. */ zscoreTarget?: RulesUpdateResponseZscoreTarget | null; } export const UpdateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, automaticAdvertisement: S.Boolean.pipe(T.Body("automatic_advertisement")), name: S.String, prefixes: RulesUpdateResponsePrefixesList, type: RulesUpdateResponseType, bandwidthThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("bandwidth_threshold")), ), duration: S.optional(S.NullOr(RulesUpdateResponseDuration)), packetThreshold: S.optional( S.NullOr(S.Number).pipe(T.Body("packet_threshold")), ), prefixMatch: S.optional( S.NullOr(RulesUpdateResponsePrefixMatch).pipe(T.Body("prefix_match")), ), zscoreSensitivity: S.optional( S.NullOr(RulesUpdateResponseZscoreSensitivity).pipe( T.Body("zscore_sensitivity"), ), ), zscoreTarget: S.optional( S.NullOr(RulesUpdateResponseZscoreTarget).pipe(T.Body("zscore_target")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleResponse", }) as any as S.Schema; export type CreateConfigError = | MnmConfigAlreadyExists | InvalidMnmConfig | Forbidden | CloudflareOpError; /** Create a new network monitoring configuration. */ export const createConfig: API.OperationMethod< CreateConfigRequest, CreateConfigResponse, CreateConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateConfigRequest, output: CreateConfigResponse, errors: [ MnmConfigAlreadyExists, InvalidMnmConfig, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateRuleError = | DuplicateMnmRuleName | MnmConfigMissing | Forbidden | CloudflareOpError; /** Create network monitoring rules for account. Currently only supports creating a single rule per API request. */ export const createRule: API.OperationMethod< CreateRuleRequest, CreateRuleResponse, CreateRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateRuleRequest, output: CreateRuleResponse, errors: [ DuplicateMnmRuleName, MnmConfigMissing, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateVpcFlowTokenError = CloudflareOpError; /** Generate authentication token for VPC flow logs export. */ export const createVpcFlowToken: API.OperationMethod< CreateVpcFlowTokenRequest, CreateVpcFlowTokenResponse, CreateVpcFlowTokenError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateVpcFlowTokenRequest, output: CreateVpcFlowTokenResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteConfigError = | MnmConfigNotFound | Forbidden | CloudflareOpError; /** Delete an existing network monitoring configuration. */ export const deleteConfig: API.OperationMethod< DeleteConfigRequest, DeleteConfigResponse, DeleteConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteConfigRequest, output: DeleteConfigResponse, errors: [ MnmConfigNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRuleError = MnmRuleNotFound | Forbidden | CloudflareOpError; /** Delete a network monitoring rule for account. */ export const deleteRule: API.OperationMethod< DeleteRuleRequest, DeleteRuleResponse, DeleteRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteRuleRequest, output: DeleteRuleResponse, errors: [MnmRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetConfigError = Forbidden | CloudflareOpError; /** Lists default sampling, router IPs and warp devices for account. */ export const getConfig: API.OperationMethod< GetConfigRequest, GetConfigResponse, GetConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetConfigRequest, output: GetConfigResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetConfigFullError = CloudflareOpError; /** Lists default sampling, router IPs, warp devices, and rules for account. */ export const getConfigFull: API.OperationMethod< GetConfigFullRequest, GetConfigFullResponse, GetConfigFullError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetConfigFullRequest, output: GetConfigFullResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRuleError = MnmRuleNotFound | Forbidden | CloudflareOpError; /** List a single network monitoring rule for account. */ export const getRule: API.OperationMethod< GetRuleRequest, GetRuleResponse, GetRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRuleRequest, output: GetRuleResponse, errors: [MnmRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListRulesError = Forbidden | CloudflareOpError; /** Lists network monitoring rules for account. */ export const listRules: API.PaginatedOperationMethod< ListRulesRequest, ListRulesResponse, ListRulesError, CloudflareOpContext, RulesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListRulesRequest, output: ListRulesResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type PatchConfigError = CloudflareOpError; /** Update fields in an existing network monitoring configuration. */ export const patchConfig: API.OperationMethod< PatchConfigRequest, PatchConfigResponse, PatchConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchConfigRequest, output: PatchConfigResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchRuleError = MnmRuleNotFound | Forbidden | CloudflareOpError; /** Update a network monitoring rule for account. */ export const patchRule: API.OperationMethod< PatchRuleRequest, PatchRuleResponse, PatchRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchRuleRequest, output: PatchRuleResponse, errors: [MnmRuleNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchRuleAdvertisementError = CloudflareOpError; /** Update advertisement for rule. */ export const patchRuleAdvertisement: API.OperationMethod< PatchRuleAdvertisementRequest, PatchRuleAdvertisementResponse, PatchRuleAdvertisementError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchRuleAdvertisementRequest, output: PatchRuleAdvertisementResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateConfigError = | Forbidden | InvalidMnmConfig | CloudflareOpError; /** Update an existing network monitoring configuration, requires the entire configuration to be updated at once. */ export const updateConfig: API.OperationMethod< UpdateConfigRequest, UpdateConfigResponse, UpdateConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateConfigRequest, output: UpdateConfigResponse, errors: [Forbidden, InvalidMnmConfig, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateRuleError = CloudflareOpError; /** Update network monitoring rules for account. */ export const updateRule: API.OperationMethod< UpdateRuleRequest, UpdateRuleResponse, UpdateRuleError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateRuleRequest, output: UpdateRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));