RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

source

Models/Packhouse/Site/MAFSizerModel.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 MAF Sizer
 * 
 * @class
 * @hideconstructor
 * @extends BaseModel
 */
class MAFSizerModel extends BaseModel
{
    /**
     * MAFSizerModel Constructor
     * 
     * @protected
     * @param {number} siteId The Site ID associated with this MAF Sizer
     */
    constructor(siteId)
    {
        super();
        
        /**
         * The MAF Sizer ID
         * 
         * @type {string}
         * @public
         */
        this.id = "";
        
        /**
         * The RTU this MAF Sizer belongs to
         * 
         * @type {?number}
         * @public
         */
        this.rtuId = null;
        
        /**
         * The MAF Sizer Name
         * 
         * @type {string}
         * @public
         */
        this.name = "";
        
        /**
         * The Packing Line ID that manages this MAF Sizer
         * 
         * @type {string}
         * @public
         */
        this.packingLineId = "";
        
        /**
         * The Sizer Type
         * 
         * @type {string}
         * @public
         */
        this.sizerType = "";
        
        /**
         * The Auto Create Batch Delay in Seconds for this MAF Sizer
         * 
         * @type {number}
         * @public
         */
        this.autoCreateBatchDelay = 0;
        
        /**
         * The Points used by this MAF Sizer
         * 
         * @type {{currentBatchId: number, currentBatchName: number, currentBatchGrowerCode: number, currentBatchGrowerName: number, currentBatchVarietyCode: number, currentBatchVarietyName: number, currentBatchPackrunId: number, currentBatchPackrunName: number, machineAverageFruitWeight: number, machineAverageFruitSize: number, machineCupFill: number, machineRecycledFruitPerMinute: number, machineTotalFruitPerMinute: number, machineTraysPerHour: number, machineTonnesPerHour: number, machineRodsPerMinute: number, outletGroupSummaries: number, packTypeOutletUtilizationTargets: number, class1TraysPerHour: ?number, createNewBatchRequest: ?number, createBatchOnPackrunChange: ?number, createBatchOnTimeBatchChange: ?number, restartServiceRequest: ?number}}
         * @public
         */
        this.points = (function(){
            let pointsDefaultValue = {};
            
            pointsDefaultValue.currentBatchId = 0;
            
            pointsDefaultValue.currentBatchName = 0;
            
            pointsDefaultValue.currentBatchGrowerCode = 0;
            
            pointsDefaultValue.currentBatchGrowerName = 0;
            
            pointsDefaultValue.currentBatchVarietyCode = 0;
            
            pointsDefaultValue.currentBatchVarietyName = 0;
            
            pointsDefaultValue.currentBatchPackrunId = 0;
            
            pointsDefaultValue.currentBatchPackrunName = 0;
            
            pointsDefaultValue.machineAverageFruitWeight = 0;
            
            pointsDefaultValue.machineAverageFruitSize = 0;
            
            pointsDefaultValue.machineCupFill = 0;
            
            pointsDefaultValue.machineRecycledFruitPerMinute = 0;
            
            pointsDefaultValue.machineTotalFruitPerMinute = 0;
            
            pointsDefaultValue.machineTraysPerHour = 0;
            
            pointsDefaultValue.machineTonnesPerHour = 0;
            
            pointsDefaultValue.machineRodsPerMinute = 0;
            
            pointsDefaultValue.outletGroupSummaries = 0;
            
            pointsDefaultValue.packTypeOutletUtilizationTargets = 0;
            
            pointsDefaultValue.class1TraysPerHour = null;
            
            pointsDefaultValue.createNewBatchRequest = null;
            
            pointsDefaultValue.createBatchOnPackrunChange = null;
            
            pointsDefaultValue.createBatchOnTimeBatchChange = null;
            
            pointsDefaultValue.restartServiceRequest = null;
            
            return pointsDefaultValue;
        }());
        
        /**
         * The Lanes defined for this MAF Sizer
         * 
         * @type {Array<{id: string, number: number, points: {cupFill: number}}>}
         * @public
         */
        this.lanes = [];
        
        /**
         * The Outlets defined for this MAF Sizer
         * 
         * @type {Array<{id: string, number: number, type: string, points: {name: number, fruitPerMinute: number, articleName: number, utilization: number}}>}
         * @public
         */
        this.outlets = [];
        
        /**
         * The Fruit Sizes defined and handled by this MAF Sizer
         * 
         * @type {Array<{fruitSize: string, points: {incomingFruitPerMinute: number, recycledFruitPerMinute: number, allocatedFruitPerMinute: number}}>}
         * @public
         */
        this.fruitSizes = [];
        
        /**
         * The FreshPack Integration Configuration for this MAF Sizer
         * 
         * @type {?{points: Object, enabled: boolean, materialGroupId: number, binTypeId: number, bulkWeightClassTypes: string[]}}
         * @public
         */
        this.freshPackIntegration = null;
        
        /**
         * The MAF Integration Configuration for this MAF Sizer
         * 
         * @type {?{points: {stopBatchRequired: number}, enabled: boolean, sizerNumber: number, dumpSizerName: string, statSizerName: string}}
         * @public
         */
        this.mafIntegration = null;
        
        /**
         * An Array of Sources that deliver Fruit to this MAF Sizer
         * 
         * @type {Array<{type: string, riserId: string}|{type: string, sizerId: string, outletNumbers: number[]}>}
         * @public
         */
        this.sources = [];
        
        /**
         * An Array of Article to Class Type Maps for this MAF Sizer
         * 
         * @type {Array<{articleName: string, classType: string}>}
         * @public
         */
        this.articleClassTypes = [];
        
        /**
         * Whether the MAF Sizer has been deleted
         * 
         * @type {boolean}
         * @public
         */
        this.deleted = false;
        
        /**
         * When the MAF Sizer was last updated
         * 
         * @type {Date}
         * @public
         */
        this.updateTimestamp = new Date();
        
        /**
         * The Site ID associated with this MAF Sizer
         * 
         * @type {number}
         * @public
         */
        this.siteId = siteId;
    }

