"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.CompanyInfo$inboundSchema = exports.TrackingCategoriesMode$inboundSchema = exports.TheStartMonthOfFiscalYear$inboundSchema = exports.CompanyStatus$inboundSchema = exports.TrackingCategoriesMode = exports.TheStartMonthOfFiscalYear = exports.CompanyStatus = void 0;
exports.companyInfoFromJSON = companyInfoFromJSON;
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 currency_js_1 = require("./currency.js");
const email_js_1 = require("./email.js");
const phonenumber_js_1 = require("./phonenumber.js");
const taxrate_js_1 = require("./taxrate.js");
/**
 * Based on the status some functionality is enabled or disabled.
 */
exports.CompanyStatus = {
    Active: "active",
    Inactive: "inactive",
};
/**
 * The start month of fiscal year.
 */
exports.TheStartMonthOfFiscalYear = {
    January: "January",
    February: "February",
    March: "March",
    April: "April",
    May: "May",
    June: "June",
    July: "July",
    August: "August",
    September: "September",
    October: "October",
    November: "November",
    December: "December",
};
/**
 * The mode of tracking categories for the company on transactions
 */
exports.TrackingCategoriesMode = {
    Transaction: "transaction",
    Line: "line",
    Both: "both",
    Disabled: "disabled",
};
/** @internal */
exports.CompanyStatus$inboundSchema = z.nativeEnum(exports.CompanyStatus);
/** @internal */
exports.TheStartMonthOfFiscalYear$inboundSchema = z.nativeEnum(exports.TheStartMonthOfFiscalYear);
/** @internal */
exports.TrackingCategoriesMode$inboundSchema = z.nativeEnum(exports.TrackingCategoriesMode);
/** @internal */
exports.CompanyInfo$inboundSchema = z.object({
    id: z.string().optional(),
    company_name: z.nullable(z.string()).optional(),
    status: exports.CompanyStatus$inboundSchema.optional(),
    legal_name: z.string().optional(),
    country: z.nullable(z.string()).optional(),
    sales_tax_number: z.nullable(z.string()).optional(),
    automated_sales_tax: z.boolean().optional(),
    sales_tax_enabled: z.boolean().optional(),
    default_sales_tax: taxrate_js_1.TaxRate$inboundSchema.optional(),
    currency: z.nullable(currency_js_1.Currency$inboundSchema).optional(),
    language: z.nullable(z.string()).optional(),
    fiscal_year_start_month: exports.TheStartMonthOfFiscalYear$inboundSchema.optional(),
    company_start_date: z.string().transform(v => new rfcdate_js_1.RFCDate(v)).optional(),
    addresses: z.array(address_js_1.Address$inboundSchema).optional(),
    phone_numbers: z.array(phonenumber_js_1.PhoneNumber$inboundSchema).optional(),
    emails: z.array(email_js_1.Email$inboundSchema).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    tracking_categories_enabled: z.boolean().optional(),
    tracking_categories_mode: exports.TrackingCategoriesMode$inboundSchema.optional(),
    row_version: z.nullable(z.string()).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(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "company_name": "companyName",
        "legal_name": "legalName",
        "sales_tax_number": "salesTaxNumber",
        "automated_sales_tax": "automatedSalesTax",
        "sales_tax_enabled": "salesTaxEnabled",
        "default_sales_tax": "defaultSalesTax",
        "fiscal_year_start_month": "fiscalYearStartMonth",
        "company_start_date": "companyStartDate",
        "phone_numbers": "phoneNumbers",
        "custom_mappings": "customMappings",
        "tracking_categories_enabled": "trackingCategoriesEnabled",
        "tracking_categories_mode": "trackingCategoriesMode",
        "row_version": "rowVersion",
        "updated_by": "updatedBy",
        "created_by": "createdBy",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
    });
});
function companyInfoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompanyInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyInfo' from JSON`);
}
//# sourceMappingURL=companyinfo.js.map