"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');


exports.OcfFileType = {
  OcfManifestFile: 'OcfManifestFile',
  OcfStakeholdersFile: 'OcfStakeholdersFile',
  OcfStockClassesFile: 'OcfStockClassesFile',
  OcfStockLegendTemplatesFile: 'OcfStockLegendTemplatesFile',
  OcfStockPlansFile: 'OcfStockPlansFile',
  OcfTransactionsFile: 'OcfTransactionsFile',
  OcfValuationsFile: 'OcfValuationsFile',
  OcfVestingTermsFile: 'OcfVestingTermsFile',
  OcfFinancingsFile: 'OcfFinancingsFile',
  OcfDocumentsFile: 'OcfDocumentsFile',
  keys: ['OcfManifestFile','OcfStakeholdersFile','OcfStockClassesFile','OcfStockLegendTemplatesFile','OcfStockPlansFile','OcfTransactionsFile','OcfValuationsFile','OcfVestingTermsFile','OcfFinancingsFile','OcfDocumentsFile',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfFileType.OcfManifestFile), jtv.constant(exports.OcfFileType.OcfStakeholdersFile), jtv.constant(exports.OcfFileType.OcfStockClassesFile), jtv.constant(exports.OcfFileType.OcfStockLegendTemplatesFile), jtv.constant(exports.OcfFileType.OcfStockPlansFile), jtv.constant(exports.OcfFileType.OcfTransactionsFile), jtv.constant(exports.OcfFileType.OcfValuationsFile), jtv.constant(exports.OcfFileType.OcfVestingTermsFile), jtv.constant(exports.OcfFileType.OcfFinancingsFile), jtv.constant(exports.OcfFileType.OcfDocumentsFile)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfQuantitySourceType = {
  OcfQuantityHumanEstimated: 'OcfQuantityHumanEstimated',
  OcfQuantityMachineEstimated: 'OcfQuantityMachineEstimated',
  OcfQuantityUnspecified: 'OcfQuantityUnspecified',
  OcfQuantityInstrumentFixed: 'OcfQuantityInstrumentFixed',
  OcfQuantityInstrumentMax: 'OcfQuantityInstrumentMax',
  OcfQuantityInstrumentMin: 'OcfQuantityInstrumentMin',
  keys: ['OcfQuantityHumanEstimated','OcfQuantityMachineEstimated','OcfQuantityUnspecified','OcfQuantityInstrumentFixed','OcfQuantityInstrumentMax','OcfQuantityInstrumentMin',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfQuantitySourceType.OcfQuantityHumanEstimated), jtv.constant(exports.OcfQuantitySourceType.OcfQuantityMachineEstimated), jtv.constant(exports.OcfQuantitySourceType.OcfQuantityUnspecified), jtv.constant(exports.OcfQuantitySourceType.OcfQuantityInstrumentFixed), jtv.constant(exports.OcfQuantitySourceType.OcfQuantityInstrumentMax), jtv.constant(exports.OcfQuantitySourceType.OcfQuantityInstrumentMin)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfInitialSharesAuthorized = {
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.object({tag: jtv.constant('OcfInitialSharesNumeric'), value: damlTypes.Numeric(10).decoder, }), jtv.object({tag: jtv.constant('OcfInitialSharesEnum'), value: exports.OcfAuthorizedShares.decoder, })); }),
  encode: function (__typed__) {
  switch(__typed__.tag) {
    case 'OcfInitialSharesNumeric': return {tag: __typed__.tag, value: damlTypes.Numeric(10).encode(__typed__.value)};
    case 'OcfInitialSharesEnum': return {tag: __typed__.tag, value: exports.OcfAuthorizedShares.encode(__typed__.value)};
    default: throw 'unrecognized type tag: ' + __typed__.tag + ' while serializing a value of type OcfInitialSharesAuthorized';
  }
}
,
};



exports.OcfAuthorizedShares = {
  OcfAuthorizedSharesNotApplicable: 'OcfAuthorizedSharesNotApplicable',
  OcfAuthorizedSharesUnlimited: 'OcfAuthorizedSharesUnlimited',
  keys: ['OcfAuthorizedSharesNotApplicable','OcfAuthorizedSharesUnlimited',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfAuthorizedShares.OcfAuthorizedSharesNotApplicable), jtv.constant(exports.OcfAuthorizedShares.OcfAuthorizedSharesUnlimited)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfShareNumberRange = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({starting_share_number: damlTypes.Numeric(10).decoder, ending_share_number: damlTypes.Numeric(10).decoder, }); }),
  encode: function (__typed__) {
  return {
    starting_share_number: damlTypes.Numeric(10).encode(__typed__.starting_share_number),
    ending_share_number: damlTypes.Numeric(10).encode(__typed__.ending_share_number),
  };
}
,
};



exports.OcfSecurityExemption = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({description: damlTypes.Text.decoder, jurisdiction: damlTypes.Text.decoder, }); }),
  encode: function (__typed__) {
  return {
    description: damlTypes.Text.encode(__typed__.description),
    jurisdiction: damlTypes.Text.encode(__typed__.jurisdiction),
  };
}
,
};



exports.OcfStockParent = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({parent_object_id: damlTypes.Text.decoder, parent_object_type: exports.OcfParentSecurityType.decoder, }); }),
  encode: function (__typed__) {
  return {
    parent_object_id: damlTypes.Text.encode(__typed__.parent_object_id),
    parent_object_type: exports.OcfParentSecurityType.encode(__typed__.parent_object_type),
  };
}
,
};



exports.OcfParentSecurityType = {
  OcfParentStockPlan: 'OcfParentStockPlan',
  OcfParentStock: 'OcfParentStock',
  OcfParentWarrant: 'OcfParentWarrant',
  OcfParentConvertible: 'OcfParentConvertible',
  keys: ['OcfParentStockPlan','OcfParentStock','OcfParentWarrant','OcfParentConvertible',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfParentSecurityType.OcfParentStockPlan), jtv.constant(exports.OcfParentSecurityType.OcfParentStock), jtv.constant(exports.OcfParentSecurityType.OcfParentWarrant), jtv.constant(exports.OcfParentSecurityType.OcfParentConvertible)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfRatio = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({numerator: damlTypes.Numeric(10).decoder, denominator: damlTypes.Numeric(10).decoder, }); }),
  encode: function (__typed__) {
  return {
    numerator: damlTypes.Numeric(10).encode(__typed__.numerator),
    denominator: damlTypes.Numeric(10).encode(__typed__.denominator),
  };
}
,
};



exports.OcfStockClassType = {
  OcfStockClassTypeCommon: 'OcfStockClassTypeCommon',
  OcfStockClassTypePreferred: 'OcfStockClassTypePreferred',
  keys: ['OcfStockClassTypeCommon','OcfStockClassTypePreferred',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfStockClassType.OcfStockClassTypeCommon), jtv.constant(exports.OcfStockClassType.OcfStockClassTypePreferred)); }),
  encode: function (__typed__) { return __typed__; },
};

