"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 pkg3ca1343ab26b453d38c8adb70dca5f1ead8440c42b59b68f070786955cbf9ec1 = require('../../..');
var pkg5aee9b21b8e9a4c4975b5f4c4198e6e6e8469df49e2010820e792f393db870f4 = require('../../../DA/Types');
var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../DA/Internal/Template');

var CantonPayments_PaymentStream_ActivePaymentStream = require('../../../CantonPayments/PaymentStream/ActivePaymentStream/module');
var CantonPayments_PaymentStream_Types_Approvals = require('../../../CantonPayments/PaymentStream/Types/Approvals/module');
var CantonPayments_PaymentStream_Types_LockFundsInput = require('../../../CantonPayments/PaymentStream/Types/LockFundsInput/module');
var CantonPayments_PaymentStream_Types_PartyRole = require('../../../CantonPayments/PaymentStream/Types/PartyRole/module');
var CantonPayments_PaymentStream_Types_PaymentStreamProposal = require('../../../CantonPayments/PaymentStream/Types/PaymentStreamProposal/module');
var CantonPayments_PaymentStream_Types_PaymentStreamProposalChanges = require('../../../CantonPayments/PaymentStream/Types/PaymentStreamProposalChanges/module');
var CantonPayments_PaymentStream_Types_ProcessorContext = require('../../../CantonPayments/PaymentStream/Types/ProcessorContext/module');


exports.ProposedPaymentStream_ChangeParty = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({partyType: CantonPayments_PaymentStream_Types_PartyRole.PartyRole.decoder, oldParty: damlTypes.Party.decoder, newParty: damlTypes.Party.decoder, }); }),
  encode: function (__typed__) {
  return {
    partyType: CantonPayments_PaymentStream_Types_PartyRole.PartyRole.encode(__typed__.partyType),
    oldParty: damlTypes.Party.encode(__typed__.oldParty),
    newParty: damlTypes.Party.encode(__typed__.newParty),
  };
}
,
};



exports.ProposedPaymentStream_Withdraw = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({actor: damlTypes.Party.decoder, description: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    actor: damlTypes.Party.encode(__typed__.actor),
    description: damlTypes.Optional(damlTypes.Text).encode(__typed__.description),
  };
}
,
};



exports.ProposedPaymentStream_EditPaymentStreamProposal = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({actor: damlTypes.Party.decoder, changes: CantonPayments_PaymentStream_Types_PaymentStreamProposalChanges.PaymentStreamProposalChanges.decoder, description: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), }); }),
  encode: function (__typed__) {
  return {
    actor: damlTypes.Party.encode(__typed__.actor),
    changes: CantonPayments_PaymentStream_Types_PaymentStreamProposalChanges.PaymentStreamProposalChanges.encode(__typed__.changes),
    description: damlTypes.Optional(damlTypes.Text).encode(__typed__.description),
  };
}
,
};



exports.ProposedPaymentStream_StartPaymentStream = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({lockFundsInput: CantonPayments_PaymentStream_Types_LockFundsInput.LockFundsInput.decoder, }); }),
  encode: function (__typed__) {
  return {
    lockFundsInput: CantonPayments_PaymentStream_Types_LockFundsInput.LockFundsInput.encode(__typed__.lockFundsInput),
  };
}
,
};



exports.ProposedPaymentStream_Approve = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({actor: damlTypes.Party.decoder, }); }),
  encode: function (__typed__) {
  return {
    actor: damlTypes.Party.encode(__typed__.actor),
  };
}
,
};



