"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 pkg7804375fe5e4c6d5afe067bd314c42fe0b7d005a1300019c73154dd939da4dda = require('../../../../Splice/Api/FeaturedAppRightV1');
var pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946 = require('../../../../DA/Time/Types');

var CantonPayments_PaymentStream_Types_PaymentStreamAmount = require('../../../../CantonPayments/PaymentStream/Types/PaymentStreamAmount/module');


exports.PaymentStream = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({payer: damlTypes.Party.decoder, recipient: damlTypes.Party.decoder, recipientPaymentPerDay: CantonPayments_PaymentStream_Types_PaymentStreamAmount.PaymentStreamAmount.decoder, processorPaymentPerDay: jtv.Decoder.withDefault(null, damlTypes.Optional(CantonPayments_PaymentStream_Types_PaymentStreamAmount.PaymentStreamAmount).decoder), freeTrialExpiration: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), prepayWindow: pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946.DA.Time.Types.RelTime.decoder, paymentsEndAt: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), provider: damlTypes.Party.decoder, appRewardBeneficiaries: damlTypes.List(pkg7804375fe5e4c6d5afe067bd314c42fe0b7d005a1300019c73154dd939da4dda.AppRewardBeneficiary).decoder, description: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), metadata: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.TextMap(damlTypes.Text)).decoder), observers: damlTypes.List(damlTypes.Party).decoder, }); }),
  encode: function (__typed__) {
  return {
    payer: damlTypes.Party.encode(__typed__.payer),
    recipient: damlTypes.Party.encode(__typed__.recipient),
    recipientPaymentPerDay: CantonPayments_PaymentStream_Types_PaymentStreamAmount.PaymentStreamAmount.encode(__typed__.recipientPaymentPerDay),
    processorPaymentPerDay: damlTypes.Optional(CantonPayments_PaymentStream_Types_PaymentStreamAmount.PaymentStreamAmount).encode(__typed__.processorPaymentPerDay),
    freeTrialExpiration: damlTypes.Optional(damlTypes.Time).encode(__typed__.freeTrialExpiration),
    prepayWindow: pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946.DA.Time.Types.RelTime.encode(__typed__.prepayWindow),
    paymentsEndAt: damlTypes.Optional(damlTypes.Time).encode(__typed__.paymentsEndAt),
    provider: damlTypes.Party.encode(__typed__.provider),
    appRewardBeneficiaries: damlTypes.List(pkg7804375fe5e4c6d5afe067bd314c42fe0b7d005a1300019c73154dd939da4dda.AppRewardBeneficiary).encode(__typed__.appRewardBeneficiaries),
    description: damlTypes.Optional(damlTypes.Text).encode(__typed__.description),
    metadata: damlTypes.Optional(damlTypes.TextMap(damlTypes.Text)).encode(__typed__.metadata),
    observers: damlTypes.List(damlTypes.Party).encode(__typed__.observers),
  };
}
,
};

