@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
3,109 lines • 93.9 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export type ManagedRules = {};
export const PutFirewallConfigAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigAction = ClosedEnum<
typeof PutFirewallConfigAction
>;
/**
* Scanner Detection - Detect and prevent reconnaissance activities from network scanning tools.
*/
export type Sd = {
active: boolean;
action: PutFirewallConfigAction;
};
export const PutFirewallConfigSecurityAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityAction = ClosedEnum<
typeof PutFirewallConfigSecurityAction
>;
/**
* Multipart Attack - Block attempts to bypass security controls using multipart/form-data encoding.
*/
export type Ma = {
active: boolean;
action: PutFirewallConfigSecurityAction;
};
export const PutFirewallConfigSecurityRequestAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestAction = ClosedEnum<
typeof PutFirewallConfigSecurityRequestAction
>;
/**
* Local File Inclusion Attack - Prevent unauthorized access to local files through web applications.
*/
export type Lfi = {
active: boolean;
action: PutFirewallConfigSecurityRequestAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyAction = ClosedEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyAction
>;
/**
* Remote File Inclusion Attack - Prohibit unauthorized upload or execution of remote files.
*/
export type Rfi = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsAction = ClosedEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsAction
>;
/**
* Remote Execution Attack - Prevent unauthorized execution of remote scripts or commands.
*/
export type Rce = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction =
ClosedEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction>;
/**
* PHP Attack - Safeguard against vulnerability exploits in PHP-based applications.
*/
export type Php = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsGenAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsGenAction =
ClosedEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsGenAction>;
/**
* Generic Attack - Provide broad protection from various undefined or novel attack vectors.
*/
export type Gen = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsGenAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsXssAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsXssAction =
ClosedEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsXssAction>;
/**
* XSS Attack - Prevent injection of malicious scripts into trusted webpages.
*/
export type Xss = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsXssAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction =
ClosedEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction>;
/**
* SQL Injection Attack - Prohibit unauthorized use of SQL commands to manipulate databases.
*/
export type Sqli = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsSfAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsSfAction = ClosedEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsSfAction
>;
/**
* Session Fixation Attack - Prevent unauthorized takeover of user sessions by enforcing unique session IDs.
*/
export type Sf = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsSfAction;
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction =
ClosedEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction>;
/**
* Java Attack - Mitigate risks of exploitation targeting Java-based applications or components.
*/
export type Java = {
active: boolean;
action: PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction;
};
/**
* Custom Ruleset
*/
export type Crs = {
/**
* Scanner Detection - Detect and prevent reconnaissance activities from network scanning tools.
*/
sd?: Sd | undefined;
/**
* Multipart Attack - Block attempts to bypass security controls using multipart/form-data encoding.
*/
ma?: Ma | undefined;
/**
* Local File Inclusion Attack - Prevent unauthorized access to local files through web applications.
*/
lfi?: Lfi | undefined;
/**
* Remote File Inclusion Attack - Prohibit unauthorized upload or execution of remote files.
*/
rfi?: Rfi | undefined;
/**
* Remote Execution Attack - Prevent unauthorized execution of remote scripts or commands.
*/
rce?: Rce | undefined;
/**
* PHP Attack - Safeguard against vulnerability exploits in PHP-based applications.
*/
php?: Php | undefined;
/**
* Generic Attack - Provide broad protection from various undefined or novel attack vectors.
*/
gen?: Gen | undefined;
/**
* XSS Attack - Prevent injection of malicious scripts into trusted webpages.
*/
xss?: Xss | undefined;
/**
* SQL Injection Attack - Prohibit unauthorized use of SQL commands to manipulate databases.
*/
sqli?: Sqli | undefined;
/**
* Session Fixation Attack - Prevent unauthorized takeover of user sessions by enforcing unique session IDs.
*/
sf?: Sf | undefined;
/**
* Java Attack - Mitigate risks of exploitation targeting Java-based applications or components.
*/
java?: Java | undefined;
};
/**
* [Parameter](https://vercel.com/docs/security/vercel-waf/rule-configuration#parameters) from the incoming traffic.
*/
export const PutFirewallConfigType = {
Host: "host",
Path: "path",
Method: "method",
Header: "header",
Query: "query",
Cookie: "cookie",
TargetPath: "target_path",
Route: "route",
RawPath: "raw_path",
IpAddress: "ip_address",
Region: "region",
Protocol: "protocol",
Scheme: "scheme",
Environment: "environment",
UserAgent: "user_agent",
GeoContinent: "geo_continent",
GeoCountry: "geo_country",
GeoCountryRegion: "geo_country_region",
GeoCity: "geo_city",
GeoAsNumber: "geo_as_number",
Ja4Digest: "ja4_digest",
Ja3Digest: "ja3_digest",
RateLimitApiId: "rate_limit_api_id",
ServerAction: "server_action",
BotName: "bot_name",
BotCategory: "bot_category",
BotStatus: "bot_status",
BotProtection: "bot_protection",
} as const;
/**
* [Parameter](https://vercel.com/docs/security/vercel-waf/rule-configuration#parameters) from the incoming traffic.
*/
export type PutFirewallConfigType = ClosedEnum<typeof PutFirewallConfigType>;
export const PutFirewallConfigOp = {
Re: "re",
Eq: "eq",
Neq: "neq",
Ex: "ex",
Nex: "nex",
Inc: "inc",
Ninc: "ninc",
Pre: "pre",
Suf: "suf",
Sub: "sub",
Gt: "gt",
Gte: "gte",
Lt: "lt",
Lte: "lte",
} as const;
export type PutFirewallConfigOp = ClosedEnum<typeof PutFirewallConfigOp>;
export type PutFirewallConfigValue = string | Array<string> | number;
export type PutFirewallConfigConditions = {
/**
* [Parameter](https://vercel.com/docs/security/vercel-waf/rule-configuration#parameters) from the incoming traffic.
*/
type: PutFirewallConfigType;
op: PutFirewallConfigOp;
neg?: boolean | undefined;
key?: string | undefined;
value?: string | Array<string> | number | undefined;
};
export type ConditionGroup = {
conditions: Array<PutFirewallConfigConditions>;
};
export const PutFirewallConfigSecurityRequestRequestBodyRulesActionAction = {
Log: "log",
Challenge: "challenge",
Deny: "deny",
Bypass: "bypass",
RateLimit: "rate_limit",
Redirect: "redirect",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyRulesActionAction =
ClosedEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyRulesActionAction
>;
export const Algo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
} as const;
export type Algo = ClosedEnum<typeof Algo>;
export const Action1 = {
Log: "log",
Challenge: "challenge",
Deny: "deny",
RateLimit: "rate_limit",
} as const;
export type Action1 = ClosedEnum<typeof Action1>;
export type RateLimitAction = Action1 | any;
export type RateLimit1 = {
algo: Algo;
window: number;
limit: number;
keys: Array<string>;
action?: Action1 | any | null | undefined;
};
export type RateLimit = RateLimit1 | any;
export type Redirect1 = {
location: string;
permanent: boolean;
};
export type PutFirewallConfigRedirect = Redirect1 | any;
export type LogHeaders = string | Array<string>;
export type Mitigate = {
action: PutFirewallConfigSecurityRequestRequestBodyRulesActionAction;
rateLimit?: RateLimit1 | any | null | undefined;
redirect?: Redirect1 | any | null | undefined;
actionDuration?: string | null | undefined;
bypassSystem?: boolean | null | undefined;
logHeaders?: string | Array<string> | undefined;
};
export type PutFirewallConfigSecurityRequestRequestBodyRulesAction = {
mitigate?: Mitigate | undefined;
};
export type ValidationErrors = Array<string> | string;
export type PutFirewallConfigRules = {
id?: string | undefined;
name: string;
description?: string | undefined;
active: boolean;
conditionGroup: Array<ConditionGroup>;
action: PutFirewallConfigSecurityRequestRequestBodyRulesAction;
valid?: boolean | undefined;
validationErrors?: Array<string> | string | undefined;
};
export const PutFirewallConfigSecurityRequestRequestBodyIpsAction = {
Deny: "deny",
Challenge: "challenge",
Log: "log",
Bypass: "bypass",
} as const;
export type PutFirewallConfigSecurityRequestRequestBodyIpsAction = ClosedEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyIpsAction
>;
export type Ips = {
id?: string | undefined;
hostname: string;
ip: string;
notes?: string | undefined;
action: PutFirewallConfigSecurityRequestRequestBodyIpsAction;
};
export type PutFirewallConfigLogHeaders = string | Array<string>;
export type PutFirewallConfigRequestBody = {
firewallEnabled: boolean;
managedRules?: ManagedRules | undefined;
/**
* Custom Ruleset
*/
crs?: Crs | undefined;
rules?: Array<PutFirewallConfigRules> | undefined;
ips?: Array<Ips> | undefined;
botIdEnabled?: boolean | undefined;
logHeaders?: string | Array<string> | undefined;
};
export type PutFirewallConfigRequest = {
projectId: string;
/**
* The Team identifier to perform the request on behalf of.
*/
teamId?: string | undefined;
/**
* The Team slug to perform the request on behalf of.
*/
slug?: string | undefined;
requestBody: PutFirewallConfigRequestBody;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction
>;
/**
* Scanner Detection - Detect and prevent reconnaissance activities from network scanning tools.
*/
export type PutFirewallConfigSd = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction;
};
export const PutFirewallConfigSecurityResponse200Action = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200Action = ClosedEnum<
typeof PutFirewallConfigSecurityResponse200Action
>;
/**
* Multipart Attack - Block attempts to bypass security controls using multipart/form-data encoding.
*/
export type PutFirewallConfigMa = {
active: boolean;
action: PutFirewallConfigSecurityResponse200Action;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONAction = {
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONAction =
ClosedEnum<typeof PutFirewallConfigSecurityResponse200ApplicationJSONAction>;
/**
* Local File Inclusion Attack - Prevent unauthorized access to local files through web applications.
*/
export type PutFirewallConfigLfi = {
active: boolean;
action: PutFirewallConfigSecurityResponse200ApplicationJSONAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction
>;
/**
* Remote File Inclusion Attack - Prohibit unauthorized upload or execution of remote files.
*/
export type PutFirewallConfigRfi = {
active: boolean;
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction
>;
/**
* Remote Execution Attack - Prevent unauthorized execution of remote scripts or commands.
*/
export type PutFirewallConfigRce = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction
>;
/**
* PHP Attack - Safeguard against vulnerability exploits in PHP-based applications.
*/
export type PutFirewallConfigPhp = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction
>;
/**
* Generic Attack - Provide broad protection from various undefined or novel attack vectors.
*/
export type PutFirewallConfigGen = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction
>;
/**
* XSS Attack - Prevent injection of malicious scripts into trusted webpages.
*/
export type PutFirewallConfigXss = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction
>;
/**
* SQL Injection Attack - Prohibit unauthorized use of SQL commands to manipulate databases.
*/
export type PutFirewallConfigSqli = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction
>;
/**
* Session Fixation Attack - Prevent unauthorized takeover of user sessions by enforcing unique session IDs.
*/
export type PutFirewallConfigSf = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction =
{
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction
>;
/**
* Java Attack - Mitigate risks of exploitation targeting Java-based applications or components.
*/
export type PutFirewallConfigJava = {
active: boolean;
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction;
};
/**
* Custom Ruleset
*/
export type PutFirewallConfigCrs = {
/**
* Scanner Detection - Detect and prevent reconnaissance activities from network scanning tools.
*/
sd: PutFirewallConfigSd;
/**
* Multipart Attack - Block attempts to bypass security controls using multipart/form-data encoding.
*/
ma: PutFirewallConfigMa;
/**
* Local File Inclusion Attack - Prevent unauthorized access to local files through web applications.
*/
lfi: PutFirewallConfigLfi;
/**
* Remote File Inclusion Attack - Prohibit unauthorized upload or execution of remote files.
*/
rfi: PutFirewallConfigRfi;
/**
* Remote Execution Attack - Prevent unauthorized execution of remote scripts or commands.
*/
rce: PutFirewallConfigRce;
/**
* PHP Attack - Safeguard against vulnerability exploits in PHP-based applications.
*/
php: PutFirewallConfigPhp;
/**
* Generic Attack - Provide broad protection from various undefined or novel attack vectors.
*/
gen: PutFirewallConfigGen;
/**
* XSS Attack - Prevent injection of malicious scripts into trusted webpages.
*/
xss: PutFirewallConfigXss;
/**
* SQL Injection Attack - Prohibit unauthorized use of SQL commands to manipulate databases.
*/
sqli: PutFirewallConfigSqli;
/**
* Session Fixation Attack - Prevent unauthorized takeover of user sessions by enforcing unique session IDs.
*/
sf: PutFirewallConfigSf;
/**
* Java Attack - Mitigate risks of exploitation targeting Java-based applications or components.
*/
java: PutFirewallConfigJava;
};
export const PutFirewallConfigRulesType = {
BotCategory: "bot_category",
BotName: "bot_name",
BotProtection: "bot_protection",
BotStatus: "bot_status",
Cookie: "cookie",
Environment: "environment",
GeoAsNumber: "geo_as_number",
GeoCity: "geo_city",
GeoContinent: "geo_continent",
GeoCountry: "geo_country",
GeoCountryRegion: "geo_country_region",
Header: "header",
Host: "host",
IpAddress: "ip_address",
Ja3Digest: "ja3_digest",
Ja4Digest: "ja4_digest",
Method: "method",
Path: "path",
Protocol: "protocol",
Query: "query",
RateLimitApiId: "rate_limit_api_id",
RawPath: "raw_path",
Region: "region",
Route: "route",
Scheme: "scheme",
ServerAction: "server_action",
TargetPath: "target_path",
TrustedSource: "trusted_source",
UserAgent: "user_agent",
} as const;
export type PutFirewallConfigRulesType = ClosedEnum<
typeof PutFirewallConfigRulesType
>;
export const PutFirewallConfigRulesOp = {
Eq: "eq",
Ex: "ex",
Gt: "gt",
Gte: "gte",
Inc: "inc",
Lt: "lt",
Lte: "lte",
Neq: "neq",
Nex: "nex",
Ninc: "ninc",
Pre: "pre",
Re: "re",
Sub: "sub",
Suf: "suf",
} as const;
export type PutFirewallConfigRulesOp = ClosedEnum<
typeof PutFirewallConfigRulesOp
>;
export type PutFirewallConfigRulesValue = string | number | Array<string>;
export type PutFirewallConfigRulesConditions = {
type: PutFirewallConfigRulesType;
op: PutFirewallConfigRulesOp;
neg?: boolean | undefined;
key?: string | undefined;
value?: string | number | Array<string> | undefined;
};
export type PutFirewallConfigRulesConditionGroup = {
conditions: Array<PutFirewallConfigRulesConditions>;
};
export const PutFirewallConfigRulesSecurityResponse200Action = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
Redirect: "redirect",
} as const;
export type PutFirewallConfigRulesSecurityResponse200Action = ClosedEnum<
typeof PutFirewallConfigRulesSecurityResponse200Action
>;
export const PutFirewallConfigRulesAlgo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
} as const;
export type PutFirewallConfigRulesAlgo = ClosedEnum<
typeof PutFirewallConfigRulesAlgo
>;
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
} as const;
export type PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction =
ClosedEnum<
typeof PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction
>;
export type PutFirewallConfigRulesRateLimit = {
algo: PutFirewallConfigRulesAlgo;
window: number;
limit: number;
keys: Array<string>;
action?:
| PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction
| null
| undefined;
};
export type PutFirewallConfigRulesRedirect = {
location: string;
permanent: boolean;
};
export const PutFirewallConfigLogHeadersSecurity2 = {
Wildcard: "*",
} as const;
export type PutFirewallConfigLogHeadersSecurity2 = ClosedEnum<
typeof PutFirewallConfigLogHeadersSecurity2
>;
export type PutFirewallConfigRulesLogHeaders =
| Array<string>
| PutFirewallConfigLogHeadersSecurity2;
export type PutFirewallConfigRulesMitigate = {
action: PutFirewallConfigRulesSecurityResponse200Action;
rateLimit?: PutFirewallConfigRulesRateLimit | null | undefined;
redirect?: PutFirewallConfigRulesRedirect | null | undefined;
actionDuration?: string | null | undefined;
bypassSystem?: boolean | null | undefined;
logHeaders?: Array<string> | PutFirewallConfigLogHeadersSecurity2 | undefined;
};
export type PutFirewallConfigRulesAction = {
mitigate?: PutFirewallConfigRulesMitigate | undefined;
};
export type PutFirewallConfigRules2 = {
id: string;
name: string;
description?: string | undefined;
active: boolean;
conditionGroup: Array<PutFirewallConfigRulesConditionGroup>;
action: PutFirewallConfigRulesAction;
valid: false;
validationErrors: Array<string>;
};
export const PutFirewallConfigRulesSecurityType = {
BotCategory: "bot_category",
BotName: "bot_name",
BotProtection: "bot_protection",
BotStatus: "bot_status",
Cookie: "cookie",
Environment: "environment",
GeoAsNumber: "geo_as_number",
GeoCity: "geo_city",
GeoContinent: "geo_continent",
GeoCountry: "geo_country",
GeoCountryRegion: "geo_country_region",
Header: "header",
Host: "host",
IpAddress: "ip_address",
Ja3Digest: "ja3_digest",
Ja4Digest: "ja4_digest",
Method: "method",
Path: "path",
Protocol: "protocol",
Query: "query",
RateLimitApiId: "rate_limit_api_id",
RawPath: "raw_path",
Region: "region",
Route: "route",
Scheme: "scheme",
ServerAction: "server_action",
TargetPath: "target_path",
TrustedSource: "trusted_source",
UserAgent: "user_agent",
} as const;
export type PutFirewallConfigRulesSecurityType = ClosedEnum<
typeof PutFirewallConfigRulesSecurityType
>;
export const PutFirewallConfigRulesSecurityOp = {
Eq: "eq",
Ex: "ex",
Gt: "gt",
Gte: "gte",
Inc: "inc",
Lt: "lt",
Lte: "lte",
Neq: "neq",
Nex: "nex",
Ninc: "ninc",
Pre: "pre",
Re: "re",
Sub: "sub",
Suf: "suf",
} as const;
export type PutFirewallConfigRulesSecurityOp = ClosedEnum<
typeof PutFirewallConfigRulesSecurityOp
>;
export type PutFirewallConfigRulesSecurityValue =
| string
| number
| Array<string>;
export type PutFirewallConfigRulesSecurityConditions = {
type: PutFirewallConfigRulesSecurityType;
op: PutFirewallConfigRulesSecurityOp;
neg?: boolean | undefined;
key?: string | undefined;
value?: string | number | Array<string> | undefined;
};
export type PutFirewallConfigRulesSecurityConditionGroup = {
conditions: Array<PutFirewallConfigRulesSecurityConditions>;
};
export const PutFirewallConfigRulesSecurityResponseAction = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
Redirect: "redirect",
} as const;
export type PutFirewallConfigRulesSecurityResponseAction = ClosedEnum<
typeof PutFirewallConfigRulesSecurityResponseAction
>;
export const PutFirewallConfigRulesSecurityAlgo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
} as const;
export type PutFirewallConfigRulesSecurityAlgo = ClosedEnum<
typeof PutFirewallConfigRulesSecurityAlgo
>;
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
} as const;
export type PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction =
ClosedEnum<
typeof PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction
>;
export type PutFirewallConfigRulesSecurityRateLimit = {
algo: PutFirewallConfigRulesSecurityAlgo;
window: number;
limit: number;
keys: Array<string>;
action?:
| PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction
| null
| undefined;
};
export type PutFirewallConfigRulesSecurityRedirect = {
location: string;
permanent: boolean;
};
export const PutFirewallConfigLogHeadersSecurityResponse2 = {
Wildcard: "*",
} as const;
export type PutFirewallConfigLogHeadersSecurityResponse2 = ClosedEnum<
typeof PutFirewallConfigLogHeadersSecurityResponse2
>;
export type PutFirewallConfigRulesSecurityLogHeaders =
| Array<string>
| PutFirewallConfigLogHeadersSecurityResponse2;
export type PutFirewallConfigRulesSecurityMitigate = {
action: PutFirewallConfigRulesSecurityResponseAction;
rateLimit?: PutFirewallConfigRulesSecurityRateLimit | null | undefined;
redirect?: PutFirewallConfigRulesSecurityRedirect | null | undefined;
actionDuration?: string | null | undefined;
bypassSystem?: boolean | null | undefined;
logHeaders?:
| Array<string>
| PutFirewallConfigLogHeadersSecurityResponse2
| undefined;
};
export type PutFirewallConfigRulesSecurityAction = {
mitigate?: PutFirewallConfigRulesSecurityMitigate | undefined;
};
export type PutFirewallConfigRules1 = {
id: string;
name: string;
description?: string | undefined;
active: boolean;
conditionGroup: Array<PutFirewallConfigRulesSecurityConditionGroup>;
action: PutFirewallConfigRulesSecurityAction;
valid: true;
validationErrors?: any | null | undefined;
};
export type PutFirewallConfigSecurityRules =
| PutFirewallConfigRules1
| PutFirewallConfigRules2;
export const PutFirewallConfigSecurityResponseAction = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponseAction = ClosedEnum<
typeof PutFirewallConfigSecurityResponseAction
>;
export type PutFirewallConfigIps = {
id: string;
hostname: string;
ip: string;
notes?: string | undefined;
action: PutFirewallConfigSecurityResponseAction;
};
export type PutFirewallConfigChanges = {};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction
>;
export type PutFirewallConfigBotProtection = {
active: boolean;
action?:
| PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction
| undefined;
updatedAt?: string | undefined;
userId?: string | undefined;
username?: string | undefined;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction
>;
export type PutFirewallConfigAiBots = {
active: boolean;
action?:
| PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction
| undefined;
updatedAt?: string | undefined;
userId?: string | undefined;
username?: string | undefined;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction
>;
export type PutFirewallConfigOwasp = {
active: boolean;
action?:
| PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction
| undefined;
updatedAt?: string | undefined;
userId?: string | undefined;
username?: string | undefined;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction
>;
export type PutFirewallConfigVercelRuleset = {
active: boolean;
action?:
| PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction
| undefined;
updatedAt?: string | undefined;
userId?: string | undefined;
username?: string | undefined;
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction =
{
Challenge: "challenge",
Deny: "deny",
Log: "log",
} as const;
export type PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction =
ClosedEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction
>;
export type PutFirewallConfigTrafficSources = {
active: boolean;
action?:
| PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction
| undefined;
updatedAt?: string | undefined;
userId?: string | undefined;
username?: string | undefined;
};
export type PutFirewallConfigManagedRules = {
botProtection?: PutFirewallConfigBotProtection | undefined;
aiBots?: PutFirewallConfigAiBots | undefined;
owasp?: PutFirewallConfigOwasp | undefined;
vercelRuleset?: PutFirewallConfigVercelRuleset | undefined;
trafficSources?: PutFirewallConfigTrafficSources | undefined;
};
export const PutFirewallConfigLogHeaders2 = {
Wildcard: "*",
} as const;
export type PutFirewallConfigLogHeaders2 = ClosedEnum<
typeof PutFirewallConfigLogHeaders2
>;
export type PutFirewallConfigSecurityLogHeaders =
| Array<string>
| PutFirewallConfigLogHeaders2;
export type Active = {
ownerId: string;
projectKey: string;
id: string;
version: number;
updatedAt: string;
firewallEnabled: boolean;
/**
* Custom Ruleset
*/
crs: PutFirewallConfigCrs;
rules: Array<PutFirewallConfigRules1 | PutFirewallConfigRules2>;
ips: Array<PutFirewallConfigIps>;
changes: Array<PutFirewallConfigChanges>;
managedRules?: PutFirewallConfigManagedRules | undefined;
botIdEnabled?: boolean | undefined;
logHeaders?: Array<string> | PutFirewallConfigLogHeaders2 | undefined;
};
export type PutFirewallConfigResponseBody = {
active: Active;
};
/** @internal */
export type ManagedRules$Outbound = {};
/** @internal */
export const ManagedRules$outboundSchema: z.ZodType<
ManagedRules$Outbound,
z.ZodTypeDef,
ManagedRules
> = z.object({});
export function managedRulesToJSON(managedRules: ManagedRules): string {
return JSON.stringify(ManagedRules$outboundSchema.parse(managedRules));
}
/** @internal */
export const PutFirewallConfigAction$outboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigAction
> = z.nativeEnum(PutFirewallConfigAction);
/** @internal */
export type Sd$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Sd$outboundSchema: z.ZodType<Sd$Outbound, z.ZodTypeDef, Sd> = z
.object({
active: z.boolean(),
action: PutFirewallConfigAction$outboundSchema,
});
export function sdToJSON(sd: Sd): string {
return JSON.stringify(Sd$outboundSchema.parse(sd));
}
/** @internal */
export const PutFirewallConfigSecurityAction$outboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigSecurityAction
> = z.nativeEnum(PutFirewallConfigSecurityAction);
/** @internal */
export type Ma$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Ma$outboundSchema: z.ZodType<Ma$Outbound, z.ZodTypeDef, Ma> = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityAction$outboundSchema,
});
export function maToJSON(ma: Ma): string {
return JSON.stringify(Ma$outboundSchema.parse(ma));
}
/** @internal */
export const PutFirewallConfigSecurityRequestAction$outboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityRequestAction> = z.nativeEnum(
PutFirewallConfigSecurityRequestAction,
);
/** @internal */
export type Lfi$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Lfi$outboundSchema: z.ZodType<Lfi$Outbound, z.ZodTypeDef, Lfi> = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestAction$outboundSchema,
});
export function lfiToJSON(lfi: Lfi): string {
return JSON.stringify(Lfi$outboundSchema.parse(lfi));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyAction$outboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityRequestRequestBodyAction> = z
.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyAction);
/** @internal */
export type Rfi$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Rfi$outboundSchema: z.ZodType<Rfi$Outbound, z.ZodTypeDef, Rfi> = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyAction$outboundSchema,
});
export function rfiToJSON(rfi: Rfi): string {
return JSON.stringify(Rfi$outboundSchema.parse(rfi));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsAction$outboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityRequestRequestBodyCrsAction> =
z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsAction);
/** @internal */
export type Rce$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Rce$outboundSchema: z.ZodType<Rce$Outbound, z.ZodTypeDef, Rce> = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsAction$outboundSchema,
});
export function rceToJSON(rce: Rce): string {
return JSON.stringify(Rce$outboundSchema.parse(rce));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction);
/** @internal */
export type Php$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Php$outboundSchema: z.ZodType<Php$Outbound, z.ZodTypeDef, Php> = z
.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction$outboundSchema,
});
export function phpToJSON(php: Php): string {
return JSON.stringify(Php$outboundSchema.parse(php));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsGenAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsGenAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsGenAction);
/** @internal */
export type Gen$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Gen$outboundSchema: z.ZodType<Gen$Outbound, z.ZodTypeDef, Gen> = z
.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsGenAction$outboundSchema,
});
export function genToJSON(gen: Gen): string {
return JSON.stringify(Gen$outboundSchema.parse(gen));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsXssAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsXssAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsXssAction);
/** @internal */
export type Xss$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Xss$outboundSchema: z.ZodType<Xss$Outbound, z.ZodTypeDef, Xss> = z
.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsXssAction$outboundSchema,
});
export function xssToJSON(xss: Xss): string {
return JSON.stringify(Xss$outboundSchema.parse(xss));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction);
/** @internal */
export type Sqli$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Sqli$outboundSchema: z.ZodType<Sqli$Outbound, z.ZodTypeDef, Sqli> =
z.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction$outboundSchema,
});
export function sqliToJSON(sqli: Sqli): string {
return JSON.stringify(Sqli$outboundSchema.parse(sqli));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsSfAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsSfAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsSfAction);
/** @internal */
export type Sf$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Sf$outboundSchema: z.ZodType<Sf$Outbound, z.ZodTypeDef, Sf> = z
.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsSfAction$outboundSchema,
});
export function sfToJSON(sf: Sf): string {
return JSON.stringify(Sf$outboundSchema.parse(sf));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction
> = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction);
/** @internal */
export type Java$Outbound = {
active: boolean;
action: string;
};
/** @internal */
export const Java$outboundSchema: z.ZodType<Java$Outbound, z.ZodTypeDef, Java> =
z.object({
active: z.boolean(),
action:
PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction$outboundSchema,
});
export function javaToJSON(java: Java): string {
return JSON.stringify(Java$outboundSchema.parse(java));
}
/** @internal */
export type Crs$Outbound = {
sd?: Sd$Outbound | undefined;
ma?: Ma$Outbound | undefined;
lfi?: Lfi$Outbound | undefined;
rfi?: Rfi$Outbound | undefined;
rce?: Rce$Outbound | undefined;
php?: Php$Outbound | undefined;
gen?: Gen$Outbound | undefined;
xss?: Xss$Outbound | undefined;
sqli?: Sqli$Outbound | undefined;
sf?: Sf$Outbound | undefined;
java?: Java$Outbound | undefined;
};
/** @internal */
export const Crs$outboundSchema: z.ZodType<Crs$Outbound, z.ZodTypeDef, Crs> = z
.object({
sd: z.lazy(() => Sd$outboundSchema).optional(),
ma: z.lazy(() => Ma$outboundSchema).optional(),
lfi: z.lazy(() => Lfi$outboundSchema).optional(),
rfi: z.lazy(() => Rfi$outboundSchema).optional(),
rce: z.lazy(() => Rce$outboundSchema).optional(),
php: z.lazy(() => Php$outboundSchema).optional(),
gen: z.lazy(() => Gen$outboundSchema).optional(),
xss: z.lazy(() => Xss$outboundSchema).optional(),
sqli: z.lazy(() => Sqli$outboundSchema).optional(),
sf: z.lazy(() => Sf$outboundSchema).optional(),
java: z.lazy(() => Java$outboundSchema).optional(),
});
export function crsToJSON(crs: Crs): string {
return JSON.stringify(Crs$outboundSchema.parse(crs));
}
/** @internal */
export const PutFirewallConfigType$outboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigType
> = z.nativeEnum(PutFirewallConfigType);
/** @internal */
export const PutFirewallConfigOp$outboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigOp
> = z.nativeEnum(PutFirewallConfigOp);
/** @internal */
export type PutFirewallConfigValue$Outbound = string | Array<string> | number;
/** @internal */
export const PutFirewallConfigValue$outboundSchema: z.ZodType<
PutFirewallConfigValue$Outbound,
z.ZodTypeDef,
PutFirewallConfigValue
> = smartUnion([z.string(), z.array(z.string()), z.number()]);
export function putFirewallConfigValueToJSON(
putFirewallConfigValue: PutFirewallConfigValue,
): string {
return JSON.stringify(
PutFirewallConfigValue$outboundSchema.parse(putFirewallConfigValue),
);
}
/** @internal */
export type PutFirewallConfigConditions$Outbound = {
type: string;
op: string;
neg?: boolean | undefined;
key?: string | undefined;
value?: string | Array<string> | number | undefined;
};
/** @internal */
export const PutFirewallConfigConditions$outboundSchema: z.ZodType<
PutFirewallConfigConditions$Outbound,
z.ZodTypeDef,
PutFirewallConfigConditions
> = z.object({
type: PutFirewallConfigType$outboundSchema,
op: PutFirewallConfigOp$outboundSchema,
neg: z.boolean().optional(),
key: z.string().optional(),
value: smartUnion([z.string(), z.array(z.string()), z.number()]).optional(),
});
export function putFirewallConfigConditionsToJSON(
putFirewallConfigConditions: PutFirewallConfigConditions,
): string {
return JSON.stringify(
PutFirewallConfigConditions$outboundSchema.parse(
putFirewallConfigConditions,
),
);
}
/** @internal */
export type ConditionGroup$Outbound = {
conditions: Array<PutFirewallConfigConditions$Outbound>;
};
/** @internal */
export const ConditionGroup$outboundSchema: z.ZodType<
ConditionGroup$Outbound,
z.ZodTypeDef,
ConditionGroup
> = z.object({
conditions: z.array(z.lazy(() => PutFirewallConfigConditions$outboundSchema)),
});
export function conditionGroupToJSON(conditionGroup: ConditionGroup): string {
return JSON.stringify(ConditionGroup$outboundSchema.parse(conditionGroup));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyRulesActionAction$outboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityRequestRequestBodyRulesActionAction
> = z.nativeEnum(
PutFirewallConfigSecurityRequestRequestBodyRulesActionAction,
);
/** @internal */
export const Algo$outboundSchema: z.ZodNativeEnum<typeof Algo> = z.nativeEnum(
Algo,
);
/** @internal */
export const Action1$outboundSchema: z.ZodNativeEnum<typeof Action1> = z
.nativeEnum(Action1);
/** @internal */
export type RateLimitAction$Outbound = string | any;
/** @internal */
export const RateLimitAction$outboundSchema: z.ZodType<
RateLimitAction$Outbound,
z.ZodTypeDef,
RateLimitAction
> = smartUnion([Action1$outboundSchema, z.any()]);
export function rateLimitActionToJSON(
rateLimitAction: RateLimitAction,
): string {
return JSON.stringify(RateLimitAction$outboundSchema.parse(rateLimitAction));
}
/** @internal */
export type RateLimit1$Outbound = {
algo: string;
window: number;
limit: number;
keys: Array<string>;
action?: string | any | null | undefined;
};
/** @internal */
export const RateLimit1$outboundSchema: z.ZodType<
RateLimit1$Outbound,
z.ZodTypeDef,
RateLimit1
> = z.object({
algo: Algo$outboundSchema,
window: z.number(),
limit: z.number(),
keys: z.array(z.string()),
action: z.nullable(smartUnion([Action1$outboundSchema, z.any()])).optional(),
});
export function rateLimit1ToJSON(rateLimit1: RateLimit1): string {
return JSON.stringify(RateLimit1$outboundSchema.parse(rateLimit1));
}
/** @internal */
export type RateLimit$Outbound = RateLimit1$Outbound | any;
/** @internal */
export const RateLimit$outboundSchema: z.ZodType<
RateLimit$Outbound,
z.ZodTypeDef,
RateLimit
> = smartUnion([z.lazy(() => RateLimit1$outboundSchema), z.any()]);
export function rateLimitToJSON(rateLimit: RateLimit): string {
return JSON.stringify(RateLimit$outboundSchema.parse(rateLimit));
}
/** @internal */
export type Redirect1$Outbound = {
location: string;
permanent: boolean;
};
/** @internal */
export const Redirect1$outboundSchema: z.ZodType<
Redirect1$Outbound,
z.ZodTypeDef,
Redirect1
> = z.object({
location: z.string(),
permanent: z.boolean(),
});
export function redirect1ToJSON(redirect1: Redirect1): string {
return JSON.stringify(Redirect1$outboundSchema.parse(redirect1));
}
/** @internal */
export type PutFirewallConfigRedirect$Outbound = Redirect1$Outbound | any;
/** @internal */
export const PutFirewallConfigRedirect$outboundSchema: z.ZodType<
PutFirewallConfigRedirect$Outbound,
z.ZodTypeDef,
PutFirewallConfigRedirect
> = smartUnion([z.lazy(() => Redirect1$outboundSchema), z.any()]);
export function putFirewallConfigRedirectToJSON(
putFirewallConfigRedirect: PutFirewallConfigRedirect,
): string {
return JSON.stringify(
PutFirewallConfigRedirect$outboundSchema.parse(putFirewallConfigRedirect),
);
}
/** @internal */
export type LogHeaders$Outbound = string | Array<string>;
/** @internal */
export const LogHeaders$outboundSchema: z.ZodType<
LogHeaders$Outbound,
z.ZodTypeDef,
LogHeaders
> = smartUnion([z.string(), z.array(z.string())]);
export function logHeadersToJSON(logHeaders: LogHeaders): string {
return JSON.stringify(LogHeaders$outboundSchema.parse(logHeaders));
}
/** @internal */
export type Mitigate$Outbound = {
action: string;
rateLimit?: RateLimit1$Outbound | any | null | undefined;
redirect?: Redirect1$Outbound | any | null | undefined;
actionDuration?: string | null | undefined;
bypassSystem?: boolean | null | undefined;
logHeaders?: string | Array<string> | undefined;
};
/** @internal */
export const Mitigate$outboundSchema: z.ZodType<
Mitigate$Outbound,
z.ZodTypeDef,
Mitigate
> = z.object({
action:
PutFirewallConfigSecurityRequestRequestBodyRulesActionAction$outboundSchema,
rateLimit: z.nullable(
smartUnion([z.lazy(() => RateLimit1$outboundSchema), z.any()]),
).optional(),
redirect: z.nullable(
smartUnion([z.lazy(() => Redirect1$outboundSchema), z.any()]),
).optional(),
actionDuration: z.nullable(z.string()).optional(),
bypassSystem: z.nullable(z.boolean()).optional(),
logHeaders: smartUnion([z.string(), z.array(z.string())]).optional(),
});
export function mitigateToJSON(mitigate: Mitigate): string {
return JSON.stringify(Mitigate$outboundSchema.parse(mitigate));
}
/** @internal */
export type PutFirewallConfigSecurityRequestRequestBodyRulesAction$Outbound = {
mitigate?: Mitigate$Outbound | undefined;
};
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyRulesAction$outboundSchema:
z.ZodType<
PutFirewallConfigSecurityRequestRequestBodyRulesAction$Outbound,
z.ZodTypeDef,
PutFirewallConfigSecurityRequestRequestBodyRulesAction
> = z.object({
mitigate: z.lazy(() => Mitigate$outboundSchema).optional(),
});
export function putFirewallConfigSecurityRequestRequestBodyRulesActionToJSON(
putFirewallConfigSecurityRequestRequestBodyRulesAction:
PutFirewallConfigSecurityRequestRequestBodyRulesAction,
): string {
return JSON.stringify(
PutFirewallConfigSecurityRequestRequestBodyRulesAction$outboundSchema.parse(
putFirewallConfigSecurityRequestRequestBodyRulesAction,
),
);
}
/** @internal */
export type ValidationErrors$Outbound = Array<string> | string;
/** @internal */
export const ValidationErrors$outboundSchema: z.ZodType<
ValidationErrors$Outbound,
z.ZodTypeDef,
ValidationErrors
> = smartUnion([z.array(z.string()), z.string()]);
export function validationErrorsToJSON(
validationErrors: ValidationErrors,
): string {
return JSON.stringify(
ValidationErrors$outboundSchema.parse(validationErrors),
);
}
/** @internal */
export type PutFirewallConfigRules$Outbound = {
id?: string | undefined;
name: string;
description?: string | undefined;
active: boolean;
conditionGroup: Array<ConditionGroup$Outbound>;
action: PutFirewallConfigSecurityRequestRequestBodyRulesAction$Outbound;
valid?: boolean | undefined;
validationErrors?: Array<string> | string | undefined;
};
/** @internal */
export const PutFirewallConfigRules$outboundSchema: z.ZodType<
PutFirewallConfigRules$Outbound,
z.ZodTypeDef,
PutFirewallConfigRules
> = z.object({
id: z.string().optional(),
name: z.string(),
description: z.string().optional(),
active: z.boolean(),
conditionGroup: z.array(z.lazy(() => ConditionGroup$outboundSchema)),
action: z.lazy(() =>
PutFirewallConfigSecurityRequestRequestBodyRulesAction$outboundSchema
),
valid: z.boolean().optional(),
validationErrors: smartUnion([z.array(z.string()), z.string()]).optional(),
});
export function putFirewallConfigRulesToJSON(
putFirewallConfigRules: PutFirewallConfigRules,
): string {
return JSON.stringify(
PutFirewallConfigRules$outboundSchema.parse(putFirewallConfigRules),
);
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyIpsAction$outboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityRequestRequestBodyIpsAction> =
z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyIpsAction);
/** @internal */
export type Ips$Outbound = {
id?: string | undefined;
hostname: string;
ip: string;
notes?: string | undefined;
action: string;
};
/** @internal */
export const Ips$outboundSchema: z.ZodType<Ips$Outbound, z.ZodTypeDef, Ips> = z
.object({
id: z.string().optional(),
hostname: z.string(),
ip: z.string(),
notes: z.string().optional(),
action: PutFirewallConfigSecurityRequestRequestBodyIpsAction$outboundSchema,
});
export function ipsToJSON(ips: Ips): string {
return JSON.stringify(Ips$outboundSchema.parse(ips));
}
/** @internal */
export type PutFirewallConfigLogHeaders$Outbound = string | Array<string>;
/** @internal */
export const PutFirewallConfigLogHeaders$outboundSchema: z.ZodType<
PutFirewallConfigLogHeaders$Outbound,
z.ZodTypeDef,
PutFirewallConfigLogHeaders
> = smartUnion([z.string(), z.array(z.string())]);
export function putFirewallConfigLogHeadersToJSON(
putFirewallConfigLogHeaders: PutFirewallConfigLogHeaders,
): string {
return JSON.stringify(
PutFirewallConfigLogHeaders$outboundSchema.parse(
putFirewallConfigLogHeaders,
),
);
}
/** @internal */
export type PutFirewallConfigRequestBody$Outbound = {
firewallEnabled: boolean;
managedRules?: ManagedRules$Outbound | undefined;
crs?: Crs$Outbound | undefined;
rules?: Array<PutFirewallConfigRules$Outbound> | undefined;
ips?: Array<Ips$Outbound> | undefined;
botIdEnabled?: boolean | undefined;
logHeaders?: string | Array<string> | undefined;
};
/** @internal */
export const PutFirewallConfigRequestBody$outboundSchema: z.ZodType<
PutFirewallConfigRequestBody$Outbound,
z.ZodTypeDef,
PutFirewallConfigRequestBody
> = z.object({
firewallEnabled: z.boolean(),
managedRules: z.lazy(() => ManagedRules$outboundSchema).optional(),
crs: z.lazy(() => Crs$outboundSchema).optional(),
rules: z.array(z.lazy(() => PutFirewallConfigRules$outboundSchema))
.optional(),
ips: z.array(z.lazy(() => Ips$outboundSchema)).optional(),
botIdEnabled: z.boolean().optional(),
logHeaders: smartUnion([z.string(), z.array(z.string())]).optional(),
});
export function putFirewallConfigRequestBodyToJSON(
putFirewallConfigRequestBody: PutFirewallConfigRequestBody,
): string {
return JSON.stringify(
PutFirewallConfigRequestBody$outboundSchema.parse(
putFirewallConfigRequestBody,
),
);
}
/** @internal */
export type PutFirewallConfigRequest$Outbound = {
projectId: string;
teamId?: string | undefined;
slug?: string | undefined;
RequestBody: PutFirewallConfigRequestBody$Outbound;
};
/** @internal */
export const PutFirewallConfigRequest$outboundSchema: z.ZodType<
PutFirewallConfigRequest$Outbound,
z.ZodTypeDef,
PutFirewallConfigRequest
> = z.object({
projectId: z.string(),
teamId: z.string().optional(),
slug: z.string().optional(),
requestBody: z.lazy(() => PutFirewallConfigRequestBody$outboundSchema),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
export function putFirewallConfigRequestToJSON(
putFirewallConfigRequest: PutFirewallConfigRequest,
): string {
return JSON.stringify(
PutFirewallConfigRequest$outboundSchema.parse(putFirewallConfigRequest),
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction,
);
/** @internal */
export const PutFirewallConfigSd$inboundSchema: z.ZodType<
PutFirewallConfigSd,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction$inboundSchema,
});
export function putFirewallConfigSdFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigSd, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigSd$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigSd' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200Action$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityResponse200Action> = z
.nativeEnum(PutFirewallConfigSecurityResponse200Action);
/** @internal */
export const PutFirewallConfigMa$inboundSchema: z.ZodType<
PutFirewallConfigMa,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200Action$inboundSchema,
});
export function putFirewallConfigMaFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigMa, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigMa$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigMa' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONAction
> = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONAction);
/** @internal */
export const PutFirewallConfigLfi$inboundSchema: z.ZodType<
PutFirewallConfigLfi,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema,
});
export function putFirewallConfigLfiFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigLfi, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigLfi$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigLfi' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction,
);
/** @internal */
export const PutFirewallConfigRfi$inboundSchema: z.ZodType<
PutFirewallConfigRfi,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema,
});
export function putFirewallConfigRfiFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRfi, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRfi$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRfi' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction,
);
/** @internal */
export const PutFirewallConfigRce$inboundSchema: z.ZodType<
PutFirewallConfigRce,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction$inboundSchema,
});
export function putFirewallConfigRceFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRce, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRce$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRce' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction,
);
/** @internal */
export const PutFirewallConfigPhp$inboundSchema: z.ZodType<
PutFirewallConfigPhp,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction$inboundSchema,
});
export function putFirewallConfigPhpFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigPhp, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigPhp$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigPhp' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction,
);
/** @internal */
export const PutFirewallConfigGen$inboundSchema: z.ZodType<
PutFirewallConfigGen,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction$inboundSchema,
});
export function putFirewallConfigGenFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigGen, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigGen$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigGen' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction,
);
/** @internal */
export const PutFirewallConfigXss$inboundSchema: z.ZodType<
PutFirewallConfigXss,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction$inboundSchema,
});
export function putFirewallConfigXssFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigXss, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigXss$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigXss' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction,
);
/** @internal */
export const PutFirewallConfigSqli$inboundSchema: z.ZodType<
PutFirewallConfigSqli,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction$inboundSchema,
});
export function putFirewallConfigSqliFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigSqli, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigSqli$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigSqli' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction,
);
/** @internal */
export const PutFirewallConfigSf$inboundSchema: z.ZodType<
PutFirewallConfigSf,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction$inboundSchema,
});
export function putFirewallConfigSfFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigSf, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigSf$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigSf' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction,
);
/** @internal */
export const PutFirewallConfigJava$inboundSchema: z.ZodType<
PutFirewallConfigJava,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action:
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction$inboundSchema,
});
export function putFirewallConfigJavaFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigJava, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigJava$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigJava' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigCrs$inboundSchema: z.ZodType<
PutFirewallConfigCrs,
z.ZodTypeDef,
unknown
> = z.object({
sd: z.lazy(() => PutFirewallConfigSd$inboundSchema),
ma: z.lazy(() => PutFirewallConfigMa$inboundSchema),
lfi: z.lazy(() => PutFirewallConfigLfi$inboundSchema),
rfi: z.lazy(() => PutFirewallConfigRfi$inboundSchema),
rce: z.lazy(() => PutFirewallConfigRce$inboundSchema),
php: z.lazy(() => PutFirewallConfigPhp$inboundSchema),
gen: z.lazy(() => PutFirewallConfigGen$inboundSchema),
xss: z.lazy(() => PutFirewallConfigXss$inboundSchema),
sqli: z.lazy(() => PutFirewallConfigSqli$inboundSchema),
sf: z.lazy(() => PutFirewallConfigSf$inboundSchema),
java: z.lazy(() => PutFirewallConfigJava$inboundSchema),
});
export function putFirewallConfigCrsFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigCrs, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigCrs$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigCrs' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesType$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesType
> = z.nativeEnum(PutFirewallConfigRulesType);
/** @internal */
export const PutFirewallConfigRulesOp$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesOp
> = z.nativeEnum(PutFirewallConfigRulesOp);
/** @internal */
export const PutFirewallConfigRulesValue$inboundSchema: z.ZodType<
PutFirewallConfigRulesValue,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number(), z.array(types.string())]);
export function putFirewallConfigRulesValueFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesValue, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesValue$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesValue' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesConditions$inboundSchema: z.ZodType<
PutFirewallConfigRulesConditions,
z.ZodTypeDef,
unknown
> = z.object({
type: PutFirewallConfigRulesType$inboundSchema,
op: PutFirewallConfigRulesOp$inboundSchema,
neg: types.optional(types.boolean()),
key: types.optional(types.string()),
value: types.optional(
smartUnion([types.string(), types.number(), z.array(types.string())]),
),
});
export function putFirewallConfigRulesConditionsFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesConditions, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesConditions$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesConditions' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesConditionGroup$inboundSchema: z.ZodType<
PutFirewallConfigRulesConditionGroup,
z.ZodTypeDef,
unknown
> = z.object({
conditions: z.array(
z.lazy(() => PutFirewallConfigRulesConditions$inboundSchema),
),
});
export function putFirewallConfigRulesConditionGroupFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesConditionGroup, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesConditionGroup$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesConditionGroup' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200Action$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigRulesSecurityResponse200Action> = z
.nativeEnum(PutFirewallConfigRulesSecurityResponse200Action);
/** @internal */
export const PutFirewallConfigRulesAlgo$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesAlgo
> = z.nativeEnum(PutFirewallConfigRulesAlgo);
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction
> = z.nativeEnum(
PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction,
);
/** @internal */
export const PutFirewallConfigRulesRateLimit$inboundSchema: z.ZodType<
PutFirewallConfigRulesRateLimit,
z.ZodTypeDef,
unknown
> = z.object({
algo: PutFirewallConfigRulesAlgo$inboundSchema,
window: types.number(),
limit: types.number(),
keys: z.array(types.string()),
action: z.nullable(
PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema,
).optional(),
});
export function putFirewallConfigRulesRateLimitFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesRateLimit, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesRateLimit$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesRateLimit' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesRedirect$inboundSchema: z.ZodType<
PutFirewallConfigRulesRedirect,
z.ZodTypeDef,
unknown
> = z.object({
location: types.string(),
permanent: types.boolean(),
});
export function putFirewallConfigRulesRedirectFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesRedirect, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesRedirect$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesRedirect' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigLogHeadersSecurity2$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigLogHeadersSecurity2> = z.nativeEnum(
PutFirewallConfigLogHeadersSecurity2,
);
/** @internal */
export const PutFirewallConfigRulesLogHeaders$inboundSchema: z.ZodType<
PutFirewallConfigRulesLogHeaders,
z.ZodTypeDef,
unknown
> = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurity2$inboundSchema,
]);
export function putFirewallConfigRulesLogHeadersFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesLogHeaders, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesLogHeaders$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesLogHeaders' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesMitigate$inboundSchema: z.ZodType<
PutFirewallConfigRulesMitigate,
z.ZodTypeDef,
unknown
> = z.object({
action: PutFirewallConfigRulesSecurityResponse200Action$inboundSchema,
rateLimit: z.nullable(
z.lazy(() => PutFirewallConfigRulesRateLimit$inboundSchema),
).optional(),
redirect: z.nullable(
z.lazy(() => PutFirewallConfigRulesRedirect$inboundSchema),
).optional(),
actionDuration: z.nullable(types.string()).optional(),
bypassSystem: z.nullable(types.boolean()).optional(),
logHeaders: types.optional(
smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurity2$inboundSchema,
]),
),
});
export function putFirewallConfigRulesMitigateFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesMitigate, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesMitigate$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesMitigate' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesAction$inboundSchema: z.ZodType<
PutFirewallConfigRulesAction,
z.ZodTypeDef,
unknown
> = z.object({
mitigate: types.optional(
z.lazy(() => PutFirewallConfigRulesMitigate$inboundSchema),
),
});
export function putFirewallConfigRulesActionFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesAction, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRulesAction$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesAction' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRules2$inboundSchema: z.ZodType<
PutFirewallConfigRules2,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
name: types.string(),
description: types.optional(types.string()),
active: types.boolean(),
conditionGroup: z.array(
z.lazy(() => PutFirewallConfigRulesConditionGroup$inboundSchema),
),
action: z.lazy(() => PutFirewallConfigRulesAction$inboundSchema),
valid: types.literal(false),
validationErrors: z.array(types.string()),
});
export function putFirewallConfigRules2FromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRules2, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRules2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRules2' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityType$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesSecurityType
> = z.nativeEnum(PutFirewallConfigRulesSecurityType);
/** @internal */
export const PutFirewallConfigRulesSecurityOp$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesSecurityOp
> = z.nativeEnum(PutFirewallConfigRulesSecurityOp);
/** @internal */
export const PutFirewallConfigRulesSecurityValue$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityValue,
z.ZodTypeDef,
unknown
> = smartUnion([types.string(), types.number(), z.array(types.string())]);
export function putFirewallConfigRulesSecurityValueFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesSecurityValue, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityValue$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesSecurityValue' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityConditions$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityConditions,
z.ZodTypeDef,
unknown
> = z.object({
type: PutFirewallConfigRulesSecurityType$inboundSchema,
op: PutFirewallConfigRulesSecurityOp$inboundSchema,
neg: types.optional(types.boolean()),
key: types.optional(types.string()),
value: types.optional(
smartUnion([types.string(), types.number(), z.array(types.string())]),
),
});
export function putFirewallConfigRulesSecurityConditionsFromJSON(
jsonString: string,
): SafeParseResult<
PutFirewallConfigRulesSecurityConditions,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityConditions$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutFirewallConfigRulesSecurityConditions' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityConditionGroup$inboundSchema:
z.ZodType<
PutFirewallConfigRulesSecurityConditionGroup,
z.ZodTypeDef,
unknown
> = z.object({
conditions: z.array(
z.lazy(() => PutFirewallConfigRulesSecurityConditions$inboundSchema),
),
});
export function putFirewallConfigRulesSecurityConditionGroupFromJSON(
jsonString: string,
): SafeParseResult<
PutFirewallConfigRulesSecurityConditionGroup,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityConditionGroup$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutFirewallConfigRulesSecurityConditionGroup' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityResponseAction$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigRulesSecurityResponseAction> = z
.nativeEnum(PutFirewallConfigRulesSecurityResponseAction);
/** @internal */
export const PutFirewallConfigRulesSecurityAlgo$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigRulesSecurityAlgo
> = z.nativeEnum(PutFirewallConfigRulesSecurityAlgo);
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction
> = z.nativeEnum(
PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction,
);
/** @internal */
export const PutFirewallConfigRulesSecurityRateLimit$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityRateLimit,
z.ZodTypeDef,
unknown
> = z.object({
algo: PutFirewallConfigRulesSecurityAlgo$inboundSchema,
window: types.number(),
limit: types.number(),
keys: z.array(types.string()),
action: z.nullable(
PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction$inboundSchema,
).optional(),
});
export function putFirewallConfigRulesSecurityRateLimitFromJSON(
jsonString: string,
): SafeParseResult<
PutFirewallConfigRulesSecurityRateLimit,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityRateLimit$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutFirewallConfigRulesSecurityRateLimit' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityRedirect$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityRedirect,
z.ZodTypeDef,
unknown
> = z.object({
location: types.string(),
permanent: types.boolean(),
});
export function putFirewallConfigRulesSecurityRedirectFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesSecurityRedirect, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityRedirect$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesSecurityRedirect' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigLogHeadersSecurityResponse2$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigLogHeadersSecurityResponse2> = z
.nativeEnum(PutFirewallConfigLogHeadersSecurityResponse2);
/** @internal */
export const PutFirewallConfigRulesSecurityLogHeaders$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityLogHeaders,
z.ZodTypeDef,
unknown
> = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurityResponse2$inboundSchema,
]);
export function putFirewallConfigRulesSecurityLogHeadersFromJSON(
jsonString: string,
): SafeParseResult<
PutFirewallConfigRulesSecurityLogHeaders,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityLogHeaders$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutFirewallConfigRulesSecurityLogHeaders' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityMitigate$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityMitigate,
z.ZodTypeDef,
unknown
> = z.object({
action: PutFirewallConfigRulesSecurityResponseAction$inboundSchema,
rateLimit: z.nullable(
z.lazy(() => PutFirewallConfigRulesSecurityRateLimit$inboundSchema),
).optional(),
redirect: z.nullable(
z.lazy(() => PutFirewallConfigRulesSecurityRedirect$inboundSchema),
).optional(),
actionDuration: z.nullable(types.string()).optional(),
bypassSystem: z.nullable(types.boolean()).optional(),
logHeaders: types.optional(
smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurityResponse2$inboundSchema,
]),
),
});
export function putFirewallConfigRulesSecurityMitigateFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesSecurityMitigate, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityMitigate$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesSecurityMitigate' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRulesSecurityAction$inboundSchema: z.ZodType<
PutFirewallConfigRulesSecurityAction,
z.ZodTypeDef,
unknown
> = z.object({
mitigate: types.optional(
z.lazy(() => PutFirewallConfigRulesSecurityMitigate$inboundSchema),
),
});
export function putFirewallConfigRulesSecurityActionFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRulesSecurityAction, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigRulesSecurityAction$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRulesSecurityAction' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigRules1$inboundSchema: z.ZodType<
PutFirewallConfigRules1,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
name: types.string(),
description: types.optional(types.string()),
active: types.boolean(),
conditionGroup: z.array(
z.lazy(() => PutFirewallConfigRulesSecurityConditionGroup$inboundSchema),
),
action: z.lazy(() => PutFirewallConfigRulesSecurityAction$inboundSchema),
valid: types.literal(true),
validationErrors: z.nullable(z.any()).optional(),
});
export function putFirewallConfigRules1FromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigRules1, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigRules1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigRules1' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityRules$inboundSchema: z.ZodType<
PutFirewallConfigSecurityRules,
z.ZodTypeDef,
unknown
> = smartUnion([
z.lazy(() => PutFirewallConfigRules1$inboundSchema),
z.lazy(() => PutFirewallConfigRules2$inboundSchema),
]);
export function putFirewallConfigSecurityRulesFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigSecurityRules, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigSecurityRules$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigSecurityRules' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponseAction$inboundSchema:
z.ZodNativeEnum<typeof PutFirewallConfigSecurityResponseAction> = z
.nativeEnum(PutFirewallConfigSecurityResponseAction);
/** @internal */
export const PutFirewallConfigIps$inboundSchema: z.ZodType<
PutFirewallConfigIps,
z.ZodTypeDef,
unknown
> = z.object({
id: types.string(),
hostname: types.string(),
ip: types.string(),
notes: types.optional(types.string()),
action: PutFirewallConfigSecurityResponseAction$inboundSchema,
});
export function putFirewallConfigIpsFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigIps, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigIps$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigIps' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigChanges$inboundSchema: z.ZodType<
PutFirewallConfigChanges,
z.ZodTypeDef,
unknown
> = z.object({});
export function putFirewallConfigChangesFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigChanges, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigChanges$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigChanges' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction,
);
/** @internal */
export const PutFirewallConfigBotProtection$inboundSchema: z.ZodType<
PutFirewallConfigBotProtection,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: types.optional(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction$inboundSchema,
),
updatedAt: types.optional(types.string()),
userId: types.optional(types.string()),
username: types.optional(types.string()),
});
export function putFirewallConfigBotProtectionFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigBotProtection, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigBotProtection$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigBotProtection' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction,
);
/** @internal */
export const PutFirewallConfigAiBots$inboundSchema: z.ZodType<
PutFirewallConfigAiBots,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: types.optional(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction$inboundSchema,
),
updatedAt: types.optional(types.string()),
userId: types.optional(types.string()),
username: types.optional(types.string()),
});
export function putFirewallConfigAiBotsFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigAiBots, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigAiBots$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigAiBots' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction,
);
/** @internal */
export const PutFirewallConfigOwasp$inboundSchema: z.ZodType<
PutFirewallConfigOwasp,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: types.optional(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction$inboundSchema,
),
updatedAt: types.optional(types.string()),
userId: types.optional(types.string()),
username: types.optional(types.string()),
});
export function putFirewallConfigOwaspFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigOwasp, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigOwasp$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigOwasp' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction,
);
/** @internal */
export const PutFirewallConfigVercelRuleset$inboundSchema: z.ZodType<
PutFirewallConfigVercelRuleset,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: types.optional(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction$inboundSchema,
),
updatedAt: types.optional(types.string()),
userId: types.optional(types.string()),
username: types.optional(types.string()),
});
export function putFirewallConfigVercelRulesetFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigVercelRuleset, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigVercelRuleset$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigVercelRuleset' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction$inboundSchema:
z.ZodNativeEnum<
typeof PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction
> = z.nativeEnum(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction,
);
/** @internal */
export const PutFirewallConfigTrafficSources$inboundSchema: z.ZodType<
PutFirewallConfigTrafficSources,
z.ZodTypeDef,
unknown
> = z.object({
active: types.boolean(),
action: types.optional(
PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction$inboundSchema,
),
updatedAt: types.optional(types.string()),
userId: types.optional(types.string()),
username: types.optional(types.string()),
});
export function putFirewallConfigTrafficSourcesFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigTrafficSources, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigTrafficSources$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigTrafficSources' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigManagedRules$inboundSchema: z.ZodType<
PutFirewallConfigManagedRules,
z.ZodTypeDef,
unknown
> = z.object({
bot_protection: types.optional(
z.lazy(() => PutFirewallConfigBotProtection$inboundSchema),
),
ai_bots: types.optional(z.lazy(() => PutFirewallConfigAiBots$inboundSchema)),
owasp: types.optional(z.lazy(() => PutFirewallConfigOwasp$inboundSchema)),
vercel_ruleset: types.optional(
z.lazy(() => PutFirewallConfigVercelRuleset$inboundSchema),
),
traffic_sources: types.optional(
z.lazy(() => PutFirewallConfigTrafficSources$inboundSchema),
),
}).transform((v) => {
return remap$(v, {
"bot_protection": "botProtection",
"ai_bots": "aiBots",
"vercel_ruleset": "vercelRuleset",
"traffic_sources": "trafficSources",
});
});
export function putFirewallConfigManagedRulesFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigManagedRules, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigManagedRules$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigManagedRules' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigLogHeaders2$inboundSchema: z.ZodNativeEnum<
typeof PutFirewallConfigLogHeaders2
> = z.nativeEnum(PutFirewallConfigLogHeaders2);
/** @internal */
export const PutFirewallConfigSecurityLogHeaders$inboundSchema: z.ZodType<
PutFirewallConfigSecurityLogHeaders,
z.ZodTypeDef,
unknown
> = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeaders2$inboundSchema,
]);
export function putFirewallConfigSecurityLogHeadersFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigSecurityLogHeaders, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutFirewallConfigSecurityLogHeaders$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigSecurityLogHeaders' from JSON`,
);
}
/** @internal */
export const Active$inboundSchema: z.ZodType<Active, z.ZodTypeDef, unknown> = z
.object({
ownerId: types.string(),
projectKey: types.string(),
id: types.string(),
version: types.number(),
updatedAt: types.string(),
firewallEnabled: types.boolean(),
crs: z.lazy(() => PutFirewallConfigCrs$inboundSchema),
rules: z.array(
smartUnion([
z.lazy(() => PutFirewallConfigRules1$inboundSchema),
z.lazy(() => PutFirewallConfigRules2$inboundSchema),
]),
),
ips: z.array(z.lazy(() => PutFirewallConfigIps$inboundSchema)),
changes: z.array(z.lazy(() => PutFirewallConfigChanges$inboundSchema)),
managedRules: types.optional(
z.lazy(() => PutFirewallConfigManagedRules$inboundSchema),
),
botIdEnabled: types.optional(types.boolean()),
logHeaders: types.optional(
smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeaders2$inboundSchema,
]),
),
});
export function activeFromJSON(
jsonString: string,
): SafeParseResult<Active, SDKValidationError> {
return safeParse(
jsonString,
(x) => Active$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'Active' from JSON`,
);
}
/** @internal */
export const PutFirewallConfigResponseBody$inboundSchema: z.ZodType<
PutFirewallConfigResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
active: z.lazy(() => Active$inboundSchema),
});
export function putFirewallConfigResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<PutFirewallConfigResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutFirewallConfigResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutFirewallConfigResponseBody' from JSON`,
);
}