@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.
62 lines • 2.6 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 { applePayPaymentProfileSchema, } from '../applePayPaymentProfile.js';
import { bankAccountPaymentProfileSchema, } from '../bankAccountPaymentProfile.js';
import { creditCardPaymentProfileSchema, } from '../creditCardPaymentProfile.js';
import { paypalPaymentProfileSchema, } from '../paypalPaymentProfile.js';
const discriminatorMap = {
'apple_pay': applePayPaymentProfileSchema,
'bank_account': bankAccountPaymentProfileSchema,
'credit_card': creditCardPaymentProfileSchema,
'paypal_account': paypalPaymentProfileSchema,
};
export const paymentProfileSchema = lazy(() => anyOf([
applePayPaymentProfileSchema,
bankAccountPaymentProfileSchema,
creditCardPaymentProfileSchema,
paypalPaymentProfileSchema,
], discriminatorMap, 'payment_type'));
export var PaymentProfile;
(function (PaymentProfile) {
/**
* Validation method to narrow down union type to ApplePayPaymentProfile type case.
*
* This is ApplePay Payment Profile case.
*/
function isApplePayPaymentProfile(value) {
return isMappedValueValidForSchema(value, applePayPaymentProfileSchema);
}
PaymentProfile.isApplePayPaymentProfile = isApplePayPaymentProfile;
/**
* Validation method to narrow down union type to BankAccountPaymentProfile type case.
*
* This is Bank Account Payment Profile case.
*/
function isBankAccountPaymentProfile(value) {
return isMappedValueValidForSchema(value, bankAccountPaymentProfileSchema);
}
PaymentProfile.isBankAccountPaymentProfile = isBankAccountPaymentProfile;
/**
* Validation method to narrow down union type to CreditCardPaymentProfile type case.
*
* This is Credit Card Payment Profile case.
*/
function isCreditCardPaymentProfile(value) {
return isMappedValueValidForSchema(value, creditCardPaymentProfileSchema);
}
PaymentProfile.isCreditCardPaymentProfile = isCreditCardPaymentProfile;
/**
* Validation method to narrow down union type to PaypalPaymentProfile type case.
*
* This is Paypal Payment Profile case.
*/
function isPaypalPaymentProfile(value) {
return isMappedValueValidForSchema(value, paypalPaymentProfileSchema);
}
PaymentProfile.isPaypalPaymentProfile = isPaypalPaymentProfile;
})(PaymentProfile || (PaymentProfile = {}));
//# sourceMappingURL=paymentProfile.js.map