RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

source

Models/Lab/Site/RackPositionModel.js

/**
 * File Auto-Generated by the RICADO Gen 4 PHP API Project
 * 
 * Do Not Edit this File Manually!
 */

import BaseModel from '../../../Models/BaseModel';

/**
 * Model Class for a Rack Position
 * 
 * @class
 * @hideconstructor
 * @extends BaseModel
 */
class RackPositionModel extends BaseModel
{
    /**
     * RackPositionModel Constructor
     * 
     * @protected
     * @param {number} siteId The Site ID associated with this Rack Position
     */
    constructor(siteId)
    {
        super();
        
        /**
         * The Rack Position ID
         * 
         * @type {string}
         * @public
         */
        this.id = "";
        
        /**
         * The RTU this Rack Position belongs to
         * 
         * @type {?number}
         * @public
         */
        this.rtuId = null;
        
        /**
         * The Name of this Rack Position
         * 
         * @type {string}
         * @public
         */
        this.name = "";
        
        /**
         * The Points used by this Rack Position
         * 
         * @type {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentAdditionalSampleIds: number, currentSampleStatus: number, nextSampleId: number, nextAdditionalSampleIds: number, loadCurrentSampleRequest: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, unloadCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpRateOfChange: number, currentSampleWarmUpWarning: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleFinishCriteriaMet: number, currentSampleLatestUnloadTimestamp: number}}
         * @public
         */
        this.points = (function(){
            let pointsDefaultValue = {};
            
            pointsDefaultValue.pushButton = 0;
            
            pointsDefaultValue.indicatorLight = 0;
            
            pointsDefaultValue.temperature = 0;
            
            pointsDefaultValue.calibrationOffset = 0;
            
            pointsDefaultValue.disabled = 0;
            
            pointsDefaultValue.currentSampleId = 0;
            
            pointsDefaultValue.currentAdditionalSampleIds = 0;
            
            pointsDefaultValue.currentSampleStatus = 0;
            
            pointsDefaultValue.nextSampleId = 0;
            
            pointsDefaultValue.nextAdditionalSampleIds = 0;
            
            pointsDefaultValue.loadCurrentSampleRequest = 0;
            
            pointsDefaultValue.startCurrentSampleRequest = 0;
            
            pointsDefaultValue.finishCurrentSampleRequest = 0;
            
            pointsDefaultValue.unloadCurrentSampleRequest = 0;
            
            pointsDefaultValue.currentSampleTotalDuration = 0;
            
            pointsDefaultValue.currentSampleWarmUpDuration = 0;
            
            pointsDefaultValue.currentSampleWarmUpRateOfChange = 0;
            
            pointsDefaultValue.currentSampleWarmUpWarning = 0;
            
            pointsDefaultValue.currentSampleWarmUpCompleted = 0;
            
            pointsDefaultValue.currentSampleBelowTargetDuration = 0;
            
            pointsDefaultValue.currentSampleAboveTargetDuration = 0;
            
            pointsDefaultValue.currentSampleWithinTargetDuration = 0;
            
            pointsDefaultValue.currentSampleFinishCriteriaMet = 0;
            
            pointsDefaultValue.currentSampleLatestUnloadTimestamp = 0;
            
            return pointsDefaultValue;
        }());
        
        /**
         * The Lab that owns this Rack Position
         * 
         * @type {string}
         * @public
         */
        this.labId = "";
        
        /**
         * The Rack associated with this Rack Position
         * 
         * @type {string}
         * @public
         */
        this.rackId = "";
        
        /**
         * The Index of the Vertical Level in the Rack where this Position resides
         * 
         * @type {number}
         * @public
         */
        this.verticalLevelIndex = 0;
        
        /**
         * The Index of the Horizontal Position in the Rack where this Position resides
         * 
         * @type {number}
         * @public
         */
        this.horizontalPositionIndex = 0;
        
        /**
         * Whether the Rack Position has been deleted
         * 
         * @type {boolean}
         * @public
         */
        this.deleted = false;
        
        /**
         * When the Rack Position was last updated
         * 
         * @type {Date}
         * @public
         */
        this.updateTimestamp = new Date();
        
        /**
         * The Site ID associated with this Rack Position
         * 
         * @type {number}
         * @public
         */
        this.siteId = siteId;
    }

