"use strict";
/* eslint-disable-next-line no-unused-vars */
function __export(m) {
/* eslint-disable-next-line no-prototype-builtins */
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable-next-line no-unused-vars */
var jtv = require('@mojotech/json-type-validation');
/* eslint-disable-next-line no-unused-vars */
var damlTypes = require('@daml/types');

var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../../DA/Internal/Template');

var Fairmint_OpenCapTable_Types_Contact = require('../../../../Fairmint/OpenCapTable/Types/Contact/module');
var Fairmint_OpenCapTable_Types_Core = require('../../../../Fairmint/OpenCapTable/Types/Core/module');
var Fairmint_OpenCapTable_Types_Monetary = require('../../../../Fairmint/OpenCapTable/Types/Monetary/module');
var Fairmint_OpenCapTable_Types_Stock = require('../../../../Fairmint/OpenCapTable/Types/Stock/module');


exports.IssuerOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, country_of_formation: damlTypes.Text.decoder, formation_date: damlTypes.Time.decoder, legal_name: damlTypes.Text.decoder, comments: damlTypes.List(damlTypes.Text).decoder, tax_ids: damlTypes.List(Fairmint_OpenCapTable_Types_Monetary.OcfTaxID).decoder, address: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfAddress).decoder), country_subdivision_of_formation: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), country_subdivision_name_of_formation: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), dba: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), email: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Contact.OcfEmail).decoder), initial_shares_authorized: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfInitialSharesAuthorized).decoder), phone: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Contact.OcfPhone).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    country_of_formation: damlTypes.Text.encode(__typed__.country_of_formation),
    formation_date: damlTypes.Time.encode(__typed__.formation_date),
    legal_name: damlTypes.Text.encode(__typed__.legal_name),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    tax_ids: damlTypes.List(Fairmint_OpenCapTable_Types_Monetary.OcfTaxID).encode(__typed__.tax_ids),
    address: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfAddress).encode(__typed__.address),
    country_subdivision_of_formation: damlTypes.Optional(damlTypes.Text).encode(__typed__.country_subdivision_of_formation),
    country_subdivision_name_of_formation: damlTypes.Optional(damlTypes.Text).encode(__typed__.country_subdivision_name_of_formation),
    dba: damlTypes.Optional(damlTypes.Text).encode(__typed__.dba),
    email: damlTypes.Optional(Fairmint_OpenCapTable_Types_Contact.OcfEmail).encode(__typed__.email),
    initial_shares_authorized: damlTypes.Optional(Fairmint_OpenCapTable_Types_Stock.OcfInitialSharesAuthorized).encode(__typed__.initial_shares_authorized),
    phone: damlTypes.Optional(Fairmint_OpenCapTable_Types_Contact.OcfPhone).encode(__typed__.phone),
  };
}
,
};



exports.Issuer = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v34:Fairmint.OpenCapTable.OCF.Issuer:Issuer',
  templateIdWithPackageId: '0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b:Fairmint.OpenCapTable.OCF.Issuer:Issuer',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types_Core.Context.decoder, issuer_data: exports.IssuerOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types_Core.Context.encode(__typed__.context),
    issuer_data: exports.IssuerOcfData.encode(__typed__.issuer_data),
  };
}
,
  Archive: {
    template: function () { return exports.Issuer; },
    choiceName: 'Archive',
    argumentDecoder: damlTypes.lazyMemo(function () { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.decoder; }),
    argumentEncode: function (__typed__) { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.Issuer, ['0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b', '#OpenCapTable-v34']);

