{"size": 5839, "ext": "js", "max_stars_repo_path": "src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js", "max_stars_repo_name": "ricado-group/js-api-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js", "max_issues_repo_name": "ricado-group/js-api-client", "max_issues_repo_issues_event_min_datetime": "2020-11-04T12:52:35.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-20T18:03:29.000Z", "max_forks_repo_path": "src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js", "max_forks_repo_name": "ricado-group/js-api-client", "max_forks_repo_forks_event_min_datetime": "2022-03-30T18:07:04.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T18:07:04.000Z"}
{"max_stars_count": null, "max_issues_count": 73, "max_forks_count": 1, "avg_line_length": 25.9511111111, "max_line_length": 90, "alphanum_fraction": 0.4473368728}
/**
 * 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 Compac Sizer Outlet Type Change
 * 
 * @class
 * @hideconstructor
 * @extends BaseModel
 */
class CompacSizerOutletTypeChangeModel extends BaseModel
{
    /**
     * CompacSizerOutletTypeChangeModel Constructor
     * 
     * @protected
     */
    constructor()
    {
        super();
        
        /**
         * The Compac Sizer Outlet Type Change ID
         * 
         * @type {string}
         * @public
         */
        this.id = undefined;
        
        /**
         * The Compac Sizer ID this Outlet Type Change is associated with
         * 
         * @type {string}
         * @public
         */
        this.compacSizerId = undefined;
        
        /**
         * The Sizer Outlet Number this Outlet Type Change is associated with
         * 
         * @type {string}
         * @public
         */
        this.outletNumber = undefined;
        
        /**
         * When this Outlet Type Change occurred
         * 
         * @type {Date}
         * @public
         */
        this.createdTimestamp = undefined;
        
        /**
         * The ID of the Previous Type that was active on the Outlet
         * 
         * @type {?string}
         * @public
         */
        this.previousTypeId = undefined;
        
        /**
         * The ID of the New Type that is now active on the Outlet
         * 
         * @type {string}
         * @public
         */
        this.newTypeId = undefined;
        
        /**
         * Whether the Compac Sizer Outlet Type Change has been deleted
         * 
         * @type {boolean}
         * @public
         */
        this.deleted = undefined;
        
        /**
         * When the Compac Sizer Outlet Type Change was last updated
         * 
         * @type {Date}
         * @public
         */
        this.updateTimestamp = undefined;
    }

    /**
     * Create a new **CompacSizerOutletTypeChangeModel** from a JSON Object or JSON String
     * 
     * @static
     * @public
     * @param {Object<string, any>|string} json A JSON Object or JSON String
     * @return {CompacSizerOutletTypeChangeModel}
     */
    static fromJSON(json)
    {
        let model = new CompacSizerOutletTypeChangeModel();
        
        /**
         * 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('compacSizerId' in jsonObject)
        {
            model.compacSizerId = (function(){
                if(typeof jsonObject['compacSizerId'] !== 'string')
                {
                    return String(jsonObject['compacSizerId']);
                }
        
                return jsonObject['compacSizerId'];
            }());
        }
        
        if('outletNumber' in jsonObject)
        {
            model.outletNumber = (function(){
                if(typeof jsonObject['outletNumber'] !== 'string')
                {
                    return String(jsonObject['outletNumber']);
                }
        
                return jsonObject['outletNumber'];
            }());
        }
        
        if('createdTimestamp' in jsonObject)
        {
            model.createdTimestamp = (function(){
                if(typeof jsonObject['createdTimestamp'] !== 'string')
                {
                    return new Date(String(jsonObject['createdTimestamp']));
                }
        
                return new Date(jsonObject['createdTimestamp']);
            }());
        }
        
        if('previousTypeId' in jsonObject)
        {
            model.previousTypeId = (function(){
                if(jsonObject['previousTypeId'] === null)
                {
                    return null;
                }
        
                if(typeof jsonObject['previousTypeId'] !== 'string')
                {
                    return String(jsonObject['previousTypeId']);
                }
        
                return jsonObject['previousTypeId'];
            }());
        }
        
        if('newTypeId' in jsonObject)
        {
            model.newTypeId = (function(){
                if(typeof jsonObject['newTypeId'] !== 'string')
                {
                    return String(jsonObject['newTypeId']);
                }
        
                return jsonObject['newTypeId'];
            }());
        }
        
        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 CompacSizerOutletTypeChangeModel;