"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.Company1Input$outboundSchema = exports.Company1$inboundSchema = exports.CompanyRowType$outboundSchema = exports.CompanyRowType$inboundSchema = void 0;
exports.companyRowTypeToJSON = companyRowTypeToJSON;
exports.companyRowTypeFromJSON = companyRowTypeFromJSON;
exports.company1FromJSON = company1FromJSON;
exports.company1InputToJSON = company1InputToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const rfcdate_js_1 = require("../../types/rfcdate.js");
const address_js_1 = require("./address.js");
const bankaccount1_js_1 = require("./bankaccount1.js");
const currency_js_1 = require("./currency.js");
const customfield_js_1 = require("./customfield.js");
const email_js_1 = require("./email.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
const phonenumber_js_1 = require("./phonenumber.js");
const sociallink_js_1 = require("./sociallink.js");
const website_js_1 = require("./website.js");
/** @internal */
exports.CompanyRowType$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
});
/** @internal */
exports.CompanyRowType$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
});
function companyRowTypeToJSON(companyRowType) {
    return JSON.stringify(exports.CompanyRowType$outboundSchema.parse(companyRowType));
}
function companyRowTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompanyRowType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyRowType' from JSON`);
}
/** @internal */
exports.Company1$inboundSchema = z.object({
    id: z.string().optional(),
    name: z.nullable(z.string()),
    interaction_count: z.nullable(z.number().int()).optional(),
    owner_id: z.nullable(z.string()).optional(),
    image: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    vat_number: z.nullable(z.string()).optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    status: z.nullable(z.string()).optional(),
    fax: z.nullable(z.string()).optional(),
    annual_revenue: z.nullable(z.string()).optional(),
    number_of_employees: z.nullable(z.string()).optional(),
    industry: z.nullable(z.string()).optional(),
    ownership: z.nullable(z.string()).optional(),
    sales_tax_number: z.nullable(z.string()).optional(),
    payee_number: z.nullable(z.string()).optional(),
    abn_or_tfn: z.nullable(z.string()).optional(),
    abn_branch: z.nullable(z.string()).optional(),
    acn: z.nullable(z.string()).optional(),
    first_name: z.nullable(z.string()).optional(),
    last_name: z.nullable(z.string()).optional(),
    parent_id: z.nullable(z.string()).optional(),
    bank_accounts: z.array(bankaccount1_js_1.BankAccount1$inboundSchema).optional(),
    websites: z.array(website_js_1.Website$inboundSchema).optional(),
    addresses: z.array(address_js_1.Address$inboundSchema).optional(),
    social_links: z.array(sociallink_js_1.SocialLink$inboundSchema).optional(),
    phone_numbers: z.array(phonenumber_js_1.PhoneNumber$inboundSchema).optional(),
    emails: z.array(email_js_1.Email$inboundSchema).optional(),
    row_type: z.lazy(() => exports.CompanyRowType$inboundSchema).optional(),
    custom_fields: z.array(customfield_js_1.CustomField$inboundSchema).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    read_only: z.nullable(z.boolean()).optional(),
    last_activity_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    deleted: z.boolean().optional(),
    salutation: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.string().transform(v => new rfcdate_js_1.RFCDate(v))).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    updated_by: z.nullable(z.string()).optional(),
    created_by: z.nullable(z.string()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    pass_through: z.array(passthroughbody_js_1.PassThroughBody$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "interaction_count": "interactionCount",
        "owner_id": "ownerId",
        "vat_number": "vatNumber",
        "annual_revenue": "annualRevenue",
        "number_of_employees": "numberOfEmployees",
        "sales_tax_number": "salesTaxNumber",
        "payee_number": "payeeNumber",
        "abn_or_tfn": "abnOrTfn",
        "abn_branch": "abnBranch",
        "first_name": "firstName",
        "last_name": "lastName",
        "parent_id": "parentId",
        "bank_accounts": "bankAccounts",
        "social_links": "socialLinks",
        "phone_numbers": "phoneNumbers",
        "row_type": "rowType",
        "custom_fields": "customFields",
        "read_only": "readOnly",
        "last_activity_at": "lastActivityAt",
        "custom_mappings": "customMappings",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "pass_through": "passThrough",
    });
});
function company1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Company1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Company1' from JSON`);
}
/** @internal */
exports.Company1Input$outboundSchema = z.object({
    name: z.nullable(z.string()),
    ownerId: z.nullable(z.string()).optional(),
    image: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    vatNumber: z.nullable(z.string()).optional(),
    currency: z.nullable(currency_js_1.Currency$outboundSchema).optional(),
    status: z.nullable(z.string()).optional(),
    fax: z.nullable(z.string()).optional(),
    annualRevenue: z.nullable(z.string()).optional(),
    numberOfEmployees: z.nullable(z.string()).optional(),
    industry: z.nullable(z.string()).optional(),
    ownership: z.nullable(z.string()).optional(),
    salesTaxNumber: z.nullable(z.string()).optional(),
    payeeNumber: z.nullable(z.string()).optional(),
    abnOrTfn: z.nullable(z.string()).optional(),
    abnBranch: z.nullable(z.string()).optional(),
    acn: z.nullable(z.string()).optional(),
    firstName: z.nullable(z.string()).optional(),
    lastName: z.nullable(z.string()).optional(),
    bankAccounts: z.array(bankaccount1_js_1.BankAccount1$outboundSchema).optional(),
    websites: z.array(website_js_1.Website$outboundSchema).optional(),
    addresses: z.array(address_js_1.Address$outboundSchema).optional(),
    socialLinks: z.array(sociallink_js_1.SocialLink$outboundSchema).optional(),
    phoneNumbers: z.array(phonenumber_js_1.PhoneNumber$outboundSchema).optional(),
    emails: z.array(email_js_1.Email$outboundSchema).optional(),
    rowType: z.lazy(() => exports.CompanyRowType$outboundSchema).optional(),
    customFields: z.array(customfield_js_1.CustomField$outboundSchema).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    readOnly: z.nullable(z.boolean()).optional(),
    salutation: z.nullable(z.string()).optional(),
    birthday: z.nullable(z.instanceof(rfcdate_js_1.RFCDate).transform(v => v.toString()))
        .optional(),
    passThrough: z.array(passthroughbody_js_1.PassThroughBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        ownerId: "owner_id",
        vatNumber: "vat_number",
        annualRevenue: "annual_revenue",
        numberOfEmployees: "number_of_employees",
        salesTaxNumber: "sales_tax_number",
        payeeNumber: "payee_number",
        abnOrTfn: "abn_or_tfn",
        abnBranch: "abn_branch",
        firstName: "first_name",
        lastName: "last_name",
        bankAccounts: "bank_accounts",
        socialLinks: "social_links",
        phoneNumbers: "phone_numbers",
        rowType: "row_type",
        customFields: "custom_fields",
        readOnly: "read_only",
        passThrough: "pass_through",
    });
});
function company1InputToJSON(company1Input) {
    return JSON.stringify(exports.Company1Input$outboundSchema.parse(company1Input));
}
//# sourceMappingURL=company1.js.map