/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; /** * Resource type */ export const TranslationGroupDtoResourceType = { Workflow: "workflow", Layout: "layout", } as const; /** * Resource type */ export type TranslationGroupDtoResourceType = ClosedEnum< typeof TranslationGroupDtoResourceType >; export type TranslationGroupDto = { /** * Resource identifier (slugified ID) */ resourceId: string; /** * Resource type */ resourceType: TranslationGroupDtoResourceType; /** * Resource name (e.g., workflow name) */ resourceName: string; /** * Array of available locales for this resource */ locales: Array; /** * Locales that are outdated compared to the default locale (only present when there are outdated locales) */ outdatedLocales?: Array | undefined; /** * Creation timestamp */ createdAt: string; /** * Last update timestamp */ updatedAt: string; }; /** @internal */ export const TranslationGroupDtoResourceType$inboundSchema: z.ZodNativeEnum< typeof TranslationGroupDtoResourceType > = z.nativeEnum(TranslationGroupDtoResourceType); /** @internal */ export const TranslationGroupDto$inboundSchema: z.ZodType< TranslationGroupDto, z.ZodTypeDef, unknown > = z.object({ resourceId: z.string(), resourceType: TranslationGroupDtoResourceType$inboundSchema, resourceName: z.string(), locales: z.array(z.string()), outdatedLocales: z.array(z.string()).optional(), createdAt: z.string(), updatedAt: z.string(), }); export function translationGroupDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TranslationGroupDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TranslationGroupDto' from JSON`, ); }