aiconfigsaccessallowedrep.ts•2.42 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
AiConfigsAccessAllowedReason,
AiConfigsAccessAllowedReason$inboundSchema,
AiConfigsAccessAllowedReason$Outbound,
AiConfigsAccessAllowedReason$outboundSchema,
} from "./aiconfigsaccessallowedreason.js";
export type AiConfigsAccessAllowedRep = {
action: string;
reason: AiConfigsAccessAllowedReason;
};
/** @internal */
export const AiConfigsAccessAllowedRep$inboundSchema: z.ZodType<
AiConfigsAccessAllowedRep,
z.ZodTypeDef,
unknown
> = z.object({
action: z.string(),
reason: AiConfigsAccessAllowedReason$inboundSchema,
});
/** @internal */
export type AiConfigsAccessAllowedRep$Outbound = {
action: string;
reason: AiConfigsAccessAllowedReason$Outbound;
};
/** @internal */
export const AiConfigsAccessAllowedRep$outboundSchema: z.ZodType<
AiConfigsAccessAllowedRep$Outbound,
z.ZodTypeDef,
AiConfigsAccessAllowedRep
> = z.object({
action: z.string(),
reason: AiConfigsAccessAllowedReason$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace AiConfigsAccessAllowedRep$ {
/** @deprecated use `AiConfigsAccessAllowedRep$inboundSchema` instead. */
export const inboundSchema = AiConfigsAccessAllowedRep$inboundSchema;
/** @deprecated use `AiConfigsAccessAllowedRep$outboundSchema` instead. */
export const outboundSchema = AiConfigsAccessAllowedRep$outboundSchema;
/** @deprecated use `AiConfigsAccessAllowedRep$Outbound` instead. */
export type Outbound = AiConfigsAccessAllowedRep$Outbound;
}
export function aiConfigsAccessAllowedRepToJSON(
aiConfigsAccessAllowedRep: AiConfigsAccessAllowedRep,
): string {
return JSON.stringify(
AiConfigsAccessAllowedRep$outboundSchema.parse(aiConfigsAccessAllowedRep),
);
}
export function aiConfigsAccessAllowedRepFromJSON(
jsonString: string,
): SafeParseResult<AiConfigsAccessAllowedRep, SDKValidationError> {
return safeParse(
jsonString,
(x) => AiConfigsAccessAllowedRep$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AiConfigsAccessAllowedRep' from JSON`,
);
}