/* * 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 QueryParamOwner = { Cluster: "cluster", Org: "org", } as const; export type QueryParamOwner = ClosedEnum; export type DeleteOrgBudgetRequest = { owner: QueryParamOwner; orgId?: string | undefined; }; export const DeleteOrgBudgetScope = { 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 DeleteOrgBudgetScope = ClosedEnum; export const DeleteOrgBudgetOwner = { Cluster: "cluster", Org: "org", } as const; export type DeleteOrgBudgetOwner = ClosedEnum; /** * OK */ export type DeleteOrgBudgetResponseBody = { scope: DeleteOrgBudgetScope; scopeId: string; owner: DeleteOrgBudgetOwner; deleted: true; }; /** @internal */ export const QueryParamOwner$inboundSchema: z.ZodNativeEnum< typeof QueryParamOwner > = z.nativeEnum(QueryParamOwner); /** @internal */ export const QueryParamOwner$outboundSchema: z.ZodNativeEnum< typeof QueryParamOwner > = QueryParamOwner$inboundSchema; /** @internal */ export const DeleteOrgBudgetRequest$inboundSchema: z.ZodType< DeleteOrgBudgetRequest, z.ZodTypeDef, unknown > = z.object({ owner: QueryParamOwner$inboundSchema, org_id: z.string().optional(), }).transform((v) => { return remap$(v, { "org_id": "orgId", }); }); /** @internal */ export type DeleteOrgBudgetRequest$Outbound = { owner: string; org_id?: string | undefined; }; /** @internal */ export const DeleteOrgBudgetRequest$outboundSchema: z.ZodType< DeleteOrgBudgetRequest$Outbound, z.ZodTypeDef, DeleteOrgBudgetRequest > = z.object({ owner: QueryParamOwner$outboundSchema, orgId: z.string().optional(), }).transform((v) => { return remap$(v, { orgId: "org_id", }); }); export function deleteOrgBudgetRequestToJSON( deleteOrgBudgetRequest: DeleteOrgBudgetRequest, ): string { return JSON.stringify( DeleteOrgBudgetRequest$outboundSchema.parse(deleteOrgBudgetRequest), ); } export function deleteOrgBudgetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteOrgBudgetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteOrgBudgetRequest' from JSON`, ); } /** @internal */ export const DeleteOrgBudgetScope$inboundSchema: z.ZodNativeEnum< typeof DeleteOrgBudgetScope > = z.nativeEnum(DeleteOrgBudgetScope); /** @internal */ export const DeleteOrgBudgetScope$outboundSchema: z.ZodNativeEnum< typeof DeleteOrgBudgetScope > = DeleteOrgBudgetScope$inboundSchema; /** @internal */ export const DeleteOrgBudgetOwner$inboundSchema: z.ZodNativeEnum< typeof DeleteOrgBudgetOwner > = z.nativeEnum(DeleteOrgBudgetOwner); /** @internal */ export const DeleteOrgBudgetOwner$outboundSchema: z.ZodNativeEnum< typeof DeleteOrgBudgetOwner > = DeleteOrgBudgetOwner$inboundSchema; /** @internal */ export const DeleteOrgBudgetResponseBody$inboundSchema: z.ZodType< DeleteOrgBudgetResponseBody, z.ZodTypeDef, unknown > = z.object({ scope: DeleteOrgBudgetScope$inboundSchema, scope_id: z.string(), owner: DeleteOrgBudgetOwner$inboundSchema, deleted: z.literal(true), }).transform((v) => { return remap$(v, { "scope_id": "scopeId", }); }); /** @internal */ export type DeleteOrgBudgetResponseBody$Outbound = { scope: string; scope_id: string; owner: string; deleted: true; }; /** @internal */ export const DeleteOrgBudgetResponseBody$outboundSchema: z.ZodType< DeleteOrgBudgetResponseBody$Outbound, z.ZodTypeDef, DeleteOrgBudgetResponseBody > = z.object({ scope: DeleteOrgBudgetScope$outboundSchema, scopeId: z.string(), owner: DeleteOrgBudgetOwner$outboundSchema, deleted: z.literal(true), }).transform((v) => { return remap$(v, { scopeId: "scope_id", }); }); export function deleteOrgBudgetResponseBodyToJSON( deleteOrgBudgetResponseBody: DeleteOrgBudgetResponseBody, ): string { return JSON.stringify( DeleteOrgBudgetResponseBody$outboundSchema.parse( deleteOrgBudgetResponseBody, ), ); } export function deleteOrgBudgetResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteOrgBudgetResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteOrgBudgetResponseBody' from JSON`, ); }