/**
 * OpenAPI Petstore
 * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import ApiClient from '../ApiClient';

/**
 * The Order model module.
 * @module model/Order
 * @version 1.0.0
 */
class Order {
    /**
     * @member {Number} id
     * @type {Number}
     */
    id;
    /**
     * @member {Number} petId
     * @type {Number}
     */
    petId;
    /**
     * @member {Number} quantity
     * @type {Number}
     */
    quantity;
    /**
     * @member {Date} shipDate
     * @type {Date}
     */
    shipDate;
    /**
     * @member {Order.StatusEnum} status
     * @type {Order.StatusEnum}
     */
    status;
    /**
     * @member {Boolean} complete
     * @type {Boolean}
     * @default false
     */
    complete = false;

    

    /**
     * Constructs a new <code>Order</code>.
     * An order for a pets from the pet store
     * @alias module:model/Order
     */
    constructor() { 
        
        Order.initialize(this);
    }

    /**
     * Initializes the fields of this object.
     * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
     * Only for internal use.
     */
    static initialize(obj) { 
    }

    /**
     * Constructs a <code>Order</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:model/Order} obj Optional instance to populate.
     * @return {module:model/Order} The populated <code>Order</code> instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new Order();

            if (data.hasOwnProperty('id')) {
                obj['id'] = ApiClient.convertToType(data['id'], 'Number');
            }
            if (data.hasOwnProperty('petId')) {
                obj['petId'] = ApiClient.convertToType(data['petId'], 'Number');
            }
            if (data.hasOwnProperty('quantity')) {
                obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number');
            }
            if (data.hasOwnProperty('shipDate')) {
                obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date');
            }
            if (data.hasOwnProperty('status')) {
                obj['status'] = ApiClient.convertToType(data['status'], 'String');
            }
            if (data.hasOwnProperty('complete')) {
                obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean');
            }
        }
        return obj;
    }
}


/**
 * Allowed values for the <code>status</code> property.
 * @enum {String}
 * @readonly
 */
Order['StatusEnum'] = {

    /**
     * value: "placed"
     * @const
     */
    "placed": "placed",

    /**
     * value: "approved"
     * @const
     */
    "approved": "approved",

    /**
     * value: "delivered"
     * @const
     */
    "delivered": "delivered"
};



export default Order;