exports.ProposedPaymentStream = damlTypes.assembleTemplate(
{
  templateId: '#CantonPayments:CantonPayments.PaymentStream.ProposedPaymentStream:ProposedPaymentStream',
  templateIdWithPackageId: 'b9b320d4b90b6367688d5eb6134b57c80da1bc8fe99b7b4f923f889da544947d:CantonPayments.PaymentStream.ProposedPaymentStream:ProposedPaymentStream',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({paymentStreamProposal: CantonPayments_PaymentStream_Types_PaymentStreamProposal.PaymentStreamProposal.decoder, processorContext: CantonPayments_PaymentStream_Types_ProcessorContext.ProcessorContext.decoder, approvals: CantonPayments_PaymentStream_Types_Approvals.Approvals.decoder, }); }),
  encode: function (__typed__) {
  return {
    paymentStreamProposal: CantonPayments_PaymentStream_Types_PaymentStreamProposal.PaymentStreamProposal.encode(__typed__.paymentStreamProposal),
    processorContext: CantonPayments_PaymentStream_Types_ProcessorContext.ProcessorContext.encode(__typed__.processorContext),
    approvals: CantonPayments_PaymentStream_Types_Approvals.Approvals.encode(__typed__.approvals),
  };
}
,
  Archive: {
    template: function () { return exports.ProposedPaymentStream; },
    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__); },
  },
  ProposedPaymentStream_ChangeParty: {
    template: function () { return exports.ProposedPaymentStream; },
    choiceName: 'ProposedPaymentStream_ChangeParty',
    argumentDecoder: damlTypes.lazyMemo(function () { return exports.ProposedPaymentStream_ChangeParty.decoder; }),
    argumentEncode: function (__typed__) { return exports.ProposedPaymentStream_ChangeParty.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.ContractId(exports.ProposedPaymentStream).decoder; }),
    resultEncode: function (__typed__) { return damlTypes.ContractId(exports.ProposedPaymentStream).encode(__typed__); },
  },
  ProposedPaymentStream_Approve: {
    template: function () { return exports.ProposedPaymentStream; },
    choiceName: 'ProposedPaymentStream_Approve',
    argumentDecoder: damlTypes.lazyMemo(function () { return exports.ProposedPaymentStream_Approve.decoder; }),
    argumentEncode: function (__typed__) { return exports.ProposedPaymentStream_Approve.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.ContractId(exports.ProposedPaymentStream).decoder; }),
    resultEncode: function (__typed__) { return damlTypes.ContractId(exports.ProposedPaymentStream).encode(__typed__); },
  },
  ProposedPaymentStream_StartPaymentStream: {
    template: function () { return exports.ProposedPaymentStream; },
    choiceName: 'ProposedPaymentStream_StartPaymentStream',
    argumentDecoder: damlTypes.lazyMemo(function () { return exports.ProposedPaymentStream_StartPaymentStream.decoder; }),
    argumentEncode: function (__typed__) { return exports.ProposedPaymentStream_StartPaymentStream.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return pkg5aee9b21b8e9a4c4975b5f4c4198e6e6e8469df49e2010820e792f393db870f4.DA.Types.Tuple2(damlTypes.ContractId(CantonPayments_PaymentStream_ActivePaymentStream.ActivePaymentStream), damlTypes.Optional(damlTypes.ContractId(pkg3ca1343ab26b453d38c8adb70dca5f1ead8440c42b59b68f070786955cbf9ec1.Amulet))).decoder; }),
    resultEncode: function (__typed__) { return pkg5aee9b21b8e9a4c4975b5f4c4198e6e6e8469df49e2010820e792f393db870f4.DA.Types.Tuple2(damlTypes.ContractId(CantonPayments_PaymentStream_ActivePaymentStream.ActivePaymentStream), damlTypes.Optional(damlTypes.ContractId(pkg3ca1343ab26b453d38c8adb70dca5f1ead8440c42b59b68f070786955cbf9ec1.Amulet))).encode(__typed__); },
  },
  ProposedPaymentStream_EditPaymentStreamProposal: {
    template: function () { return exports.ProposedPaymentStream; },
    choiceName: 'ProposedPaymentStream_EditPaymentStreamProposal',
    argumentDecoder: damlTypes.lazyMemo(function () { return exports.ProposedPaymentStream_EditPaymentStreamProposal.decoder; }),
    argumentEncode: function (__typed__) { return exports.ProposedPaymentStream_EditPaymentStreamProposal.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.ContractId(exports.ProposedPaymentStream).decoder; }),
    resultEncode: function (__typed__) { return damlTypes.ContractId(exports.ProposedPaymentStream).encode(__typed__); },
  },
  ProposedPaymentStream_Withdraw: {
    template: function () { return exports.ProposedPaymentStream; },
    choiceName: 'ProposedPaymentStream_Withdraw',
    argumentDecoder: damlTypes.lazyMemo(function () { return exports.ProposedPaymentStream_Withdraw.decoder; }),
    argumentEncode: function (__typed__) { return exports.ProposedPaymentStream_Withdraw.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.ProposedPaymentStream, ['b9b320d4b90b6367688d5eb6134b57c80da1bc8fe99b7b4f923f889da544947d', '#CantonPayments']);

