lib/message.js
function Message (opts) {
  if (!(this instanceof Message)) return new Message(opts)

  this.type = opts.type || 0
  this.clientReference = opts.clientReference || null
  this.direction = opts.direction || 'out'
  this.flashMessage = opts.flash || null
  this.messageId = opts.messageId || null
  this.networkId = opts.networkId || null
  this.rate = opts.rate || null
  this.registeredDelivery = opts.registeredDelivery || null
  this.status = opts.status || null
  this.time = opts.time || null
  this.udh = opts.udh || null
  this.units = opts.units || null
  this.updateTime = opts.updateTime || null

  if (isAnImportantParamMissing(opts)) {
    throw new SMSGHError('Important message option missing. Required options are: `from`, `to` and  `content`')
  }

  var i = 0
  var l = Message._importantParams.length
  for (i = 0; i < l; i++) {
    this[Message._importantParams[i]] = opts[Message._importantParams[i]]
  }
}
function Message (opts) {
  if (!(this instanceof Message)) return new Message(opts)

  this.type = opts.type || 0
  this.clientReference = opts.clientReference || null
  this.direction = opts.direction || 'out'
  this.flashMessage = opts.flash || null
  this.messageId = opts.messageId || null
  this.networkId = opts.networkId || null
  this.rate = opts.rate || null
  this.registeredDelivery = opts.registeredDelivery || null
  this.status = opts.status || null
  this.time = opts.time || null
  this.udh = opts.udh || null
  this.units = opts.units || null
  this.updateTime = opts.updateTime || null

  if (isAnImportantParamMissing(opts)) {
    throw new SMSGHError('Important message option missing. Required options are: `from`, `to` and  `content`')
  }

  var i = 0
  var l = Message._importantParams.length
  for (i = 0; i < l; i++) {
    this[Message._importantParams[i]] = opts[Message._importantParams[i]]
  }
}
function Message ( opts ) { if ( ! ( this instanceof Message ) ) return new Message ( opts ) this . type = opts . type || 0 this . clientReference = opts . clientReference || null this . direction = opts . direction || 'out' this . flashMessage = opts . flash || null this . messageId = opts . messageId || null this . networkId = opts . networkId || null this . rate = opts . rate || null this . registeredDelivery = opts . registeredDelivery || null this . status = opts . status || null this . time = opts . time || null this . udh = opts . udh || null this . units = opts . units || null this . updateTime = opts . updateTime || null if ( isAnImportantParamMissing ( opts ) ) { throw new SMSGHError ( 'Important message option missing. Required options are: `from`, `to` and  `content`' ) } var i = 0 var l = Message . _importantParams . length for ( i = 0 ; i < l ; i ++ ) { this [ Message . _importantParams [ i ] ] = opts [ Message . _importantParams [ i ] ] } }
The message object used in the send message api
@param {Object} opts Contains the params to be sent using the message api
The message object used in the send message api