"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.OcfAddress = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({address_type: exports.OcfAddressType.decoder, country: damlTypes.Text.decoder, city: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), country_subdivision: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), postal_code: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), street_suite: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    address_type: exports.OcfAddressType.encode(__typed__.address_type),
    country: damlTypes.Text.encode(__typed__.country),
    city: damlTypes.Optional(damlTypes.Text).encode(__typed__.city),
    country_subdivision: damlTypes.Optional(damlTypes.Text).encode(__typed__.country_subdivision),
    postal_code: damlTypes.Optional(damlTypes.Text).encode(__typed__.postal_code),
    street_suite: damlTypes.Optional(damlTypes.Text).encode(__typed__.street_suite),
  };
}
,
};



exports.OcfAddressType = {
  OcfAddressTypeLegal: 'OcfAddressTypeLegal',
  OcfAddressTypeContact: 'OcfAddressTypeContact',
  OcfAddressTypeOther: 'OcfAddressTypeOther',
  keys: ['OcfAddressTypeLegal','OcfAddressTypeContact','OcfAddressTypeOther',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfAddressType.OcfAddressTypeLegal), jtv.constant(exports.OcfAddressType.OcfAddressTypeContact), jtv.constant(exports.OcfAddressType.OcfAddressTypeOther)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfTaxID = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({country: damlTypes.Text.decoder, tax_id: damlTypes.Text.decoder, }); }),
  encode: function (__typed__) {
  return {
    country: damlTypes.Text.encode(__typed__.country),
    tax_id: damlTypes.Text.encode(__typed__.tax_id),
  };
}
,
};



exports.OcfMonetary = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({amount: damlTypes.Numeric(10).decoder, currency: damlTypes.Text.decoder, }); }),
  encode: function (__typed__) {
  return {
    amount: damlTypes.Numeric(10).encode(__typed__.amount),
    currency: damlTypes.Text.encode(__typed__.currency),
  };
}
,
};