    /**
     * Create a new **RackPositionModel** from a JSON Object or JSON String
     * 
     * @static
     * @public
     * @param {Object<string, any>|string} json A JSON Object or JSON String
     * @param {number} siteId The Site ID associated with this Rack Position
     * @return {RackPositionModel}
     */
    static fromJSON(json, siteId)
    {
        let model = new RackPositionModel(siteId);
        
        /**
         * The JSON Object
         * 
         * @type {Object<string, any>}
         */
        let jsonObject = {};
        
        if(typeof json === 'string')
        {
            jsonObject = JSON.parse(json);
        }
        else if(typeof json === 'object')
        {
            jsonObject = json;
        }
        
        if('id' in jsonObject)
        {
            model.id = (function(){
                if(typeof jsonObject['id'] !== 'string')
                {
                    return String(jsonObject['id']);
                }
        
                return jsonObject['id'];
            }());
        }
        
        if('rtuId' in jsonObject)
        {
            model.rtuId = (function(){
                if(jsonObject['rtuId'] === null)
                {
                    return null;
                }
        
                if(typeof jsonObject['rtuId'] !== 'number')
                {
                    return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
                }
        
                return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
            }());
        }
        
        if('name' in jsonObject)
        {
            model.name = (function(){
                if(typeof jsonObject['name'] !== 'string')
                {
                    return String(jsonObject['name']);
                }
        
                return jsonObject['name'];
            }());
        }
        
        if('points' in jsonObject)
        {
            model.points = (function(){
                let pointsObject = {};
                
                if(typeof jsonObject['points'] === 'object' && 'pushButton' in jsonObject['points'])
                {
                    pointsObject.pushButton = (function(){
                        if(typeof jsonObject['points'].pushButton !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].pushButton)) ? Number(jsonObject['points'].pushButton) : Math.floor(Number(jsonObject['points'].pushButton));
                        }
        
                        return Number.isInteger(jsonObject['points'].pushButton) ? jsonObject['points'].pushButton : Math.floor(jsonObject['points'].pushButton);
                    }());
                }
                else
                {
                    pointsObject.pushButton = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'indicatorLight' in jsonObject['points'])
                {
                    pointsObject.indicatorLight = (function(){
                        if(typeof jsonObject['points'].indicatorLight !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].indicatorLight)) ? Number(jsonObject['points'].indicatorLight) : Math.floor(Number(jsonObject['points'].indicatorLight));
                        }
        
                        return Number.isInteger(jsonObject['points'].indicatorLight) ? jsonObject['points'].indicatorLight : Math.floor(jsonObject['points'].indicatorLight);
                    }());
                }
                else
                {
                    pointsObject.indicatorLight = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'temperature' in jsonObject['points'])
                {
                    pointsObject.temperature = (function(){
                        if(typeof jsonObject['points'].temperature !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].temperature)) ? Number(jsonObject['points'].temperature) : Math.floor(Number(jsonObject['points'].temperature));
                        }
        
                        return Number.isInteger(jsonObject['points'].temperature) ? jsonObject['points'].temperature : Math.floor(jsonObject['points'].temperature);
                    }());
                }
                else
                {
                    pointsObject.temperature = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'calibrationOffset' in jsonObject['points'])
                {
                    pointsObject.calibrationOffset = (function(){
                        if(typeof jsonObject['points'].calibrationOffset !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].calibrationOffset)) ? Number(jsonObject['points'].calibrationOffset) : Math.floor(Number(jsonObject['points'].calibrationOffset));
                        }
        
                        return Number.isInteger(jsonObject['points'].calibrationOffset) ? jsonObject['points'].calibrationOffset : Math.floor(jsonObject['points'].calibrationOffset);
                    }());
                }
                else
                {
                    pointsObject.calibrationOffset = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'disabled' in jsonObject['points'])
                {
                    pointsObject.disabled = (function(){
                        if(typeof jsonObject['points'].disabled !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].disabled)) ? Number(jsonObject['points'].disabled) : Math.floor(Number(jsonObject['points'].disabled));
                        }
        
                        return Number.isInteger(jsonObject['points'].disabled) ? jsonObject['points'].disabled : Math.floor(jsonObject['points'].disabled);
                    }());
                }
                else
                {
                    pointsObject.disabled = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleId' in jsonObject['points'])
                {
                    pointsObject.currentSampleId = (function(){
                        if(typeof jsonObject['points'].currentSampleId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleId)) ? Number(jsonObject['points'].currentSampleId) : Math.floor(Number(jsonObject['points'].currentSampleId));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleId) ? jsonObject['points'].currentSampleId : Math.floor(jsonObject['points'].currentSampleId);
                    }());
                }
                else
                {
                    pointsObject.currentSampleId = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentAdditionalSampleIds' in jsonObject['points'])
                {
                    pointsObject.currentAdditionalSampleIds = (function(){
                        if(typeof jsonObject['points'].currentAdditionalSampleIds !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentAdditionalSampleIds)) ? Number(jsonObject['points'].currentAdditionalSampleIds) : Math.floor(Number(jsonObject['points'].currentAdditionalSampleIds));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentAdditionalSampleIds) ? jsonObject['points'].currentAdditionalSampleIds : Math.floor(jsonObject['points'].currentAdditionalSampleIds);
                    }());
                }
                else
                {
                    pointsObject.currentAdditionalSampleIds = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleStatus' in jsonObject['points'])
                {
                    pointsObject.currentSampleStatus = (function(){
                        if(typeof jsonObject['points'].currentSampleStatus !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleStatus)) ? Number(jsonObject['points'].currentSampleStatus) : Math.floor(Number(jsonObject['points'].currentSampleStatus));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleStatus) ? jsonObject['points'].currentSampleStatus : Math.floor(jsonObject['points'].currentSampleStatus);
                    }());
                }
                else
                {
                    pointsObject.currentSampleStatus = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'nextSampleId' in jsonObject['points'])
                {
                    pointsObject.nextSampleId = (function(){
                        if(typeof jsonObject['points'].nextSampleId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].nextSampleId)) ? Number(jsonObject['points'].nextSampleId) : Math.floor(Number(jsonObject['points'].nextSampleId));
                        }
        
                        return Number.isInteger(jsonObject['points'].nextSampleId) ? jsonObject['points'].nextSampleId : Math.floor(jsonObject['points'].nextSampleId);
                    }());
                }
                else
                {
                    pointsObject.nextSampleId = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'nextAdditionalSampleIds' in jsonObject['points'])
                {
                    pointsObject.nextAdditionalSampleIds = (function(){
                        if(typeof jsonObject['points'].nextAdditionalSampleIds !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].nextAdditionalSampleIds)) ? Number(jsonObject['points'].nextAdditionalSampleIds) : Math.floor(Number(jsonObject['points'].nextAdditionalSampleIds));
                        }
        
                        return Number.isInteger(jsonObject['points'].nextAdditionalSampleIds) ? jsonObject['points'].nextAdditionalSampleIds : Math.floor(jsonObject['points'].nextAdditionalSampleIds);
                    }());
                }
                else
                {
                    pointsObject.nextAdditionalSampleIds = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'loadCurrentSampleRequest' in jsonObject['points'])
                {
                    pointsObject.loadCurrentSampleRequest = (function(){
                        if(typeof jsonObject['points'].loadCurrentSampleRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].loadCurrentSampleRequest)) ? Number(jsonObject['points'].loadCurrentSampleRequest) : Math.floor(Number(jsonObject['points'].loadCurrentSampleRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].loadCurrentSampleRequest) ? jsonObject['points'].loadCurrentSampleRequest : Math.floor(jsonObject['points'].loadCurrentSampleRequest);
                    }());
                }
                else
                {
                    pointsObject.loadCurrentSampleRequest = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'startCurrentSampleRequest' in jsonObject['points'])
                {
                    pointsObject.startCurrentSampleRequest = (function(){
                        if(typeof jsonObject['points'].startCurrentSampleRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].startCurrentSampleRequest)) ? Number(jsonObject['points'].startCurrentSampleRequest) : Math.floor(Number(jsonObject['points'].startCurrentSampleRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].startCurrentSampleRequest) ? jsonObject['points'].startCurrentSampleRequest : Math.floor(jsonObject['points'].startCurrentSampleRequest);
                    }());
                }
                else
                {
                    pointsObject.startCurrentSampleRequest = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'finishCurrentSampleRequest' in jsonObject['points'])
                {
                    pointsObject.finishCurrentSampleRequest = (function(){
                        if(typeof jsonObject['points'].finishCurrentSampleRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].finishCurrentSampleRequest)) ? Number(jsonObject['points'].finishCurrentSampleRequest) : Math.floor(Number(jsonObject['points'].finishCurrentSampleRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].finishCurrentSampleRequest) ? jsonObject['points'].finishCurrentSampleRequest : Math.floor(jsonObject['points'].finishCurrentSampleRequest);
                    }());
                }
                else
                {
                    pointsObject.finishCurrentSampleRequest = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'unloadCurrentSampleRequest' in jsonObject['points'])
                {
                    pointsObject.unloadCurrentSampleRequest = (function(){
                        if(typeof jsonObject['points'].unloadCurrentSampleRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].unloadCurrentSampleRequest)) ? Number(jsonObject['points'].unloadCurrentSampleRequest) : Math.floor(Number(jsonObject['points'].unloadCurrentSampleRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].unloadCurrentSampleRequest) ? jsonObject['points'].unloadCurrentSampleRequest : Math.floor(jsonObject['points'].unloadCurrentSampleRequest);
                    }());
                }
                else
                {
                    pointsObject.unloadCurrentSampleRequest = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleTotalDuration' in jsonObject['points'])
                {
                    pointsObject.currentSampleTotalDuration = (function(){
                        if(typeof jsonObject['points'].currentSampleTotalDuration !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleTotalDuration)) ? Number(jsonObject['points'].currentSampleTotalDuration) : Math.floor(Number(jsonObject['points'].currentSampleTotalDuration));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleTotalDuration) ? jsonObject['points'].currentSampleTotalDuration : Math.floor(jsonObject['points'].currentSampleTotalDuration);
                    }());
                }
                else
                {
                    pointsObject.currentSampleTotalDuration = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleWarmUpDuration' in jsonObject['points'])
                {
                    pointsObject.currentSampleWarmUpDuration = (function(){
                        if(typeof jsonObject['points'].currentSampleWarmUpDuration !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleWarmUpDuration)) ? Number(jsonObject['points'].currentSampleWarmUpDuration) : Math.floor(Number(jsonObject['points'].currentSampleWarmUpDuration));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleWarmUpDuration) ? jsonObject['points'].currentSampleWarmUpDuration : Math.floor(jsonObject['points'].currentSampleWarmUpDuration);
                    }());
                }
                else
                {
                    pointsObject.currentSampleWarmUpDuration = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleWarmUpRateOfChange' in jsonObject['points'])
                {
                    pointsObject.currentSampleWarmUpRateOfChange = (function(){
                        if(typeof jsonObject['points'].currentSampleWarmUpRateOfChange !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleWarmUpRateOfChange)) ? Number(jsonObject['points'].currentSampleWarmUpRateOfChange) : Math.floor(Number(jsonObject['points'].currentSampleWarmUpRateOfChange));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleWarmUpRateOfChange) ? jsonObject['points'].currentSampleWarmUpRateOfChange : Math.floor(jsonObject['points'].currentSampleWarmUpRateOfChange);
                    }());
                }
                else
                {
                    pointsObject.currentSampleWarmUpRateOfChange = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleWarmUpWarning' in jsonObject['points'])
                {
                    pointsObject.currentSampleWarmUpWarning = (function(){
                        if(typeof jsonObject['points'].currentSampleWarmUpWarning !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleWarmUpWarning)) ? Number(jsonObject['points'].currentSampleWarmUpWarning) : Math.floor(Number(jsonObject['points'].currentSampleWarmUpWarning));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleWarmUpWarning) ? jsonObject['points'].currentSampleWarmUpWarning : Math.floor(jsonObject['points'].currentSampleWarmUpWarning);
                    }());
                }
                else
                {
                    pointsObject.currentSampleWarmUpWarning = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleWarmUpCompleted' in jsonObject['points'])
                {
                    pointsObject.currentSampleWarmUpCompleted = (function(){
                        if(typeof jsonObject['points'].currentSampleWarmUpCompleted !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleWarmUpCompleted)) ? Number(jsonObject['points'].currentSampleWarmUpCompleted) : Math.floor(Number(jsonObject['points'].currentSampleWarmUpCompleted));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleWarmUpCompleted) ? jsonObject['points'].currentSampleWarmUpCompleted : Math.floor(jsonObject['points'].currentSampleWarmUpCompleted);
                    }());
                }
                else
                {
                    pointsObject.currentSampleWarmUpCompleted = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleBelowTargetDuration' in jsonObject['points'])
                {
                    pointsObject.currentSampleBelowTargetDuration = (function(){
                        if(typeof jsonObject['points'].currentSampleBelowTargetDuration !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleBelowTargetDuration)) ? Number(jsonObject['points'].currentSampleBelowTargetDuration) : Math.floor(Number(jsonObject['points'].currentSampleBelowTargetDuration));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleBelowTargetDuration) ? jsonObject['points'].currentSampleBelowTargetDuration : Math.floor(jsonObject['points'].currentSampleBelowTargetDuration);
                    }());
                }
                else
                {
                    pointsObject.currentSampleBelowTargetDuration = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleAboveTargetDuration' in jsonObject['points'])
                {
                    pointsObject.currentSampleAboveTargetDuration = (function(){
                        if(typeof jsonObject['points'].currentSampleAboveTargetDuration !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleAboveTargetDuration)) ? Number(jsonObject['points'].currentSampleAboveTargetDuration) : Math.floor(Number(jsonObject['points'].currentSampleAboveTargetDuration));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleAboveTargetDuration) ? jsonObject['points'].currentSampleAboveTargetDuration : Math.floor(jsonObject['points'].currentSampleAboveTargetDuration);
                    }());
                }
                else
                {
                    pointsObject.currentSampleAboveTargetDuration = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleWithinTargetDuration' in jsonObject['points'])
                {
                    pointsObject.currentSampleWithinTargetDuration = (function(){
                        if(typeof jsonObject['points'].currentSampleWithinTargetDuration !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleWithinTargetDuration)) ? Number(jsonObject['points'].currentSampleWithinTargetDuration) : Math.floor(Number(jsonObject['points'].currentSampleWithinTargetDuration));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleWithinTargetDuration) ? jsonObject['points'].currentSampleWithinTargetDuration : Math.floor(jsonObject['points'].currentSampleWithinTargetDuration);
                    }());
                }
                else
                {
                    pointsObject.currentSampleWithinTargetDuration = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleFinishCriteriaMet' in jsonObject['points'])
                {
                    pointsObject.currentSampleFinishCriteriaMet = (function(){
                        if(typeof jsonObject['points'].currentSampleFinishCriteriaMet !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleFinishCriteriaMet)) ? Number(jsonObject['points'].currentSampleFinishCriteriaMet) : Math.floor(Number(jsonObject['points'].currentSampleFinishCriteriaMet));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleFinishCriteriaMet) ? jsonObject['points'].currentSampleFinishCriteriaMet : Math.floor(jsonObject['points'].currentSampleFinishCriteriaMet);
                    }());
                }
                else
                {
                    pointsObject.currentSampleFinishCriteriaMet = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentSampleLatestUnloadTimestamp' in jsonObject['points'])
                {
                    pointsObject.currentSampleLatestUnloadTimestamp = (function(){
                        if(typeof jsonObject['points'].currentSampleLatestUnloadTimestamp !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentSampleLatestUnloadTimestamp)) ? Number(jsonObject['points'].currentSampleLatestUnloadTimestamp) : Math.floor(Number(jsonObject['points'].currentSampleLatestUnloadTimestamp));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentSampleLatestUnloadTimestamp) ? jsonObject['points'].currentSampleLatestUnloadTimestamp : Math.floor(jsonObject['points'].currentSampleLatestUnloadTimestamp);
                    }());
                }
                else
                {
                    pointsObject.currentSampleLatestUnloadTimestamp = 0;
                }
        
                return pointsObject;
            }());
        }
        
        if('labId' in jsonObject)
        {
            model.labId = (function(){
                if(typeof jsonObject['labId'] !== 'string')
                {
                    return String(jsonObject['labId']);
                }
        
                return jsonObject['labId'];
            }());
        }
        
        if('rackId' in jsonObject)
        {
            model.rackId = (function(){
                if(typeof jsonObject['rackId'] !== 'string')
                {
                    return String(jsonObject['rackId']);
                }
        
                return jsonObject['rackId'];
            }());
        }
        
        if('verticalLevelIndex' in jsonObject)
        {
            model.verticalLevelIndex = (function(){
                if(typeof jsonObject['verticalLevelIndex'] !== 'number')
                {
                    return Number.isInteger(Number(jsonObject['verticalLevelIndex'])) ? Number(jsonObject['verticalLevelIndex']) : Math.floor(Number(jsonObject['verticalLevelIndex']));
                }
        
                return Number.isInteger(jsonObject['verticalLevelIndex']) ? jsonObject['verticalLevelIndex'] : Math.floor(jsonObject['verticalLevelIndex']);
            }());
        }
        
        if('horizontalPositionIndex' in jsonObject)
        {
            model.horizontalPositionIndex = (function(){
                if(typeof jsonObject['horizontalPositionIndex'] !== 'number')
                {
                    return Number.isInteger(Number(jsonObject['horizontalPositionIndex'])) ? Number(jsonObject['horizontalPositionIndex']) : Math.floor(Number(jsonObject['horizontalPositionIndex']));
                }
        
                return Number.isInteger(jsonObject['horizontalPositionIndex']) ? jsonObject['horizontalPositionIndex'] : Math.floor(jsonObject['horizontalPositionIndex']);
            }());
        }
        
        if('deleted' in jsonObject)
        {
            model.deleted = (function(){
                if(typeof jsonObject['deleted'] !== 'boolean')
                {
                    return Boolean(jsonObject['deleted']);
                }
        
                return jsonObject['deleted'];
            }());
        }
        
        if('updateTimestamp' in jsonObject)
        {
            model.updateTimestamp = (function(){
                if(typeof jsonObject['updateTimestamp'] !== 'string')
                {
                    return new Date(String(jsonObject['updateTimestamp']));
                }
        
                return new Date(jsonObject['updateTimestamp']);
            }());
        }
        
        return model;
    }
}

export default RackPositionModel;