/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const LessonPlanTreeComponentStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
export const ResourceStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
export const Role = {
    Primary: "primary",
    Secondary: "secondary",
};
export const Importance = {
    Primary: "primary",
    Secondary: "secondary",
};
/** @internal */
export const LessonPlanTreeComponentStatus$inboundSchema = z.nativeEnum(LessonPlanTreeComponentStatus);
/** @internal */
export const LessonPlanTreeComponentStatus$outboundSchema = LessonPlanTreeComponentStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LessonPlanTreeComponentStatus$;
(function (LessonPlanTreeComponentStatus$) {
    /** @deprecated use `LessonPlanTreeComponentStatus$inboundSchema` instead. */
    LessonPlanTreeComponentStatus$.inboundSchema = LessonPlanTreeComponentStatus$inboundSchema;
    /** @deprecated use `LessonPlanTreeComponentStatus$outboundSchema` instead. */
    LessonPlanTreeComponentStatus$.outboundSchema = LessonPlanTreeComponentStatus$outboundSchema;
})(LessonPlanTreeComponentStatus$ || (LessonPlanTreeComponentStatus$ = {}));
/** @internal */
export const ResourceStatus$inboundSchema = z.nativeEnum(ResourceStatus);
/** @internal */
export const ResourceStatus$outboundSchema = ResourceStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResourceStatus$;
(function (ResourceStatus$) {
    /** @deprecated use `ResourceStatus$inboundSchema` instead. */
    ResourceStatus$.inboundSchema = ResourceStatus$inboundSchema;
    /** @deprecated use `ResourceStatus$outboundSchema` instead. */
    ResourceStatus$.outboundSchema = ResourceStatus$outboundSchema;
})(ResourceStatus$ || (ResourceStatus$ = {}));
/** @internal */
export const Role$inboundSchema = z.nativeEnum(Role);
/** @internal */
export const Role$outboundSchema = Role$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Role$;
(function (Role$) {
    /** @deprecated use `Role$inboundSchema` instead. */
    Role$.inboundSchema = Role$inboundSchema;
    /** @deprecated use `Role$outboundSchema` instead. */
    Role$.outboundSchema = Role$outboundSchema;
})(Role$ || (Role$ = {}));
/** @internal */
export const Importance$inboundSchema = z
    .nativeEnum(Importance);
