UNPKG

pepipost

Version:

Official nodejs library for sending email using web API v5

64 lines (57 loc) 2.34 kB
/** * PepipostLib * * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). */ 'use strict'; const BaseModel = require('./BaseModel'); /** * Creates an instance of Personalizations */ class Personalizations extends BaseModel { /** * @constructor * @param {Object} obj The object passed to constructor */ constructor(obj) { super(obj); if (obj === undefined || obj === null) return; this.attributes = this.constructor.getValue(obj.attributes); this.headers = this.constructor.getValue(obj.headers); this.attachments = this.constructor.getValue(obj.attachments); this.to = this.constructor.getValue(obj.to); this.cc = this.constructor.getValue(obj.cc); this.bcc = this.constructor.getValue(obj.bcc); this.tokenTo = this.constructor.getValue(obj.tokenTo || obj.token_to); this.tokenCc = this.constructor.getValue(obj.tokenCc || obj.token_cc); this.tokenBcc = this.constructor.getValue(obj.tokenBcc || obj.token_bcc); } /** * Function containing information about the fields of this model * @return {array} Array of objects containing information about the fields */ static mappingInfo() { return super.mappingInfo().concat([ { name: 'attributes', realName: 'attributes' }, { name: 'headers', realName: 'headers' }, { name: 'attachments', realName: 'attachments', array: true, type: 'Attachments' }, { name: 'to', realName: 'to', array: true, type: 'EmailStruct' }, { name: 'cc', realName: 'cc', array: true, type: 'EmailStruct' }, { name: 'bcc', realName: 'bcc', array: true, type: 'EmailStruct' }, { name: 'tokenTo', realName: 'token_to' }, { name: 'tokenCc', realName: 'token_cc' }, { name: 'tokenBcc', realName: 'token_bcc' }, ]); } /** * Function containing information about discriminator values * mapped with their corresponding model class names * * @return {object} Object containing Key-Value pairs mapping discriminator * values with their corresponding model classes */ static discriminatorMap() { return {}; } } module.exports = Personalizations;