/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const DeleteExternalUserBudgetQueryParamOwner = { Cluster: "cluster", Org: "org", } as const; export type DeleteExternalUserBudgetQueryParamOwner = ClosedEnum< typeof DeleteExternalUserBudgetQueryParamOwner >; export type DeleteExternalUserBudgetRequest = { id: string; owner: DeleteExternalUserBudgetQueryParamOwner; orgId?: string | undefined; }; export const DeleteExternalUserBudgetScope = { Org: "org", Apikey: "apikey", User: "user", Team: "team", ExternalUser: "external_user", UserDefault: "user_default", TeamDefault: "team_default", ExternalUserDefault: "external_user_default", } as const; export type DeleteExternalUserBudgetScope = ClosedEnum< typeof DeleteExternalUserBudgetScope >; export const DeleteExternalUserBudgetOwner = { Cluster: "cluster", Org: "org", } as const; export type DeleteExternalUserBudgetOwner = ClosedEnum< typeof DeleteExternalUserBudgetOwner >; /** * OK */ export type DeleteExternalUserBudgetResponseBody = { scope: DeleteExternalUserBudgetScope; scopeId: string; owner: DeleteExternalUserBudgetOwner; deleted: true; }; /** @internal */ export const DeleteExternalUserBudgetQueryParamOwner$inboundSchema: z.ZodNativeEnum = z .nativeEnum(DeleteExternalUserBudgetQueryParamOwner); /** @internal */ export const DeleteExternalUserBudgetQueryParamOwner$outboundSchema: z.ZodNativeEnum = DeleteExternalUserBudgetQueryParamOwner$inboundSchema; /** @internal */ export const DeleteExternalUserBudgetRequest$inboundSchema: z.ZodType< DeleteExternalUserBudgetRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), owner: DeleteExternalUserBudgetQueryParamOwner$inboundSchema, org_id: z.string().optional(), }).transform((v) => { return remap$(v, { "org_id": "orgId", }); }); /** @internal */ export type DeleteExternalUserBudgetRequest$Outbound = { id: string; owner: string; org_id?: string | undefined; }; /** @internal */ export const DeleteExternalUserBudgetRequest$outboundSchema: z.ZodType< DeleteExternalUserBudgetRequest$Outbound, z.ZodTypeDef, DeleteExternalUserBudgetRequest > = z.object({ id: z.string(), owner: DeleteExternalUserBudgetQueryParamOwner$outboundSchema, orgId: z.string().optional(), }).transform((v) => { return remap$(v, { orgId: "org_id", }); }); export function deleteExternalUserBudgetRequestToJSON( deleteExternalUserBudgetRequest: DeleteExternalUserBudgetRequest, ): string { return JSON.stringify( DeleteExternalUserBudgetRequest$outboundSchema.parse( deleteExternalUserBudgetRequest, ), ); } export function deleteExternalUserBudgetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteExternalUserBudgetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteExternalUserBudgetRequest' from JSON`, ); } /** @internal */ export const DeleteExternalUserBudgetScope$inboundSchema: z.ZodNativeEnum< typeof DeleteExternalUserBudgetScope > = z.nativeEnum(DeleteExternalUserBudgetScope); /** @internal */ export const DeleteExternalUserBudgetScope$outboundSchema: z.ZodNativeEnum< typeof DeleteExternalUserBudgetScope > = DeleteExternalUserBudgetScope$inboundSchema; /** @internal */ export const DeleteExternalUserBudgetOwner$inboundSchema: z.ZodNativeEnum< typeof DeleteExternalUserBudgetOwner > = z.nativeEnum(DeleteExternalUserBudgetOwner); /** @internal */ export const DeleteExternalUserBudgetOwner$outboundSchema: z.ZodNativeEnum< typeof DeleteExternalUserBudgetOwner > = DeleteExternalUserBudgetOwner$inboundSchema; /** @internal */ export const DeleteExternalUserBudgetResponseBody$inboundSchema: z.ZodType< DeleteExternalUserBudgetResponseBody, z.ZodTypeDef, unknown > = z.object({ scope: DeleteExternalUserBudgetScope$inboundSchema, scope_id: z.string(), owner: DeleteExternalUserBudgetOwner$inboundSchema, deleted: z.literal(true), }).transform((v) => { return remap$(v, { "scope_id": "scopeId", }); }); /** @internal */ export type DeleteExternalUserBudgetResponseBody$Outbound = { scope: string; scope_id: string; owner: string; deleted: true; }; /** @internal */ export const DeleteExternalUserBudgetResponseBody$outboundSchema: z.ZodType< DeleteExternalUserBudgetResponseBody$Outbound, z.ZodTypeDef, DeleteExternalUserBudgetResponseBody > = z.object({ scope: DeleteExternalUserBudgetScope$outboundSchema, scopeId: z.string(), owner: DeleteExternalUserBudgetOwner$outboundSchema, deleted: z.literal(true), }).transform((v) => { return remap$(v, { scopeId: "scope_id", }); }); export function deleteExternalUserBudgetResponseBodyToJSON( deleteExternalUserBudgetResponseBody: DeleteExternalUserBudgetResponseBody, ): string { return JSON.stringify( DeleteExternalUserBudgetResponseBody$outboundSchema.parse( deleteExternalUserBudgetResponseBody, ), ); } export function deleteExternalUserBudgetResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteExternalUserBudgetResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteExternalUserBudgetResponseBody' from JSON`, ); }