/** @internal */
export const Importance$outboundSchema = Importance$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Importance$;
(function (Importance$) {
    /** @deprecated use `Importance$inboundSchema` instead. */
    Importance$.inboundSchema = Importance$inboundSchema;
    /** @deprecated use `Importance$outboundSchema` instead. */
    Importance$.outboundSchema = Importance$outboundSchema;
})(Importance$ || (Importance$ = {}));
/** @internal */
export const MetadataDetails$inboundSchema = z.object({
    type: z.string(),
});
/** @internal */
export const MetadataDetails$outboundSchema = z.object({
    type: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var MetadataDetails$;
(function (MetadataDetails$) {
    /** @deprecated use `MetadataDetails$inboundSchema` instead. */
    MetadataDetails$.inboundSchema = MetadataDetails$inboundSchema;
    /** @deprecated use `MetadataDetails$outboundSchema` instead. */
    MetadataDetails$.outboundSchema = MetadataDetails$outboundSchema;
})(MetadataDetails$ || (MetadataDetails$ = {}));
export function metadataDetailsToJSON(metadataDetails) {
    return JSON.stringify(MetadataDetails$outboundSchema.parse(metadataDetails));
}
export function metadataDetailsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => MetadataDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataDetails' from JSON`);
}
/** @internal */
export const Resource$inboundSchema = z.object({
    sourcedId: z.string(),
    status: ResourceStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    roles: z.array(Role$inboundSchema).optional(),
    importance: Importance$inboundSchema.optional(),
    vendorResourceId: z.string(),
    vendorId: z.nullable(z.string()).optional(),
    applicationId: z.nullable(z.string()).optional(),
    metadataDetails: z.lazy(() => MetadataDetails$inboundSchema),
});
/** @internal */
export const Resource$outboundSchema = z.object({
    sourcedId: z.string(),
    status: ResourceStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    title: z.string(),
    roles: z.array(Role$outboundSchema).optional(),
    importance: Importance$outboundSchema.optional(),
    vendorResourceId: z.string(),
    vendorId: z.nullable(z.string()).optional(),
    applicationId: z.nullable(z.string()).optional(),
    metadataDetails: z.lazy(() => MetadataDetails$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Resource$;
(function (Resource$) {
    /** @deprecated use `Resource$inboundSchema` instead. */
    Resource$.inboundSchema = Resource$inboundSchema;
    /** @deprecated use `Resource$outboundSchema` instead. */
    Resource$.outboundSchema = Resource$outboundSchema;
})(Resource$ || (Resource$ = {}));
export function resourceToJSON(resource) {
    return JSON.stringify(Resource$outboundSchema.parse(resource));
}
export function resourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Resource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Resource' from JSON`);
}
/** @internal */
export const LessonPlanTreeComponentComponentResource$inboundSchema = z.object({
    tenantId: z.nullable(z.string()),
    clientAppId: z.nullable(z.string()),
    id: z.string(),
    sortOrder: z.number().optional(),
    metadata: z.record(z.any()).optional(),
    courseComponentSourcedId: z.string(),
    resource: z.lazy(() => Resource$inboundSchema),
});
/** @internal */
export const LessonPlanTreeComponentComponentResource$outboundSchema = z.object({
    tenantId: z.nullable(z.string()),
    clientAppId: z.nullable(z.string()),
    id: z.string(),
    sortOrder: z.number().optional(),
    metadata: z.record(z.any()).optional(),
    courseComponentSourcedId: z.string(),
    resource: z.lazy(() => Resource$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LessonPlanTreeComponentComponentResource$;
(function (LessonPlanTreeComponentComponentResource$) {
    /** @deprecated use `LessonPlanTreeComponentComponentResource$inboundSchema` instead. */
    LessonPlanTreeComponentComponentResource$.inboundSchema = LessonPlanTreeComponentComponentResource$inboundSchema;
    /** @deprecated use `LessonPlanTreeComponentComponentResource$outboundSchema` instead. */
    LessonPlanTreeComponentComponentResource$.outboundSchema = LessonPlanTreeComponentComponentResource$outboundSchema;
})(LessonPlanTreeComponentComponentResource$ || (LessonPlanTreeComponentComponentResource$ = {}));
export function lessonPlanTreeComponentComponentResourceToJSON(lessonPlanTreeComponentComponentResource) {
    return JSON.stringify(LessonPlanTreeComponentComponentResource$outboundSchema.parse(lessonPlanTreeComponentComponentResource));
}
export function lessonPlanTreeComponentComponentResourceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LessonPlanTreeComponentComponentResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LessonPlanTreeComponentComponentResource' from JSON`);
}
/** @internal */
export const LessonPlanTreeComponent$inboundSchema = z.object({
    id: z.string(),
    sourcedId: z.string(),
    status: LessonPlanTreeComponentStatus$inboundSchema,
    title: z.string(),
    sortOrder: z.number().optional(),
    unlockDate: z.string().optional(),
    metadata: z.record(z.any()).optional(),
    prerequisites: z.array(z.string()).optional(),
    prerequisiteCriteria: z.string().optional(),
    componentResources: z.array(z.lazy(() => LessonPlanTreeComponentComponentResource$inboundSchema)).optional(),
    subComponents: z.array(z.lazy(() => LessonPlanTreeComponent$inboundSchema))
        .optional(),
});
/** @internal */
export const LessonPlanTreeComponent$outboundSchema = z.object({
    id: z.string(),
    sourcedId: z.string(),
    status: LessonPlanTreeComponentStatus$outboundSchema,
    title: z.string(),
    sortOrder: z.number().optional(),
    unlockDate: z.string().optional(),
    metadata: z.record(z.any()).optional(),
    prerequisites: z.array(z.string()).optional(),
    prerequisiteCriteria: z.string().optional(),
    componentResources: z.array(z.lazy(() => LessonPlanTreeComponentComponentResource$outboundSchema)).optional(),
    subComponents: z.array(z.lazy(() => LessonPlanTreeComponent$outboundSchema))
        .optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var LessonPlanTreeComponent$;
(function (LessonPlanTreeComponent$) {
    /** @deprecated use `LessonPlanTreeComponent$inboundSchema` instead. */
    LessonPlanTreeComponent$.inboundSchema = LessonPlanTreeComponent$inboundSchema;
    /** @deprecated use `LessonPlanTreeComponent$outboundSchema` instead. */
    LessonPlanTreeComponent$.outboundSchema = LessonPlanTreeComponent$outboundSchema;
})(LessonPlanTreeComponent$ || (LessonPlanTreeComponent$ = {}));
export function lessonPlanTreeComponentToJSON(lessonPlanTreeComponent) {
    return JSON.stringify(LessonPlanTreeComponent$outboundSchema.parse(lessonPlanTreeComponent));
}
export function lessonPlanTreeComponentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => LessonPlanTreeComponent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LessonPlanTreeComponent' from JSON`);
}
//# sourceMappingURL=lessonplantreecomponent.js.map