react-native-lightspeedsdk
Version:
A react-native interface for using the LightspeedSDK
63 lines (57 loc) • 1.5 kB
JavaScript
;
type SurveyMap = {
surveyId:number,
gtmSurveyId:number,
surveyName:string,
surveyDescription:string,
surveyLength:number,
surveyUrl:string,
resultType:string,
awardMessage:string,
screenAwardMessage:string,
lmSampleId:number,
lmQuotaId:number,
isSamSample:bool,
activityType:Array,
surveyAppType:number,
surveyType:string
};
/**
* Represents an immutable Survey
*/
class Survey {
surveyId:number;
gtmSurveyId:number;
surveyName:string;
surveyDescription:string;
surveyLength:number;
surveyUrl:string;
resultType:string;
awardMessage:string;
screenAwardMessage:string;
lmSampleId:number;
lmQuotaId:number;
isSamSample:bool;
activityType:Array;
surveyAppType:number;
surveyType:string;
constructor(map: SurveyMap) {
this.surveyId = map.surveyId;
this.gtmSurveyId = map.gtmSurveyId;
this.surveyName = map.surveyName;
this.surveyDescription = map.surveyDescription;
this.surveyLength = map.surveyLength;
this.surveyUrl = map.surveyUrl;
this.resultType = map.resultType;
this.awardMessage = map.awardMessage;
this.screenAwardMessage = map.screenAwardMessage;
this.lmSampleId = map.lmSampleId;
this.lmQuotaId = map.lmQuotaId;
this.isSamSample = map.isSamSample;
this.activityType = map.activityType;
this.surveyAppType = map.surveyAppType;
this.surveyType = map.surveyType;
Object.freeze(this);
}
}
module.exports = Survey;