UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

92 lines (83 loc) 2.9 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Deletes an existing override. */ export type V2RatelimitDeleteOverrideRequestBody = { /** * The id of the namespace. Either namespaceId or namespaceName must be provided */ namespaceId?: string | undefined; /** * The name of the namespace. Either namespaceId or namespaceName must be provided */ namespaceName?: string | undefined; /** * Identifier of the override to delete */ identifier: string; }; /** @internal */ export const V2RatelimitDeleteOverrideRequestBody$inboundSchema: z.ZodType< V2RatelimitDeleteOverrideRequestBody, z.ZodTypeDef, unknown > = z.object({ namespaceId: z.string().optional(), namespaceName: z.string().optional(), identifier: z.string(), }); /** @internal */ export type V2RatelimitDeleteOverrideRequestBody$Outbound = { namespaceId?: string | undefined; namespaceName?: string | undefined; identifier: string; }; /** @internal */ export const V2RatelimitDeleteOverrideRequestBody$outboundSchema: z.ZodType< V2RatelimitDeleteOverrideRequestBody$Outbound, z.ZodTypeDef, V2RatelimitDeleteOverrideRequestBody > = z.object({ namespaceId: z.string().optional(), namespaceName: z.string().optional(), identifier: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V2RatelimitDeleteOverrideRequestBody$ { /** @deprecated use `V2RatelimitDeleteOverrideRequestBody$inboundSchema` instead. */ export const inboundSchema = V2RatelimitDeleteOverrideRequestBody$inboundSchema; /** @deprecated use `V2RatelimitDeleteOverrideRequestBody$outboundSchema` instead. */ export const outboundSchema = V2RatelimitDeleteOverrideRequestBody$outboundSchema; /** @deprecated use `V2RatelimitDeleteOverrideRequestBody$Outbound` instead. */ export type Outbound = V2RatelimitDeleteOverrideRequestBody$Outbound; } export function v2RatelimitDeleteOverrideRequestBodyToJSON( v2RatelimitDeleteOverrideRequestBody: V2RatelimitDeleteOverrideRequestBody, ): string { return JSON.stringify( V2RatelimitDeleteOverrideRequestBody$outboundSchema.parse( v2RatelimitDeleteOverrideRequestBody, ), ); } export function v2RatelimitDeleteOverrideRequestBodyFromJSON( jsonString: string, ): SafeParseResult<V2RatelimitDeleteOverrideRequestBody, SDKValidationError> { return safeParse( jsonString, (x) => V2RatelimitDeleteOverrideRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V2RatelimitDeleteOverrideRequestBody' from JSON`, ); }