@zohocrm/nodejs-sdk-2.0
Version:
Node JS SDK for Zoho CRM
323 lines (268 loc) • 8.23 kB
JavaScript
const Constants = require("../../../../../../utils/util/constants").MasterModel;
const SDKException = require("../exception/sdk_exception").MasterModel;
class Layout{
createdTime;
convertMapping;
modifiedTime;
visible;
createdFor;
name;
modifiedBy;
profiles;
id;
createdBy;
sections;
status;
keyModified = new Map();
/**
* The method to get the createdTime
* @returns {Date} An instance of Date
*/
getCreatedTime() {
return this.createdTime;
}
/**
* The method to set the value to createdTime
* @param {Date} createdTime An instance of Date
*/
setCreatedTime(createdTime) {
if((createdTime != null) && (!(createdTime instanceof Date))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: createdTime EXPECTED TYPE: Date", null, null);
}
this.createdTime = createdTime;
this.keyModified.set("created_time", 1);
}
/**
* The method to get the convertMapping
* @returns {Map} A Map representing the convertMapping
*/
getConvertMapping() {
return this.convertMapping;
}
/**
* The method to set the value to convertMapping
* @param {Map} convertMapping A Map representing the convertMapping
*/
setConvertMapping(convertMapping) {
if((convertMapping != null) && (!(Object.prototype.toString.call(convertMapping) == "[object Map]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: convertMapping EXPECTED TYPE: Map", null, null);
}
this.convertMapping = convertMapping;
this.keyModified.set("convert_mapping", 1);
}
/**
* The method to get the modifiedTime
* @returns {Date} An instance of Date
*/
getModifiedTime() {
return this.modifiedTime;
}
/**
* The method to set the value to modifiedTime
* @param {Date} modifiedTime An instance of Date
*/
setModifiedTime(modifiedTime) {
if((modifiedTime != null) && (!(modifiedTime instanceof Date))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modifiedTime EXPECTED TYPE: Date", null, null);
}
this.modifiedTime = modifiedTime;
this.keyModified.set("modified_time", 1);
}
/**
* The method to get the visible
* @returns {Boolean} A Boolean representing the visible
*/
getVisible() {
return this.visible;
}
/**
* The method to set the value to visible
* @param {Boolean} visible A Boolean representing the visible
*/
setVisible(visible) {
if((visible != null) && (!(Object.prototype.toString.call(visible) == "[object Boolean]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: visible EXPECTED TYPE: Boolean", null, null);
}
this.visible = visible;
this.keyModified.set("visible", 1);
}
/**
* The method to get the createdFor
* @returns {User} An instance of User
*/
getCreatedFor() {
return this.createdFor;
}
/**
* The method to set the value to createdFor
* @param {User} createdFor An instance of User
*/
setCreatedFor(createdFor) {
const User = require("../users/user").MasterModel;
if((createdFor != null) && (!(createdFor instanceof User))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: createdFor EXPECTED TYPE: User", null, null);
}
this.createdFor = createdFor;
this.keyModified.set("created_for", 1);
}
/**
* The method to get the name
* @returns {String} A String representing the name
*/
getName() {
return this.name;
}
/**
* The method to set the value to name
* @param {String} name A String representing the name
*/
setName(name) {
if((name != null) && (!(Object.prototype.toString.call(name) == "[object String]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: name EXPECTED TYPE: String", null, null);
}
this.name = name;
this.keyModified.set("name", 1);
}
/**
* The method to get the modifiedBy
* @returns {User} An instance of User
*/
getModifiedBy() {
return this.modifiedBy;
}
/**
* The method to set the value to modifiedBy
* @param {User} modifiedBy An instance of User
*/
setModifiedBy(modifiedBy) {
const User = require("../users/user").MasterModel;
if((modifiedBy != null) && (!(modifiedBy instanceof User))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modifiedBy EXPECTED TYPE: User", null, null);
}
this.modifiedBy = modifiedBy;
this.keyModified.set("modified_by", 1);
}
/**
* The method to get the profiles
* @returns {Array} An Array representing the profiles
*/
getProfiles() {
return this.profiles;
}
/**
* The method to set the value to profiles
* @param {Array} profiles An Array representing the profiles
*/
setProfiles(profiles) {
if((profiles != null) && (!(Object.prototype.toString.call(profiles) == "[object Array]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: profiles EXPECTED TYPE: Array", null, null);
}
this.profiles = profiles;
this.keyModified.set("profiles", 1);
}
/**
* The method to get the id
* @returns {BigInt} A BigInt representing the id
*/
getId() {
return this.id;
}
/**
* The method to set the value to id
* @param {BigInt} id A BigInt representing the id
*/
setId(id) {
if((id != null) && (!(Object.prototype.toString.call(id) == "[object BigInt]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: id EXPECTED TYPE: BigInt", null, null);
}
this.id = id;
this.keyModified.set("id", 1);
}
/**
* The method to get the createdBy
* @returns {User} An instance of User
*/
getCreatedBy() {
return this.createdBy;
}
/**
* The method to set the value to createdBy
* @param {User} createdBy An instance of User
*/
setCreatedBy(createdBy) {
const User = require("../users/user").MasterModel;
if((createdBy != null) && (!(createdBy instanceof User))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: createdBy EXPECTED TYPE: User", null, null);
}
this.createdBy = createdBy;
this.keyModified.set("created_by", 1);
}
/**
* The method to get the sections
* @returns {Array} An Array representing the sections
*/
getSections() {
return this.sections;
}
/**
* The method to set the value to sections
* @param {Array} sections An Array representing the sections
*/
setSections(sections) {
if((sections != null) && (!(Object.prototype.toString.call(sections) == "[object Array]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: sections EXPECTED TYPE: Array", null, null);
}
this.sections = sections;
this.keyModified.set("sections", 1);
}
/**
* The method to get the status
* @returns {number} A number representing the status
*/
getStatus() {
return this.status;
}
/**
* The method to set the value to status
* @param {number} status A number representing the status
*/
setStatus(status) {
if((status != null) && (!(Object.prototype.toString.call(status) == "[object Number]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: status EXPECTED TYPE: number", null, null);
}
this.status = status;
this.keyModified.set("status", 1);
}
/**
* The method to check if the user has modified the given key
* @param {String} key A String representing the key
* @returns {number} A number representing the modification
*/
isKeyModified(key) {
if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null);
}
if(this.keyModified.has(key)) {
return this.keyModified.get(key);
}
return null;
}
/**
* The method to mark the given key as modified
* @param {String} key A String representing the key
* @param {number} modification A number representing the modification
*/
setKeyModified(key, modification) {
if((key != null) && (!(Object.prototype.toString.call(key) == "[object String]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: key EXPECTED TYPE: String", null, null);
}
if((modification != null) && (!(Object.prototype.toString.call(modification) == "[object Number]"))) {
throw new SDKException(Constants.DATA_TYPE_ERROR, "KEY: modification EXPECTED TYPE: number", null, null);
}
this.keyModified.set(key, modification);
}
}
module.exports = {
MasterModel : Layout,
Layout : Layout
}