/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListComputeSecretsRequest = { cursor?: string | undefined; limit?: number | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type ListComputeSecretsResponse = | components.ComputeSecretList | components.ComputeErrorEnvelope; /** @internal */ export const ListComputeSecretsRequest$inboundSchema: z.ZodType< ListComputeSecretsRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.string().optional(), limit: z.number().int().default(50), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListComputeSecretsRequest$Outbound = { cursor?: string | undefined; limit: number; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListComputeSecretsRequest$outboundSchema: z.ZodType< ListComputeSecretsRequest$Outbound, z.ZodTypeDef, ListComputeSecretsRequest > = z.object({ cursor: z.string().optional(), limit: z.number().int().default(50), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listComputeSecretsRequestToJSON( listComputeSecretsRequest: ListComputeSecretsRequest, ): string { return JSON.stringify( ListComputeSecretsRequest$outboundSchema.parse(listComputeSecretsRequest), ); } export function listComputeSecretsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListComputeSecretsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListComputeSecretsRequest' from JSON`, ); } /** @internal */ export const ListComputeSecretsResponse$inboundSchema: z.ZodType< ListComputeSecretsResponse, z.ZodTypeDef, unknown > = z.union([ components.ComputeSecretList$inboundSchema, components.ComputeErrorEnvelope$inboundSchema, ]); /** @internal */ export type ListComputeSecretsResponse$Outbound = | components.ComputeSecretList$Outbound | components.ComputeErrorEnvelope$Outbound; /** @internal */ export const ListComputeSecretsResponse$outboundSchema: z.ZodType< ListComputeSecretsResponse$Outbound, z.ZodTypeDef, ListComputeSecretsResponse > = z.union([ components.ComputeSecretList$outboundSchema, components.ComputeErrorEnvelope$outboundSchema, ]); export function listComputeSecretsResponseToJSON( listComputeSecretsResponse: ListComputeSecretsResponse, ): string { return JSON.stringify( ListComputeSecretsResponse$outboundSchema.parse(listComputeSecretsResponse), ); } export function listComputeSecretsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListComputeSecretsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListComputeSecretsResponse' from JSON`, ); }