/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DeleteServiceAccountApiKeyRequest = { orgId: string; saId: string; keyId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** * OK */ export type DeleteServiceAccountApiKeyResponseBody = { id: string; deleted: boolean; }; /** @internal */ export const DeleteServiceAccountApiKeyRequest$inboundSchema: z.ZodType< DeleteServiceAccountApiKeyRequest, z.ZodTypeDef, unknown > = z.object({ orgId: z.string(), saId: z.string(), keyId: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type DeleteServiceAccountApiKeyRequest$Outbound = { orgId: string; saId: string; keyId: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const DeleteServiceAccountApiKeyRequest$outboundSchema: z.ZodType< DeleteServiceAccountApiKeyRequest$Outbound, z.ZodTypeDef, DeleteServiceAccountApiKeyRequest > = z.object({ orgId: z.string(), saId: z.string(), keyId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function deleteServiceAccountApiKeyRequestToJSON( deleteServiceAccountApiKeyRequest: DeleteServiceAccountApiKeyRequest, ): string { return JSON.stringify( DeleteServiceAccountApiKeyRequest$outboundSchema.parse( deleteServiceAccountApiKeyRequest, ), ); } export function deleteServiceAccountApiKeyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteServiceAccountApiKeyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteServiceAccountApiKeyRequest' from JSON`, ); } /** @internal */ export const DeleteServiceAccountApiKeyResponseBody$inboundSchema: z.ZodType< DeleteServiceAccountApiKeyResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), deleted: z.boolean(), }); /** @internal */ export type DeleteServiceAccountApiKeyResponseBody$Outbound = { id: string; deleted: boolean; }; /** @internal */ export const DeleteServiceAccountApiKeyResponseBody$outboundSchema: z.ZodType< DeleteServiceAccountApiKeyResponseBody$Outbound, z.ZodTypeDef, DeleteServiceAccountApiKeyResponseBody > = z.object({ id: z.string(), deleted: z.boolean(), }); export function deleteServiceAccountApiKeyResponseBodyToJSON( deleteServiceAccountApiKeyResponseBody: DeleteServiceAccountApiKeyResponseBody, ): string { return JSON.stringify( DeleteServiceAccountApiKeyResponseBody$outboundSchema.parse( deleteServiceAccountApiKeyResponseBody, ), ); } export function deleteServiceAccountApiKeyResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteServiceAccountApiKeyResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteServiceAccountApiKeyResponseBody' from JSON`, ); }