module author Christos Panagiotakopoulos <chrispanag@gmail.com>
 *  copyright license import { isObjectPayload , SerializedQuickreply } from './interfaces' ; /** The generic QuickReply class */ export class QuickReply { public title : string ; public content_type : string ; public payload : string ; param { string } content_type param { string } title param { ? object | ? string } payload constructor ( content_type , title , payload = '' ) { let serializedPayload = JSON . stringify ( payload ) ; if ( ! isObjectPayload ( payload ) ) { serializedPayload = payload ; } this . title = title ; this . payload = serializedPayload ; this . content_type = content_type ; } public serialize ( ) { return { content_type : this . content_type , title : this . title , payload : this . payload } ; } } extends QuickReply export class TextQuickReply extends QuickReply { param { string } title param { ? string | ? object } payload constructor ( title , payload ) { super ( 'text' , title , payload ) ; } }