@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.
194 lines • 8.15 kB
JavaScript
/**
* AdvancedBilling
*
* This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
import { anyOf, isMappedValueValidForSchema, lazy, } from '../../schema.js';
import { applyCreditNoteEventSchema, } from '../applyCreditNoteEvent.js';
import { applyDebitNoteEventSchema, } from '../applyDebitNoteEvent.js';
import { applyPaymentEventSchema, } from '../applyPaymentEvent.js';
import { backportInvoiceEventSchema, } from '../backportInvoiceEvent.js';
import { changeChargebackStatusEventSchema, } from '../changeChargebackStatusEvent.js';
import { changeInvoiceCollectionMethodEventSchema, } from '../changeInvoiceCollectionMethodEvent.js';
import { changeInvoiceStatusEventSchema, } from '../changeInvoiceStatusEvent.js';
import { createCreditNoteEventSchema, } from '../createCreditNoteEvent.js';
import { createDebitNoteEventSchema, } from '../createDebitNoteEvent.js';
import { failedPaymentEventSchema, } from '../failedPaymentEvent.js';
import { issueInvoiceEventSchema, } from '../issueInvoiceEvent.js';
import { refundInvoiceEventSchema, } from '../refundInvoiceEvent.js';
import { removePaymentEventSchema, } from '../removePaymentEvent.js';
import { voidInvoiceEventSchema, } from '../voidInvoiceEvent.js';
import { voidRemainderEventSchema, } from '../voidRemainderEvent.js';
const discriminatorMap = {
'apply_credit_note': applyCreditNoteEventSchema,
'apply_debit_note': applyDebitNoteEventSchema,
'apply_payment': applyPaymentEventSchema,
'backport_invoice': backportInvoiceEventSchema,
'change_chargeback_status': changeChargebackStatusEventSchema,
'change_invoice_collection_method': changeInvoiceCollectionMethodEventSchema,
'change_invoice_status': changeInvoiceStatusEventSchema,
'create_credit_note': createCreditNoteEventSchema,
'create_debit_note': createDebitNoteEventSchema,
'failed_payment': failedPaymentEventSchema,
'issue_invoice': issueInvoiceEventSchema,
'refund_invoice': refundInvoiceEventSchema,
'remove_payment': removePaymentEventSchema,
'void_invoice': voidInvoiceEventSchema,
'void_remainder': voidRemainderEventSchema,
};
export const invoiceEventSchema = lazy(() => anyOf([
applyCreditNoteEventSchema,
applyDebitNoteEventSchema,
applyPaymentEventSchema,
backportInvoiceEventSchema,
changeChargebackStatusEventSchema,
changeInvoiceCollectionMethodEventSchema,
changeInvoiceStatusEventSchema,
createCreditNoteEventSchema,
createDebitNoteEventSchema,
failedPaymentEventSchema,
issueInvoiceEventSchema,
refundInvoiceEventSchema,
removePaymentEventSchema,
voidInvoiceEventSchema,
voidRemainderEventSchema,
], discriminatorMap, 'event_type'));
export 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) {
return isMappedValueValidForSchema(value, applyCreditNoteEventSchema);
}
InvoiceEvent.isApplyCreditNoteEvent = isApplyCreditNoteEvent;
/**
* Validation method to narrow down union type to ApplyDebitNoteEvent type case.
*
* This is Apply Debit Note Event case.
*/
function isApplyDebitNoteEvent(value) {
return isMappedValueValidForSchema(value, applyDebitNoteEventSchema);
}
InvoiceEvent.isApplyDebitNoteEvent = isApplyDebitNoteEvent;
/**
* Validation method to narrow down union type to ApplyPaymentEvent type case.
*
* This is Apply Payment Event case.
*/
function isApplyPaymentEvent(value) {
return isMappedValueValidForSchema(value, applyPaymentEventSchema);
}
InvoiceEvent.isApplyPaymentEvent = isApplyPaymentEvent;
/**
* Validation method to narrow down union type to BackportInvoiceEvent type case.
*
* This is Backport Invoice Event case.
*/
function isBackportInvoiceEvent(value) {
return isMappedValueValidForSchema(value, backportInvoiceEventSchema);
}
InvoiceEvent.isBackportInvoiceEvent = isBackportInvoiceEvent;
/**
* Validation method to narrow down union type to ChangeChargebackStatusEvent type case.
*
* This is Change Chargeback Status Event case.
*/
function isChangeChargebackStatusEvent(value) {
return isMappedValueValidForSchema(value, changeChargebackStatusEventSchema);
}
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) {
return isMappedValueValidForSchema(value, changeInvoiceCollectionMethodEventSchema);
}
InvoiceEvent.isChangeInvoiceCollectionMethodEvent = isChangeInvoiceCollectionMethodEvent;
/**
* Validation method to narrow down union type to ChangeInvoiceStatusEvent type case.
*
* This is Change Invoice Status Event case.
*/
function isChangeInvoiceStatusEvent(value) {
return isMappedValueValidForSchema(value, changeInvoiceStatusEventSchema);
}
InvoiceEvent.isChangeInvoiceStatusEvent = isChangeInvoiceStatusEvent;
/**
* Validation method to narrow down union type to CreateCreditNoteEvent type case.
*
* This is Create Credit Note Event case.
*/
function isCreateCreditNoteEvent(value) {
return isMappedValueValidForSchema(value, createCreditNoteEventSchema);
}
InvoiceEvent.isCreateCreditNoteEvent = isCreateCreditNoteEvent;
/**
* Validation method to narrow down union type to CreateDebitNoteEvent type case.
*
* This is Create Debit Note Event case.
*/
function isCreateDebitNoteEvent(value) {
return isMappedValueValidForSchema(value, createDebitNoteEventSchema);
}
InvoiceEvent.isCreateDebitNoteEvent = isCreateDebitNoteEvent;
/**
* Validation method to narrow down union type to FailedPaymentEvent type case.
*
* This is Failed Payment Event case.
*/
function isFailedPaymentEvent(value) {
return isMappedValueValidForSchema(value, failedPaymentEventSchema);
}
InvoiceEvent.isFailedPaymentEvent = isFailedPaymentEvent;
/**
* Validation method to narrow down union type to IssueInvoiceEvent type case.
*
* This is Issue Invoice Event case.
*/
function isIssueInvoiceEvent(value) {
return isMappedValueValidForSchema(value, issueInvoiceEventSchema);
}
InvoiceEvent.isIssueInvoiceEvent = isIssueInvoiceEvent;
/**
* Validation method to narrow down union type to RefundInvoiceEvent type case.
*
* This is Refund Invoice Event case.
*/
function isRefundInvoiceEvent(value) {
return isMappedValueValidForSchema(value, refundInvoiceEventSchema);
}
InvoiceEvent.isRefundInvoiceEvent = isRefundInvoiceEvent;
/**
* Validation method to narrow down union type to RemovePaymentEvent type case.
*
* This is Remove Payment Event case.
*/
function isRemovePaymentEvent(value) {
return isMappedValueValidForSchema(value, removePaymentEventSchema);
}
InvoiceEvent.isRemovePaymentEvent = isRemovePaymentEvent;
/**
* Validation method to narrow down union type to VoidInvoiceEvent type case.
*
* This is Void Invoice Event case.
*/
function isVoidInvoiceEvent(value) {
return isMappedValueValidForSchema(value, voidInvoiceEventSchema);
}
InvoiceEvent.isVoidInvoiceEvent = isVoidInvoiceEvent;
/**
* Validation method to narrow down union type to VoidRemainderEvent type case.
*
* This is Void Remainder Event case.
*/
function isVoidRemainderEvent(value) {
return isMappedValueValidForSchema(value, voidRemainderEventSchema);
}
InvoiceEvent.isVoidRemainderEvent = isVoidRemainderEvent;
})(InvoiceEvent || (InvoiceEvent = {}));
//# sourceMappingURL=invoiceEvent.js.map