/* * 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 DeleteServiceAccountRequest = { orgId: string; saId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** * OK */ export type DeleteServiceAccountResponseBody = { id: string; deleted: boolean; }; /** @internal */ export const DeleteServiceAccountRequest$inboundSchema: z.ZodType< DeleteServiceAccountRequest, z.ZodTypeDef, unknown > = z.object({ orgId: z.string(), saId: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type DeleteServiceAccountRequest$Outbound = { orgId: string; saId: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const DeleteServiceAccountRequest$outboundSchema: z.ZodType< DeleteServiceAccountRequest$Outbound, z.ZodTypeDef, DeleteServiceAccountRequest > = z.object({ orgId: z.string(), saId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function deleteServiceAccountRequestToJSON( deleteServiceAccountRequest: DeleteServiceAccountRequest, ): string { return JSON.stringify( DeleteServiceAccountRequest$outboundSchema.parse( deleteServiceAccountRequest, ), ); } export function deleteServiceAccountRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteServiceAccountRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteServiceAccountRequest' from JSON`, ); } /** @internal */ export const DeleteServiceAccountResponseBody$inboundSchema: z.ZodType< DeleteServiceAccountResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), deleted: z.boolean(), }); /** @internal */ export type DeleteServiceAccountResponseBody$Outbound = { id: string; deleted: boolean; }; /** @internal */ export const DeleteServiceAccountResponseBody$outboundSchema: z.ZodType< DeleteServiceAccountResponseBody$Outbound, z.ZodTypeDef, DeleteServiceAccountResponseBody > = z.object({ id: z.string(), deleted: z.boolean(), }); export function deleteServiceAccountResponseBodyToJSON( deleteServiceAccountResponseBody: DeleteServiceAccountResponseBody, ): string { return JSON.stringify( DeleteServiceAccountResponseBody$outboundSchema.parse( deleteServiceAccountResponseBody, ), ); } export function deleteServiceAccountResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteServiceAccountResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteServiceAccountResponseBody' from JSON`, ); }