Source: models/OrderHistory.js

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
/* Copyright (c) 2017 Mobify Research & Development Inc. All rights reserved. */
/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

/**
 * OCC No description provided (generated by Swagger Codegen
 * https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: v2
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git Do not edit the class
 * manually.
 *
 */

import ApiClient from '../ApiClient'
import Price from './Price'

/**
* The OrderHistory model module.
* @module models/OrderHistory
* @version v2
*/
export default class OrderHistory {
    /**
    * Constructs a new <code>OrderHistory</code>.
    * @alias module:models/OrderHistory
    * @class
    */

    constructor() {
        /**
    *
    * @member {String} code
    */
        this.code = undefined
        /**
    *
    * @member {String} status
    */
        this.status = undefined
        /**
    *
    * @member {String} statusDisplay
    */
        this.statusDisplay = undefined
        /**
    *
    * @member {String} placed
    */
        this.placed = undefined
        /**
    *
    * @member {String} guid
    */
        this.guid = undefined
        /**
    * @member {module:models/Price} total
    */
        this.total = undefined
    }

    /**
    * Constructs a <code>OrderHistory</code> from a plain JavaScript
    * object, optionally creating a new instance. Copies all relevant properties
    * from <code>data</code> to <code>obj</code> if supplied or a new instance
    * if not.
    * @param {Object} data The plain JavaScript object bearing properties of
    * interest.
    * @param {module:models/OrderHistory} obj Optional instance to
    * populate.
    * @return {module:models/OrderHistory} The populated
    * <code>OrderHistory</code> instance.
    */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new OrderHistory()

            if (data.hasOwnProperty('code')) {
                obj.code = ApiClient.convertToType(data.code, 'String')
            }
            if (data.hasOwnProperty('status')) {
                obj.status = ApiClient.convertToType(data.status, 'String')
            }
            if (data.hasOwnProperty('statusDisplay')) {
                obj.statusDisplay = ApiClient.convertToType(data.statusDisplay, 'String')
            }
            if (data.hasOwnProperty('placed')) {
                obj.placed = ApiClient.convertToType(data.placed, 'String')
            }
            if (data.hasOwnProperty('guid')) {
                obj.guid = ApiClient.convertToType(data.guid, 'String')
            }
            if (data.hasOwnProperty('total')) {
                obj.total = Price.constructFromObject(data.total)
            }
        }
        return obj
    }



}