    /**
     * Create a new **MAFSizerModel** 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 MAF Sizer
     * @return {MAFSizerModel}
     */
    static fromJSON(json, siteId)
    {
        let model = new MAFSizerModel(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('packingLineId' in jsonObject)
        {
            model.packingLineId = (function(){
                if(typeof jsonObject['packingLineId'] !== 'string')
                {
                    return String(jsonObject['packingLineId']);
                }
        
                return jsonObject['packingLineId'];
            }());
        }
        
        if('sizerType' in jsonObject)
        {
            model.sizerType = (function(){
                if(typeof jsonObject['sizerType'] !== 'string')
                {
                    return String(jsonObject['sizerType']);
                }
        
                return jsonObject['sizerType'];
            }());
        }
        
        if('autoCreateBatchDelay' in jsonObject)
        {
            model.autoCreateBatchDelay = (function(){
                if(typeof jsonObject['autoCreateBatchDelay'] !== 'number')
                {
                    return Number.isInteger(Number(jsonObject['autoCreateBatchDelay'])) ? Number(jsonObject['autoCreateBatchDelay']) : Math.floor(Number(jsonObject['autoCreateBatchDelay']));
                }
        
                return Number.isInteger(jsonObject['autoCreateBatchDelay']) ? jsonObject['autoCreateBatchDelay'] : Math.floor(jsonObject['autoCreateBatchDelay']);
            }());
        }
        
        if('points' in jsonObject)
        {
            model.points = (function(){
                let pointsObject = {};
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchId' in jsonObject['points'])
                {
                    pointsObject.currentBatchId = (function(){
                        if(typeof jsonObject['points'].currentBatchId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchId)) ? Number(jsonObject['points'].currentBatchId) : Math.floor(Number(jsonObject['points'].currentBatchId));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchId) ? jsonObject['points'].currentBatchId : Math.floor(jsonObject['points'].currentBatchId);
                    }());
                }
                else
                {
                    pointsObject.currentBatchId = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchName' in jsonObject['points'])
                {
                    pointsObject.currentBatchName = (function(){
                        if(typeof jsonObject['points'].currentBatchName !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchName)) ? Number(jsonObject['points'].currentBatchName) : Math.floor(Number(jsonObject['points'].currentBatchName));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchName) ? jsonObject['points'].currentBatchName : Math.floor(jsonObject['points'].currentBatchName);
                    }());
                }
                else
                {
                    pointsObject.currentBatchName = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchGrowerCode' in jsonObject['points'])
                {
                    pointsObject.currentBatchGrowerCode = (function(){
                        if(typeof jsonObject['points'].currentBatchGrowerCode !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchGrowerCode)) ? Number(jsonObject['points'].currentBatchGrowerCode) : Math.floor(Number(jsonObject['points'].currentBatchGrowerCode));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchGrowerCode) ? jsonObject['points'].currentBatchGrowerCode : Math.floor(jsonObject['points'].currentBatchGrowerCode);
                    }());
                }
                else
                {
                    pointsObject.currentBatchGrowerCode = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchGrowerName' in jsonObject['points'])
                {
                    pointsObject.currentBatchGrowerName = (function(){
                        if(typeof jsonObject['points'].currentBatchGrowerName !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchGrowerName)) ? Number(jsonObject['points'].currentBatchGrowerName) : Math.floor(Number(jsonObject['points'].currentBatchGrowerName));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchGrowerName) ? jsonObject['points'].currentBatchGrowerName : Math.floor(jsonObject['points'].currentBatchGrowerName);
                    }());
                }
                else
                {
                    pointsObject.currentBatchGrowerName = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchVarietyCode' in jsonObject['points'])
                {
                    pointsObject.currentBatchVarietyCode = (function(){
                        if(typeof jsonObject['points'].currentBatchVarietyCode !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchVarietyCode)) ? Number(jsonObject['points'].currentBatchVarietyCode) : Math.floor(Number(jsonObject['points'].currentBatchVarietyCode));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchVarietyCode) ? jsonObject['points'].currentBatchVarietyCode : Math.floor(jsonObject['points'].currentBatchVarietyCode);
                    }());
                }
                else
                {
                    pointsObject.currentBatchVarietyCode = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchVarietyName' in jsonObject['points'])
                {
                    pointsObject.currentBatchVarietyName = (function(){
                        if(typeof jsonObject['points'].currentBatchVarietyName !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchVarietyName)) ? Number(jsonObject['points'].currentBatchVarietyName) : Math.floor(Number(jsonObject['points'].currentBatchVarietyName));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchVarietyName) ? jsonObject['points'].currentBatchVarietyName : Math.floor(jsonObject['points'].currentBatchVarietyName);
                    }());
                }
                else
                {
                    pointsObject.currentBatchVarietyName = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchPackrunId' in jsonObject['points'])
                {
                    pointsObject.currentBatchPackrunId = (function(){
                        if(typeof jsonObject['points'].currentBatchPackrunId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunId)) ? Number(jsonObject['points'].currentBatchPackrunId) : Math.floor(Number(jsonObject['points'].currentBatchPackrunId));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchPackrunId) ? jsonObject['points'].currentBatchPackrunId : Math.floor(jsonObject['points'].currentBatchPackrunId);
                    }());
                }
                else
                {
                    pointsObject.currentBatchPackrunId = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'currentBatchPackrunName' in jsonObject['points'])
                {
                    pointsObject.currentBatchPackrunName = (function(){
                        if(typeof jsonObject['points'].currentBatchPackrunName !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunName)) ? Number(jsonObject['points'].currentBatchPackrunName) : Math.floor(Number(jsonObject['points'].currentBatchPackrunName));
                        }
        
                        return Number.isInteger(jsonObject['points'].currentBatchPackrunName) ? jsonObject['points'].currentBatchPackrunName : Math.floor(jsonObject['points'].currentBatchPackrunName);
                    }());
                }
                else
                {
                    pointsObject.currentBatchPackrunName = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineAverageFruitWeight' in jsonObject['points'])
                {
                    pointsObject.machineAverageFruitWeight = (function(){
                        if(typeof jsonObject['points'].machineAverageFruitWeight !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineAverageFruitWeight)) ? Number(jsonObject['points'].machineAverageFruitWeight) : Math.floor(Number(jsonObject['points'].machineAverageFruitWeight));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineAverageFruitWeight) ? jsonObject['points'].machineAverageFruitWeight : Math.floor(jsonObject['points'].machineAverageFruitWeight);
                    }());
                }
                else
                {
                    pointsObject.machineAverageFruitWeight = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineAverageFruitSize' in jsonObject['points'])
                {
                    pointsObject.machineAverageFruitSize = (function(){
                        if(typeof jsonObject['points'].machineAverageFruitSize !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineAverageFruitSize)) ? Number(jsonObject['points'].machineAverageFruitSize) : Math.floor(Number(jsonObject['points'].machineAverageFruitSize));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineAverageFruitSize) ? jsonObject['points'].machineAverageFruitSize : Math.floor(jsonObject['points'].machineAverageFruitSize);
                    }());
                }
                else
                {
                    pointsObject.machineAverageFruitSize = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineCupFill' in jsonObject['points'])
                {
                    pointsObject.machineCupFill = (function(){
                        if(typeof jsonObject['points'].machineCupFill !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineCupFill)) ? Number(jsonObject['points'].machineCupFill) : Math.floor(Number(jsonObject['points'].machineCupFill));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineCupFill) ? jsonObject['points'].machineCupFill : Math.floor(jsonObject['points'].machineCupFill);
                    }());
                }
                else
                {
                    pointsObject.machineCupFill = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineRecycledFruitPerMinute' in jsonObject['points'])
                {
                    pointsObject.machineRecycledFruitPerMinute = (function(){
                        if(typeof jsonObject['points'].machineRecycledFruitPerMinute !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineRecycledFruitPerMinute)) ? Number(jsonObject['points'].machineRecycledFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineRecycledFruitPerMinute));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineRecycledFruitPerMinute) ? jsonObject['points'].machineRecycledFruitPerMinute : Math.floor(jsonObject['points'].machineRecycledFruitPerMinute);
                    }());
                }
                else
                {
                    pointsObject.machineRecycledFruitPerMinute = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineTotalFruitPerMinute' in jsonObject['points'])
                {
                    pointsObject.machineTotalFruitPerMinute = (function(){
                        if(typeof jsonObject['points'].machineTotalFruitPerMinute !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineTotalFruitPerMinute)) ? Number(jsonObject['points'].machineTotalFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineTotalFruitPerMinute));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineTotalFruitPerMinute) ? jsonObject['points'].machineTotalFruitPerMinute : Math.floor(jsonObject['points'].machineTotalFruitPerMinute);
                    }());
                }
                else
                {
                    pointsObject.machineTotalFruitPerMinute = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineTraysPerHour' in jsonObject['points'])
                {
                    pointsObject.machineTraysPerHour = (function(){
                        if(typeof jsonObject['points'].machineTraysPerHour !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineTraysPerHour)) ? Number(jsonObject['points'].machineTraysPerHour) : Math.floor(Number(jsonObject['points'].machineTraysPerHour));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineTraysPerHour) ? jsonObject['points'].machineTraysPerHour : Math.floor(jsonObject['points'].machineTraysPerHour);
                    }());
                }
                else
                {
                    pointsObject.machineTraysPerHour = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineTonnesPerHour' in jsonObject['points'])
                {
                    pointsObject.machineTonnesPerHour = (function(){
                        if(typeof jsonObject['points'].machineTonnesPerHour !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineTonnesPerHour)) ? Number(jsonObject['points'].machineTonnesPerHour) : Math.floor(Number(jsonObject['points'].machineTonnesPerHour));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineTonnesPerHour) ? jsonObject['points'].machineTonnesPerHour : Math.floor(jsonObject['points'].machineTonnesPerHour);
                    }());
                }
                else
                {
                    pointsObject.machineTonnesPerHour = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'machineRodsPerMinute' in jsonObject['points'])
                {
                    pointsObject.machineRodsPerMinute = (function(){
                        if(typeof jsonObject['points'].machineRodsPerMinute !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].machineRodsPerMinute)) ? Number(jsonObject['points'].machineRodsPerMinute) : Math.floor(Number(jsonObject['points'].machineRodsPerMinute));
                        }
        
                        return Number.isInteger(jsonObject['points'].machineRodsPerMinute) ? jsonObject['points'].machineRodsPerMinute : Math.floor(jsonObject['points'].machineRodsPerMinute);
                    }());
                }
                else
                {
                    pointsObject.machineRodsPerMinute = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'outletGroupSummaries' in jsonObject['points'])
                {
                    pointsObject.outletGroupSummaries = (function(){
                        if(typeof jsonObject['points'].outletGroupSummaries !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].outletGroupSummaries)) ? Number(jsonObject['points'].outletGroupSummaries) : Math.floor(Number(jsonObject['points'].outletGroupSummaries));
                        }
        
                        return Number.isInteger(jsonObject['points'].outletGroupSummaries) ? jsonObject['points'].outletGroupSummaries : Math.floor(jsonObject['points'].outletGroupSummaries);
                    }());
                }
                else
                {
                    pointsObject.outletGroupSummaries = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'packTypeOutletUtilizationTargets' in jsonObject['points'])
                {
                    pointsObject.packTypeOutletUtilizationTargets = (function(){
                        if(typeof jsonObject['points'].packTypeOutletUtilizationTargets !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].packTypeOutletUtilizationTargets)) ? Number(jsonObject['points'].packTypeOutletUtilizationTargets) : Math.floor(Number(jsonObject['points'].packTypeOutletUtilizationTargets));
                        }
        
                        return Number.isInteger(jsonObject['points'].packTypeOutletUtilizationTargets) ? jsonObject['points'].packTypeOutletUtilizationTargets : Math.floor(jsonObject['points'].packTypeOutletUtilizationTargets);
                    }());
                }
                else
                {
                    pointsObject.packTypeOutletUtilizationTargets = 0;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'class1TraysPerHour' in jsonObject['points'])
                {
                    pointsObject.class1TraysPerHour = (function(){
                        if(jsonObject['points'].class1TraysPerHour === null)
                        {
                            return null;
                        }
        
                        if(typeof jsonObject['points'].class1TraysPerHour !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].class1TraysPerHour)) ? Number(jsonObject['points'].class1TraysPerHour) : Math.floor(Number(jsonObject['points'].class1TraysPerHour));
                        }
        
                        return Number.isInteger(jsonObject['points'].class1TraysPerHour) ? jsonObject['points'].class1TraysPerHour : Math.floor(jsonObject['points'].class1TraysPerHour);
                    }());
                }
                else
                {
                    pointsObject.class1TraysPerHour = null;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'createNewBatchRequest' in jsonObject['points'])
                {
                    pointsObject.createNewBatchRequest = (function(){
                        if(jsonObject['points'].createNewBatchRequest === null)
                        {
                            return null;
                        }
        
                        if(typeof jsonObject['points'].createNewBatchRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].createNewBatchRequest)) ? Number(jsonObject['points'].createNewBatchRequest) : Math.floor(Number(jsonObject['points'].createNewBatchRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].createNewBatchRequest) ? jsonObject['points'].createNewBatchRequest : Math.floor(jsonObject['points'].createNewBatchRequest);
                    }());
                }
                else
                {
                    pointsObject.createNewBatchRequest = null;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'createBatchOnPackrunChange' in jsonObject['points'])
                {
                    pointsObject.createBatchOnPackrunChange = (function(){
                        if(jsonObject['points'].createBatchOnPackrunChange === null)
                        {
                            return null;
                        }
        
                        if(typeof jsonObject['points'].createBatchOnPackrunChange !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].createBatchOnPackrunChange)) ? Number(jsonObject['points'].createBatchOnPackrunChange) : Math.floor(Number(jsonObject['points'].createBatchOnPackrunChange));
                        }
        
                        return Number.isInteger(jsonObject['points'].createBatchOnPackrunChange) ? jsonObject['points'].createBatchOnPackrunChange : Math.floor(jsonObject['points'].createBatchOnPackrunChange);
                    }());
                }
                else
                {
                    pointsObject.createBatchOnPackrunChange = null;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'createBatchOnTimeBatchChange' in jsonObject['points'])
                {
                    pointsObject.createBatchOnTimeBatchChange = (function(){
                        if(jsonObject['points'].createBatchOnTimeBatchChange === null)
                        {
                            return null;
                        }
        
                        if(typeof jsonObject['points'].createBatchOnTimeBatchChange !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].createBatchOnTimeBatchChange)) ? Number(jsonObject['points'].createBatchOnTimeBatchChange) : Math.floor(Number(jsonObject['points'].createBatchOnTimeBatchChange));
                        }
        
                        return Number.isInteger(jsonObject['points'].createBatchOnTimeBatchChange) ? jsonObject['points'].createBatchOnTimeBatchChange : Math.floor(jsonObject['points'].createBatchOnTimeBatchChange);
                    }());
                }
                else
                {
                    pointsObject.createBatchOnTimeBatchChange = null;
                }
                
                if(typeof jsonObject['points'] === 'object' && 'restartServiceRequest' in jsonObject['points'])
                {
                    pointsObject.restartServiceRequest = (function(){
                        if(jsonObject['points'].restartServiceRequest === null)
                        {
                            return null;
                        }
        
                        if(typeof jsonObject['points'].restartServiceRequest !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['points'].restartServiceRequest)) ? Number(jsonObject['points'].restartServiceRequest) : Math.floor(Number(jsonObject['points'].restartServiceRequest));
                        }
        
                        return Number.isInteger(jsonObject['points'].restartServiceRequest) ? jsonObject['points'].restartServiceRequest : Math.floor(jsonObject['points'].restartServiceRequest);
                    }());
                }
                else
                {
                    pointsObject.restartServiceRequest = null;
                }
        
                return pointsObject;
            }());
        }
        
        if('lanes' in jsonObject)
        {
            model.lanes = (function(){
                if(Array.isArray(jsonObject['lanes']) !== true)
                {
                    return [];
                }
        
                return jsonObject['lanes'].map((lanesItem) => {
                    return (function(){
                        let lanesItemObject = {};
                        
                        if(typeof lanesItem === 'object' && 'id' in lanesItem)
                        {
                            lanesItemObject.id = (function(){
                                if(typeof lanesItem.id !== 'string')
                                {
                                    return String(lanesItem.id);
                                }
        
                                return lanesItem.id;
                            }());
                        }
                        else
                        {
                            lanesItemObject.id = "";
                        }
                        
                        if(typeof lanesItem === 'object' && 'number' in lanesItem)
                        {
                            lanesItemObject.number = (function(){
                                if(typeof lanesItem.number !== 'number')
                                {
                                    return Number.isInteger(Number(lanesItem.number)) ? Number(lanesItem.number) : Math.floor(Number(lanesItem.number));
                                }
        
                                return Number.isInteger(lanesItem.number) ? lanesItem.number : Math.floor(lanesItem.number);
                            }());
                        }
                        else
                        {
                            lanesItemObject.number = 0;
                        }
                        
                        if(typeof lanesItem === 'object' && 'points' in lanesItem)
                        {
                            lanesItemObject.points = (function(){
                                let pointsObject = {};
                                
                                if(typeof lanesItem.points === 'object' && 'cupFill' in lanesItem.points)
                                {
                                    pointsObject.cupFill = (function(){
                                        if(typeof lanesItem.points.cupFill !== 'number')
                                        {
                                            return Number.isInteger(Number(lanesItem.points.cupFill)) ? Number(lanesItem.points.cupFill) : Math.floor(Number(lanesItem.points.cupFill));
                                        }
        
                                        return Number.isInteger(lanesItem.points.cupFill) ? lanesItem.points.cupFill : Math.floor(lanesItem.points.cupFill);
                                    }());
                                }
                                else
                                {
                                    pointsObject.cupFill = 0;
                                }
        
                                return pointsObject;
                            }());
                        }
                        else
                        {
                            lanesItemObject.points = (function(){
                                let pointsDefaultValue = {};
                                
                                pointsDefaultValue.cupFill = 0;
                                
                                return pointsDefaultValue;
                            }());
                        }
        
                        return lanesItemObject;
                    }());
                });
            }());
        }
        
        if('outlets' in jsonObject)
        {
            model.outlets = (function(){
                if(Array.isArray(jsonObject['outlets']) !== true)
                {
                    return [];
                }
        
                return jsonObject['outlets'].map((outletsItem) => {
                    return (function(){
                        let outletsItemObject = {};
                        
                        if(typeof outletsItem === 'object' && 'id' in outletsItem)
                        {
                            outletsItemObject.id = (function(){
                                if(typeof outletsItem.id !== 'string')
                                {
                                    return String(outletsItem.id);
                                }
        
                                return outletsItem.id;
                            }());
                        }
                        else
                        {
                            outletsItemObject.id = "";
                        }
                        
                        if(typeof outletsItem === 'object' && 'number' in outletsItem)
                        {
                            outletsItemObject.number = (function(){
                                if(typeof outletsItem.number !== 'number')
                                {
                                    return Number.isInteger(Number(outletsItem.number)) ? Number(outletsItem.number) : Math.floor(Number(outletsItem.number));
                                }
        
                                return Number.isInteger(outletsItem.number) ? outletsItem.number : Math.floor(outletsItem.number);
                            }());
                        }
                        else
                        {
                            outletsItemObject.number = 0;
                        }
                        
                        if(typeof outletsItem === 'object' && 'type' in outletsItem)
                        {
                            outletsItemObject.type = (function(){
                                if(typeof outletsItem.type !== 'string')
                                {
                                    return String(outletsItem.type);
                                }
        
                                return outletsItem.type;
                            }());
                        }
                        else
                        {
                            outletsItemObject.type = "";
                        }
                        
                        if(typeof outletsItem === 'object' && 'points' in outletsItem)
                        {
                            outletsItemObject.points = (function(){
                                let pointsObject = {};
                                
                                if(typeof outletsItem.points === 'object' && 'name' in outletsItem.points)
                                {
                                    pointsObject.name = (function(){
                                        if(typeof outletsItem.points.name !== 'number')
                                        {
                                            return Number.isInteger(Number(outletsItem.points.name)) ? Number(outletsItem.points.name) : Math.floor(Number(outletsItem.points.name));
                                        }
        
                                        return Number.isInteger(outletsItem.points.name) ? outletsItem.points.name : Math.floor(outletsItem.points.name);
                                    }());
                                }
                                else
                                {
                                    pointsObject.name = 0;
                                }
                                
                                if(typeof outletsItem.points === 'object' && 'fruitPerMinute' in outletsItem.points)
                                {
                                    pointsObject.fruitPerMinute = (function(){
                                        if(typeof outletsItem.points.fruitPerMinute !== 'number')
                                        {
                                            return Number.isInteger(Number(outletsItem.points.fruitPerMinute)) ? Number(outletsItem.points.fruitPerMinute) : Math.floor(Number(outletsItem.points.fruitPerMinute));
                                        }
        
                                        return Number.isInteger(outletsItem.points.fruitPerMinute) ? outletsItem.points.fruitPerMinute : Math.floor(outletsItem.points.fruitPerMinute);
                                    }());
                                }
                                else
                                {
                                    pointsObject.fruitPerMinute = 0;
                                }
                                
                                if(typeof outletsItem.points === 'object' && 'articleName' in outletsItem.points)
                                {
                                    pointsObject.articleName = (function(){
                                        if(typeof outletsItem.points.articleName !== 'number')
                                        {
                                            return Number.isInteger(Number(outletsItem.points.articleName)) ? Number(outletsItem.points.articleName) : Math.floor(Number(outletsItem.points.articleName));
                                        }
        
                                        return Number.isInteger(outletsItem.points.articleName) ? outletsItem.points.articleName : Math.floor(outletsItem.points.articleName);
                                    }());
                                }
                                else
                                {
                                    pointsObject.articleName = 0;
                                }
                                
                                if(typeof outletsItem.points === 'object' && 'utilization' in outletsItem.points)
                                {
                                    pointsObject.utilization = (function(){
                                        if(typeof outletsItem.points.utilization !== 'number')
                                        {
                                            return Number.isInteger(Number(outletsItem.points.utilization)) ? Number(outletsItem.points.utilization) : Math.floor(Number(outletsItem.points.utilization));
                                        }
        
                                        return Number.isInteger(outletsItem.points.utilization) ? outletsItem.points.utilization : Math.floor(outletsItem.points.utilization);
                                    }());
                                }
                                else
                                {
                                    pointsObject.utilization = 0;
                                }
        
                                return pointsObject;
                            }());
                        }
                        else
                        {
                            outletsItemObject.points = (function(){
                                let pointsDefaultValue = {};
                                
                                pointsDefaultValue.name = 0;
                                
                                pointsDefaultValue.fruitPerMinute = 0;
                                
                                pointsDefaultValue.articleName = 0;
                                
                                pointsDefaultValue.utilization = 0;
                                
                                return pointsDefaultValue;
                            }());
                        }
        
                        return outletsItemObject;
                    }());
                });
            }());
        }
        
        if('fruitSizes' in jsonObject)
        {
            model.fruitSizes = (function(){
                if(Array.isArray(jsonObject['fruitSizes']) !== true)
                {
                    return [];
                }
        
                return jsonObject['fruitSizes'].map((fruitSizesItem) => {
                    return (function(){
                        let fruitSizesItemObject = {};
                        
                        if(typeof fruitSizesItem === 'object' && 'fruitSize' in fruitSizesItem)
                        {
                            fruitSizesItemObject.fruitSize = (function(){
                                if(typeof fruitSizesItem.fruitSize !== 'string')
                                {
                                    return String(fruitSizesItem.fruitSize);
                                }
        
                                return fruitSizesItem.fruitSize;
                            }());
                        }
                        else
                        {
                            fruitSizesItemObject.fruitSize = "";
                        }
                        
                        if(typeof fruitSizesItem === 'object' && 'points' in fruitSizesItem)
                        {
                            fruitSizesItemObject.points = (function(){
                                let pointsObject = {};
                                
                                if(typeof fruitSizesItem.points === 'object' && 'incomingFruitPerMinute' in fruitSizesItem.points)
                                {
                                    pointsObject.incomingFruitPerMinute = (function(){
                                        if(typeof fruitSizesItem.points.incomingFruitPerMinute !== 'number')
                                        {
                                            return Number.isInteger(Number(fruitSizesItem.points.incomingFruitPerMinute)) ? Number(fruitSizesItem.points.incomingFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.incomingFruitPerMinute));
                                        }
        
                                        return Number.isInteger(fruitSizesItem.points.incomingFruitPerMinute) ? fruitSizesItem.points.incomingFruitPerMinute : Math.floor(fruitSizesItem.points.incomingFruitPerMinute);
                                    }());
                                }
                                else
                                {
                                    pointsObject.incomingFruitPerMinute = 0;
                                }
                                
                                if(typeof fruitSizesItem.points === 'object' && 'recycledFruitPerMinute' in fruitSizesItem.points)
                                {
                                    pointsObject.recycledFruitPerMinute = (function(){
                                        if(typeof fruitSizesItem.points.recycledFruitPerMinute !== 'number')
                                        {
                                            return Number.isInteger(Number(fruitSizesItem.points.recycledFruitPerMinute)) ? Number(fruitSizesItem.points.recycledFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.recycledFruitPerMinute));
                                        }
        
                                        return Number.isInteger(fruitSizesItem.points.recycledFruitPerMinute) ? fruitSizesItem.points.recycledFruitPerMinute : Math.floor(fruitSizesItem.points.recycledFruitPerMinute);
                                    }());
                                }
                                else
                                {
                                    pointsObject.recycledFruitPerMinute = 0;
                                }
                                
                                if(typeof fruitSizesItem.points === 'object' && 'allocatedFruitPerMinute' in fruitSizesItem.points)
                                {
                                    pointsObject.allocatedFruitPerMinute = (function(){
                                        if(typeof fruitSizesItem.points.allocatedFruitPerMinute !== 'number')
                                        {
                                            return Number.isInteger(Number(fruitSizesItem.points.allocatedFruitPerMinute)) ? Number(fruitSizesItem.points.allocatedFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.allocatedFruitPerMinute));
                                        }
        
                                        return Number.isInteger(fruitSizesItem.points.allocatedFruitPerMinute) ? fruitSizesItem.points.allocatedFruitPerMinute : Math.floor(fruitSizesItem.points.allocatedFruitPerMinute);
                                    }());
                                }
                                else
                                {
                                    pointsObject.allocatedFruitPerMinute = 0;
                                }
        
                                return pointsObject;
                            }());
                        }
                        else
                        {
                            fruitSizesItemObject.points = (function(){
                                let pointsDefaultValue = {};
                                
                                pointsDefaultValue.incomingFruitPerMinute = 0;
                                
                                pointsDefaultValue.recycledFruitPerMinute = 0;
                                
                                pointsDefaultValue.allocatedFruitPerMinute = 0;
                                
                                return pointsDefaultValue;
                            }());
                        }
        
                        return fruitSizesItemObject;
                    }());
                });
            }());
        }
        
        if('freshPackIntegration' in jsonObject)
        {
            model.freshPackIntegration = (function(){
                if(jsonObject['freshPackIntegration'] === null)
                {
                    return null;
                }
        
                let freshPackIntegrationObject = {};
                
                if(typeof jsonObject['freshPackIntegration'] === 'object' && 'points' in jsonObject['freshPackIntegration'])
                {
                    freshPackIntegrationObject.points = (function(){
                        if(typeof jsonObject['freshPackIntegration'].points !== 'object')
                        {
                            return Object(jsonObject['freshPackIntegration'].points);
                        }
        
                        return jsonObject['freshPackIntegration'].points;
                    }());
                }
                else
                {
                    freshPackIntegrationObject.points = {}
                }
                
                if(typeof jsonObject['freshPackIntegration'] === 'object' && 'enabled' in jsonObject['freshPackIntegration'])
                {
                    freshPackIntegrationObject.enabled = (function(){
                        if(typeof jsonObject['freshPackIntegration'].enabled !== 'boolean')
                        {
                            return Boolean(jsonObject['freshPackIntegration'].enabled);
                        }
        
                        return jsonObject['freshPackIntegration'].enabled;
                    }());
                }
                else
                {
                    freshPackIntegrationObject.enabled = false;
                }
                
                if(typeof jsonObject['freshPackIntegration'] === 'object' && 'materialGroupId' in jsonObject['freshPackIntegration'])
                {
                    freshPackIntegrationObject.materialGroupId = (function(){
                        if(typeof jsonObject['freshPackIntegration'].materialGroupId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['freshPackIntegration'].materialGroupId)) ? Number(jsonObject['freshPackIntegration'].materialGroupId) : Math.floor(Number(jsonObject['freshPackIntegration'].materialGroupId));
                        }
        
                        return Number.isInteger(jsonObject['freshPackIntegration'].materialGroupId) ? jsonObject['freshPackIntegration'].materialGroupId : Math.floor(jsonObject['freshPackIntegration'].materialGroupId);
                    }());
                }
                else
                {
                    freshPackIntegrationObject.materialGroupId = 0;
                }
                
                if(typeof jsonObject['freshPackIntegration'] === 'object' && 'binTypeId' in jsonObject['freshPackIntegration'])
                {
                    freshPackIntegrationObject.binTypeId = (function(){
                        if(typeof jsonObject['freshPackIntegration'].binTypeId !== 'number')
                        {
                            return Number.isInteger(Number(jsonObject['freshPackIntegration'].binTypeId)) ? Number(jsonObject['freshPackIntegration'].binTypeId) : Math.floor(Number(jsonObject['freshPackIntegration'].binTypeId));
                        }
        
                        return Number.isInteger(jsonObject['freshPackIntegration'].binTypeId) ? jsonObject['freshPackIntegration'].binTypeId : Math.floor(jsonObject['freshPackIntegration'].binTypeId);
                    }());
                }
                else
                {
                    freshPackIntegrationObject.binTypeId = 0;
                }
                
                if(typeof jsonObject['freshPackIntegration'] === 'object' && 'bulkWeightClassTypes' in jsonObject['freshPackIntegration'])
                {
                    freshPackIntegrationObject.bulkWeightClassTypes = (function(){
                        if(Array.isArray(jsonObject['freshPackIntegration'].bulkWeightClassTypes) !== true)
                        {
                            return [];
                        }
        
                        return jsonObject['freshPackIntegration'].bulkWeightClassTypes.map((bulkWeightClassTypesItem) => {
                            return (function(){
                                if(typeof bulkWeightClassTypesItem !== 'string')
                                {
                                    return String(bulkWeightClassTypesItem);
                                }
        
                                return bulkWeightClassTypesItem;
                            }());
                        });
                    }());
                }
                else
                {
                    freshPackIntegrationObject.bulkWeightClassTypes = [];
                }
        
                return freshPackIntegrationObject;
            }());
        }
        
        if('mafIntegration' in jsonObject)
        {
            model.mafIntegration = (function(){
                if(jsonObject['mafIntegration'] === null)
                {
                    return null;
                }
        
                let mafIntegrationObject = {};
                
                if(typeof jsonObject['mafIntegration'] === 'object' && 'points' in jsonObject['mafIntegration'])
                {
                    mafIntegrationObject.points = (function(){
                        let pointsObject = {};
                        
                        if(typeof jsonObject['mafIntegration'].points === 'object' && 'stopBatchRequired' in jsonObject['mafIntegration'].points)
                        {
                            pointsObject.stopBatchRequired = (function(){
                                if(typeof jsonObject['mafIntegration'].points.stopBatchRequired !== 'number')
                                {
                                    return Number.isInteger(Number(jsonObject['mafIntegration'].points.stopBatchRequired)) ? Number(jsonObject['mafIntegration'].points.stopBatchRequired) : Math.floor(Number(jsonObject['mafIntegration'].points.stopBatchRequired));
                                }
        
                                return Number.isInteger(jsonObject['mafIntegration'].points.stopBatchRequired) ? jsonObject['mafIntegration'].points.stopBatchRequired : Math.floor(jsonObject['mafIntegration'].points.stopBatchRequired);
                            }());
                        }
                        else
                        {
                            pointsObject.stopBatchRequired = 0;
                        }
        
                        return pointsObject;
                    }());
                }
                else
                {
                    mafIntegrationObject.points = (function(){
                        let pointsDefaultValue = {};
                        
                        pointsDefaultValue.stopBatchRequired = 0;
                        
                        return pointsDefaultValue;
                    }());
                }
                
                if(typeof jsonObject['mafIntegration'] === 'object' && 'enabled' in jsonObject['mafIntegration'])
                {
                    mafIntegrationObject.enabled = (function(){
                        if(typeof jsonObject['mafIntegration'].enabled !== 'boolean')
                        {
                            return Boolean(jsonObject['mafIntegration'].enabled);
                        }
        
                        return jsonObject['mafIntegration'].enabled;
                    }());
                }
                else
                {
                    mafIntegrationObject.enabled = false;
                }
                
                if(typeof jsonObject['mafIntegration'] === 'object' && 'sizerNumber' in jsonObject['mafIntegration'])
                {
                    mafIntegrationObject.sizerNumber = (function(){
                        if(typeof jsonObject['mafIntegration'].sizerNumber !== 'number')
                        {
                            return Number(jsonObject['mafIntegration'].sizerNumber);
                        }
        
                        return jsonObject['mafIntegration'].sizerNumber;
                    }());
                }
                else
                {
                    mafIntegrationObject.sizerNumber = 0;
                }
                
                if(typeof jsonObject['mafIntegration'] === 'object' && 'dumpSizerName' in jsonObject['mafIntegration'])
                {
                    mafIntegrationObject.dumpSizerName = (function(){
                        if(typeof jsonObject['mafIntegration'].dumpSizerName !== 'string')
                        {
                            return String(jsonObject['mafIntegration'].dumpSizerName);
                        }
        
                        return jsonObject['mafIntegration'].dumpSizerName;
                    }());
                }
                else
                {
                    mafIntegrationObject.dumpSizerName = "";
                }
                
                if(typeof jsonObject['mafIntegration'] === 'object' && 'statSizerName' in jsonObject['mafIntegration'])
                {
                    mafIntegrationObject.statSizerName = (function(){
                        if(typeof jsonObject['mafIntegration'].statSizerName !== 'string')
                        {
                            return String(jsonObject['mafIntegration'].statSizerName);
                        }
        
                        return jsonObject['mafIntegration'].statSizerName;
                    }());
                }
                else
                {
                    mafIntegrationObject.statSizerName = "";
                }
        
                return mafIntegrationObject;
            }());
        }
        
        if('sources' in jsonObject)
        {
            model.sources = (function(){
                if(Array.isArray(jsonObject['sources']) !== true)
                {
                    return [];
                }
        
                return jsonObject['sources'].map((sourcesItem) => {
                    return (function(){
                        return sourcesItem;
                    }());
                });
            }());
        }
        
        if('articleClassTypes' in jsonObject)
        {
            model.articleClassTypes = (function(){
                if(Array.isArray(jsonObject['articleClassTypes']) !== true)
                {
                    return [];
                }
        
                return jsonObject['articleClassTypes'].map((articleClassTypesItem) => {
                    return (function(){
                        let articleClassTypesItemObject = {};
                        
                        if(typeof articleClassTypesItem === 'object' && 'articleName' in articleClassTypesItem)
                        {
                            articleClassTypesItemObject.articleName = (function(){
                                if(typeof articleClassTypesItem.articleName !== 'string')
                                {
                                    return String(articleClassTypesItem.articleName);
                                }
        
                                return articleClassTypesItem.articleName;
                            }());
                        }
                        else
                        {
                            articleClassTypesItemObject.articleName = "";
                        }
                        
                        if(typeof articleClassTypesItem === 'object' && 'classType' in articleClassTypesItem)
                        {
                            articleClassTypesItemObject.classType = (function(){
                                if(typeof articleClassTypesItem.classType !== 'string')
                                {
                                    return String(articleClassTypesItem.classType);
                                }
        
                                return articleClassTypesItem.classType;
                            }());
                        }
                        else
                        {
                            articleClassTypesItemObject.classType = "";
                        }
        
                        return articleClassTypesItemObject;
                    }());
                });
            }());
        }
        
        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 MAFSizerModel;