@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>
1,121 lines • 50.7 kB
JavaScript
/*
* 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 * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
export const PutFirewallConfigAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsGenAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsXssAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsSfAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction = {
Deny: "deny",
Log: "log",
};
/**
* [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",
};
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",
};
export const PutFirewallConfigSecurityRequestRequestBodyRulesActionAction = {
Log: "log",
Challenge: "challenge",
Deny: "deny",
Bypass: "bypass",
RateLimit: "rate_limit",
Redirect: "redirect",
};
export const Algo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
};
export const Action1 = {
Log: "log",
Challenge: "challenge",
Deny: "deny",
RateLimit: "rate_limit",
};
export const PutFirewallConfigSecurityRequestRequestBodyIpsAction = {
Deny: "deny",
Challenge: "challenge",
Log: "log",
Bypass: "bypass",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200Action = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction = {
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction = {
Deny: "deny",
Log: "log",
};
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",
};
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",
};
export const PutFirewallConfigRulesSecurityResponse200Action = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
Redirect: "redirect",
};
export const PutFirewallConfigRulesAlgo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
};
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
};
export const PutFirewallConfigLogHeadersSecurity2 = {
Wildcard: "*",
};
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",
};
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",
};
export const PutFirewallConfigRulesSecurityResponseAction = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
Redirect: "redirect",
};
export const PutFirewallConfigRulesSecurityAlgo = {
FixedWindow: "fixed_window",
TokenBucket: "token_bucket",
};
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
RateLimit: "rate_limit",
};
export const PutFirewallConfigLogHeadersSecurityResponse2 = {
Wildcard: "*",
};
export const PutFirewallConfigSecurityResponseAction = {
Bypass: "bypass",
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction = {
Challenge: "challenge",
Deny: "deny",
Log: "log",
};
export const PutFirewallConfigLogHeaders2 = {
Wildcard: "*",
};
/** @internal */
export const ManagedRules$outboundSchema = z.object({});
export function managedRulesToJSON(managedRules) {
return JSON.stringify(ManagedRules$outboundSchema.parse(managedRules));
}
/** @internal */
export const PutFirewallConfigAction$outboundSchema = z.nativeEnum(PutFirewallConfigAction);
/** @internal */
export const Sd$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigAction$outboundSchema,
});
export function sdToJSON(sd) {
return JSON.stringify(Sd$outboundSchema.parse(sd));
}
/** @internal */
export const PutFirewallConfigSecurityAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityAction);
/** @internal */
export const Ma$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityAction$outboundSchema,
});
export function maToJSON(ma) {
return JSON.stringify(Ma$outboundSchema.parse(ma));
}
/** @internal */
export const PutFirewallConfigSecurityRequestAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestAction);
/** @internal */
export const Lfi$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestAction$outboundSchema,
});
export function lfiToJSON(lfi) {
return JSON.stringify(Lfi$outboundSchema.parse(lfi));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyAction$outboundSchema = z
.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyAction);
/** @internal */
export const Rfi$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyAction$outboundSchema,
});
export function rfiToJSON(rfi) {
return JSON.stringify(Rfi$outboundSchema.parse(rfi));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsAction);
/** @internal */
export const Rce$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsAction$outboundSchema,
});
export function rceToJSON(rce) {
return JSON.stringify(Rce$outboundSchema.parse(rce));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction);
/** @internal */
export const Php$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsPhpAction$outboundSchema,
});
export function phpToJSON(php) {
return JSON.stringify(Php$outboundSchema.parse(php));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsGenAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsGenAction);
/** @internal */
export const Gen$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsGenAction$outboundSchema,
});
export function genToJSON(gen) {
return JSON.stringify(Gen$outboundSchema.parse(gen));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsXssAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsXssAction);
/** @internal */
export const Xss$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsXssAction$outboundSchema,
});
export function xssToJSON(xss) {
return JSON.stringify(Xss$outboundSchema.parse(xss));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction);
/** @internal */
export const Sqli$outboundSchema = z.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsSqliAction$outboundSchema,
});
export function sqliToJSON(sqli) {
return JSON.stringify(Sqli$outboundSchema.parse(sqli));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsSfAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsSfAction);
/** @internal */
export const Sf$outboundSchema = z
.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsSfAction$outboundSchema,
});
export function sfToJSON(sf) {
return JSON.stringify(Sf$outboundSchema.parse(sf));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction);
/** @internal */
export const Java$outboundSchema = z.object({
active: z.boolean(),
action: PutFirewallConfigSecurityRequestRequestBodyCrsJavaAction$outboundSchema,
});
export function javaToJSON(java) {
return JSON.stringify(Java$outboundSchema.parse(java));
}
/** @internal */
export const Crs$outboundSchema = 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) {
return JSON.stringify(Crs$outboundSchema.parse(crs));
}
/** @internal */
export const PutFirewallConfigType$outboundSchema = z.nativeEnum(PutFirewallConfigType);
/** @internal */
export const PutFirewallConfigOp$outboundSchema = z.nativeEnum(PutFirewallConfigOp);
/** @internal */
export const PutFirewallConfigValue$outboundSchema = smartUnion([z.string(), z.array(z.string()), z.number()]);
export function putFirewallConfigValueToJSON(putFirewallConfigValue) {
return JSON.stringify(PutFirewallConfigValue$outboundSchema.parse(putFirewallConfigValue));
}
/** @internal */
export const PutFirewallConfigConditions$outboundSchema = 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) {
return JSON.stringify(PutFirewallConfigConditions$outboundSchema.parse(putFirewallConfigConditions));
}
/** @internal */
export const ConditionGroup$outboundSchema = z.object({
conditions: z.array(z.lazy(() => PutFirewallConfigConditions$outboundSchema)),
});
export function conditionGroupToJSON(conditionGroup) {
return JSON.stringify(ConditionGroup$outboundSchema.parse(conditionGroup));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyRulesActionAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyRulesActionAction);
/** @internal */
export const Algo$outboundSchema = z.nativeEnum(Algo);
/** @internal */
export const Action1$outboundSchema = z
.nativeEnum(Action1);
/** @internal */
export const RateLimitAction$outboundSchema = smartUnion([Action1$outboundSchema, z.any()]);
export function rateLimitActionToJSON(rateLimitAction) {
return JSON.stringify(RateLimitAction$outboundSchema.parse(rateLimitAction));
}
/** @internal */
export const RateLimit1$outboundSchema = 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) {
return JSON.stringify(RateLimit1$outboundSchema.parse(rateLimit1));
}
/** @internal */
export const RateLimit$outboundSchema = smartUnion([z.lazy(() => RateLimit1$outboundSchema), z.any()]);
export function rateLimitToJSON(rateLimit) {
return JSON.stringify(RateLimit$outboundSchema.parse(rateLimit));
}
/** @internal */
export const Redirect1$outboundSchema = z.object({
location: z.string(),
permanent: z.boolean(),
});
export function redirect1ToJSON(redirect1) {
return JSON.stringify(Redirect1$outboundSchema.parse(redirect1));
}
/** @internal */
export const PutFirewallConfigRedirect$outboundSchema = smartUnion([z.lazy(() => Redirect1$outboundSchema), z.any()]);
export function putFirewallConfigRedirectToJSON(putFirewallConfigRedirect) {
return JSON.stringify(PutFirewallConfigRedirect$outboundSchema.parse(putFirewallConfigRedirect));
}
/** @internal */
export const LogHeaders$outboundSchema = smartUnion([z.string(), z.array(z.string())]);
export function logHeadersToJSON(logHeaders) {
return JSON.stringify(LogHeaders$outboundSchema.parse(logHeaders));
}
/** @internal */
export const Mitigate$outboundSchema = 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) {
return JSON.stringify(Mitigate$outboundSchema.parse(mitigate));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyRulesAction$outboundSchema = z.object({
mitigate: z.lazy(() => Mitigate$outboundSchema).optional(),
});
export function putFirewallConfigSecurityRequestRequestBodyRulesActionToJSON(putFirewallConfigSecurityRequestRequestBodyRulesAction) {
return JSON.stringify(PutFirewallConfigSecurityRequestRequestBodyRulesAction$outboundSchema.parse(putFirewallConfigSecurityRequestRequestBodyRulesAction));
}
/** @internal */
export const ValidationErrors$outboundSchema = smartUnion([z.array(z.string()), z.string()]);
export function validationErrorsToJSON(validationErrors) {
return JSON.stringify(ValidationErrors$outboundSchema.parse(validationErrors));
}
/** @internal */
export const PutFirewallConfigRules$outboundSchema = 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) {
return JSON.stringify(PutFirewallConfigRules$outboundSchema.parse(putFirewallConfigRules));
}
/** @internal */
export const PutFirewallConfigSecurityRequestRequestBodyIpsAction$outboundSchema = z.nativeEnum(PutFirewallConfigSecurityRequestRequestBodyIpsAction);
/** @internal */
export const Ips$outboundSchema = z
.object({
id: z.string().optional(),
hostname: z.string(),
ip: z.string(),
notes: z.string().optional(),
action: PutFirewallConfigSecurityRequestRequestBodyIpsAction$outboundSchema,
});
export function ipsToJSON(ips) {
return JSON.stringify(Ips$outboundSchema.parse(ips));
}
/** @internal */
export const PutFirewallConfigLogHeaders$outboundSchema = smartUnion([z.string(), z.array(z.string())]);
export function putFirewallConfigLogHeadersToJSON(putFirewallConfigLogHeaders) {
return JSON.stringify(PutFirewallConfigLogHeaders$outboundSchema.parse(putFirewallConfigLogHeaders));
}
/** @internal */
export const PutFirewallConfigRequestBody$outboundSchema = 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) {
return JSON.stringify(PutFirewallConfigRequestBody$outboundSchema.parse(putFirewallConfigRequestBody));
}
/** @internal */
export const PutFirewallConfigRequest$outboundSchema = 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) {
return JSON.stringify(PutFirewallConfigRequest$outboundSchema.parse(putFirewallConfigRequest));
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction);
/** @internal */
export const PutFirewallConfigSd$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSdAction$inboundSchema,
});
export function putFirewallConfigSdFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigSd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigSd' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200Action$inboundSchema = z
.nativeEnum(PutFirewallConfigSecurityResponse200Action);
/** @internal */
export const PutFirewallConfigMa$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200Action$inboundSchema,
});
export function putFirewallConfigMaFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigMa$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigMa' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONAction);
/** @internal */
export const PutFirewallConfigLfi$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONAction$inboundSchema,
});
export function putFirewallConfigLfiFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigLfi$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigLfi' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction);
/** @internal */
export const PutFirewallConfigRfi$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema,
});
export function putFirewallConfigRfiFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRfi$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRfi' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction);
/** @internal */
export const PutFirewallConfigRce$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveAction$inboundSchema,
});
export function putFirewallConfigRceFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRce$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRce' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction);
/** @internal */
export const PutFirewallConfigPhp$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsAction$inboundSchema,
});
export function putFirewallConfigPhpFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigPhp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigPhp' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction);
/** @internal */
export const PutFirewallConfigGen$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsGenAction$inboundSchema,
});
export function putFirewallConfigGenFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigGen$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigGen' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction);
/** @internal */
export const PutFirewallConfigXss$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsXssAction$inboundSchema,
});
export function putFirewallConfigXssFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigXss$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigXss' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction);
/** @internal */
export const PutFirewallConfigSqli$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSqliAction$inboundSchema,
});
export function putFirewallConfigSqliFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigSqli$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigSqli' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction);
/** @internal */
export const PutFirewallConfigSf$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsSfAction$inboundSchema,
});
export function putFirewallConfigSfFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigSf$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigSf' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction);
/** @internal */
export const PutFirewallConfigJava$inboundSchema = z.object({
active: types.boolean(),
action: PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveCrsJavaAction$inboundSchema,
});
export function putFirewallConfigJavaFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigJava$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigJava' from JSON`);
}
/** @internal */
export const PutFirewallConfigCrs$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigCrs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigCrs' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesType$inboundSchema = z.nativeEnum(PutFirewallConfigRulesType);
/** @internal */
export const PutFirewallConfigRulesOp$inboundSchema = z.nativeEnum(PutFirewallConfigRulesOp);
/** @internal */
export const PutFirewallConfigRulesValue$inboundSchema = smartUnion([types.string(), types.number(), z.array(types.string())]);
export function putFirewallConfigRulesValueFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesValue' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesConditions$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesConditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesConditions' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesConditionGroup$inboundSchema = z.object({
conditions: z.array(z.lazy(() => PutFirewallConfigRulesConditions$inboundSchema)),
});
export function putFirewallConfigRulesConditionGroupFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesConditionGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesConditionGroup' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200Action$inboundSchema = z
.nativeEnum(PutFirewallConfigRulesSecurityResponse200Action);
/** @internal */
export const PutFirewallConfigRulesAlgo$inboundSchema = z.nativeEnum(PutFirewallConfigRulesAlgo);
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction$inboundSchema = z.nativeEnum(PutFirewallConfigRulesSecurityResponse200ApplicationJSONResponseBodyAction);
/** @internal */
export const PutFirewallConfigRulesRateLimit$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesRateLimit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesRateLimit' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesRedirect$inboundSchema = z.object({
location: types.string(),
permanent: types.boolean(),
});
export function putFirewallConfigRulesRedirectFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesRedirect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesRedirect' from JSON`);
}
/** @internal */
export const PutFirewallConfigLogHeadersSecurity2$inboundSchema = z.nativeEnum(PutFirewallConfigLogHeadersSecurity2);
/** @internal */
export const PutFirewallConfigRulesLogHeaders$inboundSchema = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurity2$inboundSchema,
]);
export function putFirewallConfigRulesLogHeadersFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesLogHeaders' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesMitigate$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesMitigate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesMitigate' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesAction$inboundSchema = z.object({
mitigate: types.optional(z.lazy(() => PutFirewallConfigRulesMitigate$inboundSchema)),
});
export function putFirewallConfigRulesActionFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesAction' from JSON`);
}
/** @internal */
export const PutFirewallConfigRules2$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRules2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRules2' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityType$inboundSchema = z.nativeEnum(PutFirewallConfigRulesSecurityType);
/** @internal */
export const PutFirewallConfigRulesSecurityOp$inboundSchema = z.nativeEnum(PutFirewallConfigRulesSecurityOp);
/** @internal */
export const PutFirewallConfigRulesSecurityValue$inboundSchema = smartUnion([types.string(), types.number(), z.array(types.string())]);
export function putFirewallConfigRulesSecurityValueFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityValue' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityConditions$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityConditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityConditions' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityConditionGroup$inboundSchema = z.object({
conditions: z.array(z.lazy(() => PutFirewallConfigRulesSecurityConditions$inboundSchema)),
});
export function putFirewallConfigRulesSecurityConditionGroupFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityConditionGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityConditionGroup' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityResponseAction$inboundSchema = z
.nativeEnum(PutFirewallConfigRulesSecurityResponseAction);
/** @internal */
export const PutFirewallConfigRulesSecurityAlgo$inboundSchema = z.nativeEnum(PutFirewallConfigRulesSecurityAlgo);
/** @internal */
export const PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction$inboundSchema = z.nativeEnum(PutFirewallConfigRulesSecurityResponse200ApplicationJSONAction);
/** @internal */
export const PutFirewallConfigRulesSecurityRateLimit$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityRateLimit$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityRateLimit' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityRedirect$inboundSchema = z.object({
location: types.string(),
permanent: types.boolean(),
});
export function putFirewallConfigRulesSecurityRedirectFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityRedirect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityRedirect' from JSON`);
}
/** @internal */
export const PutFirewallConfigLogHeadersSecurityResponse2$inboundSchema = z
.nativeEnum(PutFirewallConfigLogHeadersSecurityResponse2);
/** @internal */
export const PutFirewallConfigRulesSecurityLogHeaders$inboundSchema = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeadersSecurityResponse2$inboundSchema,
]);
export function putFirewallConfigRulesSecurityLogHeadersFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityLogHeaders' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityMitigate$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityMitigate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityMitigate' from JSON`);
}
/** @internal */
export const PutFirewallConfigRulesSecurityAction$inboundSchema = z.object({
mitigate: types.optional(z.lazy(() => PutFirewallConfigRulesSecurityMitigate$inboundSchema)),
});
export function putFirewallConfigRulesSecurityActionFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigRulesSecurityAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRulesSecurityAction' from JSON`);
}
/** @internal */
export const PutFirewallConfigRules1$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigRules1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigRules1' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityRules$inboundSchema = smartUnion([
z.lazy(() => PutFirewallConfigRules1$inboundSchema),
z.lazy(() => PutFirewallConfigRules2$inboundSchema),
]);
export function putFirewallConfigSecurityRulesFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigSecurityRules$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigSecurityRules' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponseAction$inboundSchema = z
.nativeEnum(PutFirewallConfigSecurityResponseAction);
/** @internal */
export const PutFirewallConfigIps$inboundSchema = z.object({
id: types.string(),
hostname: types.string(),
ip: types.string(),
notes: types.optional(types.string()),
action: PutFirewallConfigSecurityResponseAction$inboundSchema,
});
export function putFirewallConfigIpsFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigIps$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigIps' from JSON`);
}
/** @internal */
export const PutFirewallConfigChanges$inboundSchema = z.object({});
export function putFirewallConfigChangesFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigChanges$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigChanges' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAction);
/** @internal */
export const PutFirewallConfigBotProtection$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigBotProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigBotProtection' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesAiBotsAction);
/** @internal */
export const PutFirewallConfigAiBots$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigAiBots$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigAiBots' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesOwaspAction);
/** @internal */
export const PutFirewallConfigOwasp$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigOwasp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigOwasp' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesVercelRulesetAction);
/** @internal */
export const PutFirewallConfigVercelRuleset$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigVercelRuleset$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigVercelRuleset' from JSON`);
}
/** @internal */
export const PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction$inboundSchema = z.nativeEnum(PutFirewallConfigSecurityResponse200ApplicationJSONResponseBodyActiveManagedRulesTrafficSourcesAction);
/** @internal */
export const PutFirewallConfigTrafficSources$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigTrafficSources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigTrafficSources' from JSON`);
}
/** @internal */
export const PutFirewallConfigManagedRules$inboundSchema = 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) {
return safeParse(jsonString, (x) => PutFirewallConfigManagedRules$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigManagedRules' from JSON`);
}
/** @internal */
export const PutFirewallConfigLogHeaders2$inboundSchema = z.nativeEnum(PutFirewallConfigLogHeaders2);
/** @internal */
export const PutFirewallConfigSecurityLogHeaders$inboundSchema = smartUnion([
z.array(types.string()),
PutFirewallConfigLogHeaders2$inboundSchema,
]);
export function putFirewallConfigSecurityLogHeadersFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigSecurityLogHeaders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigSecurityLogHeaders' from JSON`);
}
/** @internal */
export const Active$inboundSchema = 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) {
return safeParse(jsonString, (x) => Active$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Active' from JSON`);
}
/** @internal */
export const PutFirewallConfigResponseBody$inboundSchema = z.object({
active: z.lazy(() => Active$inboundSchema),
});
export function putFirewallConfigResponseBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => PutFirewallConfigResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PutFirewallConfigResponseBody' from JSON`);
}
//# sourceMappingURL=putfirewallconfigop.js.map