UNPKG

@maxio-com/advanced-billing-sdk

Version:

Ultimate billing and pricing flexibility for B2B SaaS. Maxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments.

212 lines 10.2 kB
"use strict"; /** * AdvancedBilling * * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ exports.__esModule = true; exports.InvoiceEvent = exports.invoiceEventSchema = void 0; var schema_1 = require("../../schema"); var applyCreditNoteEvent_1 = require("../applyCreditNoteEvent"); var applyDebitNoteEvent_1 = require("../applyDebitNoteEvent"); var applyPaymentEvent_1 = require("../applyPaymentEvent"); var backportInvoiceEvent_1 = require("../backportInvoiceEvent"); var changeChargebackStatusEvent_1 = require("../changeChargebackStatusEvent"); var changeInvoiceCollectionMethodEvent_1 = require("../changeInvoiceCollectionMethodEvent"); var changeInvoiceStatusEvent_1 = require("../changeInvoiceStatusEvent"); var createCreditNoteEvent_1 = require("../createCreditNoteEvent"); var createDebitNoteEvent_1 = require("../createDebitNoteEvent"); var failedPaymentEvent_1 = require("../failedPaymentEvent"); var issueInvoiceEvent_1 = require("../issueInvoiceEvent"); var refundInvoiceEvent_1 = require("../refundInvoiceEvent"); var removePaymentEvent_1 = require("../removePaymentEvent"); var voidInvoiceEvent_1 = require("../voidInvoiceEvent"); var voidRemainderEvent_1 = require("../voidRemainderEvent"); var discriminatorMap = { 'apply_credit_note': applyCreditNoteEvent_1.applyCreditNoteEventSchema, 'apply_debit_note': applyDebitNoteEvent_1.applyDebitNoteEventSchema, 'apply_payment': applyPaymentEvent_1.applyPaymentEventSchema, 'backport_invoice': backportInvoiceEvent_1.backportInvoiceEventSchema, 'change_chargeback_status': changeChargebackStatusEvent_1.changeChargebackStatusEventSchema, 'change_invoice_collection_method': changeInvoiceCollectionMethodEvent_1.changeInvoiceCollectionMethodEventSchema, 'change_invoice_status': changeInvoiceStatusEvent_1.changeInvoiceStatusEventSchema, 'create_credit_note': createCreditNoteEvent_1.createCreditNoteEventSchema, 'create_debit_note': createDebitNoteEvent_1.createDebitNoteEventSchema, 'failed_payment': failedPaymentEvent_1.failedPaymentEventSchema, 'issue_invoice': issueInvoiceEvent_1.issueInvoiceEventSchema, 'refund_invoice': refundInvoiceEvent_1.refundInvoiceEventSchema, 'remove_payment': removePaymentEvent_1.removePaymentEventSchema, 'void_invoice': voidInvoiceEvent_1.voidInvoiceEventSchema, 'void_remainder': voidRemainderEvent_1.voidRemainderEventSchema }; exports.invoiceEventSchema = (0, schema_1.anyOf)([ applyCreditNoteEvent_1.applyCreditNoteEventSchema, applyDebitNoteEvent_1.applyDebitNoteEventSchema, applyPaymentEvent_1.applyPaymentEventSchema, backportInvoiceEvent_1.backportInvoiceEventSchema, changeChargebackStatusEvent_1.changeChargebackStatusEventSchema, changeInvoiceCollectionMethodEvent_1.changeInvoiceCollectionMethodEventSchema, changeInvoiceStatusEvent_1.changeInvoiceStatusEventSchema, createCreditNoteEvent_1.createCreditNoteEventSchema, createDebitNoteEvent_1.createDebitNoteEventSchema, failedPaymentEvent_1.failedPaymentEventSchema, issueInvoiceEvent_1.issueInvoiceEventSchema, refundInvoiceEvent_1.refundInvoiceEventSchema, removePaymentEvent_1.removePaymentEventSchema, voidInvoiceEvent_1.voidInvoiceEventSchema, voidRemainderEvent_1.voidRemainderEventSchema, ], discriminatorMap, 'eventType'); var InvoiceEvent; (function (InvoiceEvent) { /** * Validation method to narrow down union type to ApplyCreditNoteEvent type case. * * This is Apply Credit Note Event case. */ function isApplyCreditNoteEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, applyCreditNoteEvent_1.applyCreditNoteEventSchema); return validationResult.errors === false; } InvoiceEvent.isApplyCreditNoteEvent = isApplyCreditNoteEvent; /** * Validation method to narrow down union type to ApplyDebitNoteEvent type case. * * This is Apply Debit Note Event case. */ function isApplyDebitNoteEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, applyDebitNoteEvent_1.applyDebitNoteEventSchema); return validationResult.errors === false; } InvoiceEvent.isApplyDebitNoteEvent = isApplyDebitNoteEvent; /** * Validation method to narrow down union type to ApplyPaymentEvent type case. * * This is Apply Payment Event case. */ function isApplyPaymentEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, applyPaymentEvent_1.applyPaymentEventSchema); return validationResult.errors === false; } InvoiceEvent.isApplyPaymentEvent = isApplyPaymentEvent; /** * Validation method to narrow down union type to BackportInvoiceEvent type case. * * This is Backport Invoice Event case. */ function isBackportInvoiceEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, backportInvoiceEvent_1.backportInvoiceEventSchema); return validationResult.errors === false; } InvoiceEvent.isBackportInvoiceEvent = isBackportInvoiceEvent; /** * Validation method to narrow down union type to ChangeChargebackStatusEvent type case. * * This is Change Chargeback Status Event case. */ function isChangeChargebackStatusEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, changeChargebackStatusEvent_1.changeChargebackStatusEventSchema); return validationResult.errors === false; } InvoiceEvent.isChangeChargebackStatusEvent = isChangeChargebackStatusEvent; /** * Validation method to narrow down union type to ChangeInvoiceCollectionMethodEvent type case. * * This is Change Invoice Collection Method Event case. */ function isChangeInvoiceCollectionMethodEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, changeInvoiceCollectionMethodEvent_1.changeInvoiceCollectionMethodEventSchema); return validationResult.errors === false; } InvoiceEvent.isChangeInvoiceCollectionMethodEvent = isChangeInvoiceCollectionMethodEvent; /** * Validation method to narrow down union type to ChangeInvoiceStatusEvent type case. * * This is Change Invoice Status Event case. */ function isChangeInvoiceStatusEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, changeInvoiceStatusEvent_1.changeInvoiceStatusEventSchema); return validationResult.errors === false; } InvoiceEvent.isChangeInvoiceStatusEvent = isChangeInvoiceStatusEvent; /** * Validation method to narrow down union type to CreateCreditNoteEvent type case. * * This is Create Credit Note Event case. */ function isCreateCreditNoteEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, createCreditNoteEvent_1.createCreditNoteEventSchema); return validationResult.errors === false; } InvoiceEvent.isCreateCreditNoteEvent = isCreateCreditNoteEvent; /** * Validation method to narrow down union type to CreateDebitNoteEvent type case. * * This is Create Debit Note Event case. */ function isCreateDebitNoteEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, createDebitNoteEvent_1.createDebitNoteEventSchema); return validationResult.errors === false; } InvoiceEvent.isCreateDebitNoteEvent = isCreateDebitNoteEvent; /** * Validation method to narrow down union type to FailedPaymentEvent type case. * * This is Failed Payment Event case. */ function isFailedPaymentEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, failedPaymentEvent_1.failedPaymentEventSchema); return validationResult.errors === false; } InvoiceEvent.isFailedPaymentEvent = isFailedPaymentEvent; /** * Validation method to narrow down union type to IssueInvoiceEvent type case. * * This is Issue Invoice Event case. */ function isIssueInvoiceEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, issueInvoiceEvent_1.issueInvoiceEventSchema); return validationResult.errors === false; } InvoiceEvent.isIssueInvoiceEvent = isIssueInvoiceEvent; /** * Validation method to narrow down union type to RefundInvoiceEvent type case. * * This is Refund Invoice Event case. */ function isRefundInvoiceEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, refundInvoiceEvent_1.refundInvoiceEventSchema); return validationResult.errors === false; } InvoiceEvent.isRefundInvoiceEvent = isRefundInvoiceEvent; /** * Validation method to narrow down union type to RemovePaymentEvent type case. * * This is Remove Payment Event case. */ function isRemovePaymentEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, removePaymentEvent_1.removePaymentEventSchema); return validationResult.errors === false; } InvoiceEvent.isRemovePaymentEvent = isRemovePaymentEvent; /** * Validation method to narrow down union type to VoidInvoiceEvent type case. * * This is Void Invoice Event case. */ function isVoidInvoiceEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, voidInvoiceEvent_1.voidInvoiceEventSchema); return validationResult.errors === false; } InvoiceEvent.isVoidInvoiceEvent = isVoidInvoiceEvent; /** * Validation method to narrow down union type to VoidRemainderEvent type case. * * This is Void Remainder Event case. */ function isVoidRemainderEvent(value) { var validationResult = (0, schema_1.validateAndMap)(value, voidRemainderEvent_1.voidRemainderEventSchema); return validationResult.errors === false; } InvoiceEvent.isVoidRemainderEvent = isVoidRemainderEvent; })(InvoiceEvent = exports.InvoiceEvent || (exports.InvoiceEvent = {})); //# sourceMappingURL=invoiceEvent.js.map