"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Org$ = exports.Org$outboundSchema = exports.Org$inboundSchema = exports.Child$ = exports.Child$outboundSchema = exports.Child$inboundSchema = exports.OrgParent$ = exports.OrgParent$outboundSchema = exports.OrgParent$inboundSchema = exports.OrgType1$ = exports.OrgType1$outboundSchema = exports.OrgType1$inboundSchema = exports.OrgStatus$ = exports.OrgStatus$outboundSchema = exports.OrgStatus$inboundSchema = exports.OrgType1 = exports.OrgStatus = void 0;
exports.orgParentToJSON = orgParentToJSON;
exports.orgParentFromJSON = orgParentFromJSON;
exports.childToJSON = childToJSON;
exports.childFromJSON = childFromJSON;
exports.orgToJSON = orgToJSON;
exports.orgFromJSON = orgFromJSON;
const z = __importStar(require("zod"));
const schemas_js_1 = require("../../lib/schemas.js");
exports.OrgStatus = {
    Active: "active",
    Tobedeleted: "tobedeleted",
};
exports.OrgType1 = {
    Department: "department",
    School: "school",
    District: "district",
    Local: "local",
    State: "state",
    National: "national",
};
/** @internal */
exports.OrgStatus$inboundSchema = z
    .nativeEnum(exports.OrgStatus);
/** @internal */
exports.OrgStatus$outboundSchema = exports.OrgStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OrgStatus$;
(function (OrgStatus$) {
    /** @deprecated use `OrgStatus$inboundSchema` instead. */
    OrgStatus$.inboundSchema = exports.OrgStatus$inboundSchema;
    /** @deprecated use `OrgStatus$outboundSchema` instead. */
    OrgStatus$.outboundSchema = exports.OrgStatus$outboundSchema;
})(OrgStatus$ || (exports.OrgStatus$ = OrgStatus$ = {}));
/** @internal */
exports.OrgType1$inboundSchema = z
    .nativeEnum(exports.OrgType1);
/** @internal */
exports.OrgType1$outboundSchema = exports.OrgType1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OrgType1$;
(function (OrgType1$) {
    /** @deprecated use `OrgType1$inboundSchema` instead. */
    OrgType1$.inboundSchema = exports.OrgType1$inboundSchema;
    /** @deprecated use `OrgType1$outboundSchema` instead. */
    OrgType1$.outboundSchema = exports.OrgType1$outboundSchema;
})(OrgType1$ || (exports.OrgType1$ = OrgType1$ = {}));
/** @internal */
exports.OrgParent$inboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.OrgParent$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var OrgParent$;
(function (OrgParent$) {
    /** @deprecated use `OrgParent$inboundSchema` instead. */
    OrgParent$.inboundSchema = exports.OrgParent$inboundSchema;
    /** @deprecated use `OrgParent$outboundSchema` instead. */
    OrgParent$.outboundSchema = exports.OrgParent$outboundSchema;
})(OrgParent$ || (exports.OrgParent$ = OrgParent$ = {}));
function orgParentToJSON(orgParent) {
    return JSON.stringify(exports.OrgParent$outboundSchema.parse(orgParent));
}
function orgParentFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OrgParent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrgParent' from JSON`);
}
/** @internal */
exports.Child$inboundSchema = z
    .object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/** @internal */
exports.Child$outboundSchema = z.object({
    href: z.string(),
    sourcedId: z.string(),
    type: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Child$;
(function (Child$) {
    /** @deprecated use `Child$inboundSchema` instead. */
    Child$.inboundSchema = exports.Child$inboundSchema;
    /** @deprecated use `Child$outboundSchema` instead. */
    Child$.outboundSchema = exports.Child$outboundSchema;
})(Child$ || (exports.Child$ = Child$ = {}));
function childToJSON(child) {
    return JSON.stringify(exports.Child$outboundSchema.parse(child));
}
function childFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Child$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Child' from JSON`);
}
/** @internal */
exports.Org$inboundSchema = z
    .object({
    sourcedId: z.string(),
    status: exports.OrgStatus$inboundSchema,
    dateLastModified: z.string().datetime({ offset: true }).transform(v => new Date(v)).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    name: z.string(),
    type: exports.OrgType1$inboundSchema,
    identifier: z.string(),
    parent: z.nullable(z.lazy(() => exports.OrgParent$inboundSchema)),
    children: z.array(z.lazy(() => exports.Child$inboundSchema)),
});
/** @internal */
exports.Org$outboundSchema = z
    .object({
    sourcedId: z.string(),
    status: exports.OrgStatus$outboundSchema,
    dateLastModified: z.date().transform(v => v.toISOString()).optional(),
    metadata: z.nullable(z.record(z.any())).optional(),
    name: z.string(),
    type: exports.OrgType1$outboundSchema,
    identifier: z.string(),
    parent: z.nullable(z.lazy(() => exports.OrgParent$outboundSchema)),
    children: z.array(z.lazy(() => exports.Child$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Org$;
(function (Org$) {
    /** @deprecated use `Org$inboundSchema` instead. */
    Org$.inboundSchema = exports.Org$inboundSchema;
    /** @deprecated use `Org$outboundSchema` instead. */
    Org$.outboundSchema = exports.Org$outboundSchema;
})(Org$ || (exports.Org$ = Org$ = {}));
function orgToJSON(org) {
    return JSON.stringify(exports.Org$outboundSchema.parse(org));
}
function orgFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Org$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Org' from JSON`);
}
//# sourceMappingURL=org.js.map