Source: models/Variant.js

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

/**
 * Shop API
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 20.4
 *
 *
 * 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'





/**
* The Variant model module.
* @module models/Variant
* @version 20.4
*/
export default class Variant {
    /**
    * Constructs a new <code>Variant</code>.
    * Document representing a product variation.
    * @alias module:models/Variant
    * @class
    * @param link {String} The URL addressing the product.
    * @param productId {String} The id (SKU) of the variant.
    */

    constructor(link, productId) {





        this.link = link; this.product_id = productId


    }

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





            if (data.hasOwnProperty('link')) {
                obj.link = ApiClient.convertToType(data.link, 'String')
            }
            if (data.hasOwnProperty('orderable')) {
                obj.orderable = ApiClient.convertToType(data.orderable, 'Boolean')
            }
            if (data.hasOwnProperty('price')) {
                obj.price = ApiClient.convertToType(data.price, 'Number')
            }
            if (data.hasOwnProperty('product_id')) {
                obj.product_id = ApiClient.convertToType(data.product_id, 'String')
            }
            if (data.hasOwnProperty('variation_values')) {
                obj.variation_values = ApiClient.convertToType(data.variation_values, {String: 'String'})
            }
        }
        return obj
    }

    /**
    * The URL addressing the product.
    * @member {String} link
    */
    link = undefined;
    /**
    * A flag indicating whether the variant is orderable.
    * @member {Boolean} orderable
    */
    orderable = undefined;
    /**
    * The sales price of the variant.
    * @member {Number} price
    */
    price = undefined;
    /**
    * The id (SKU) of the variant.
    * @member {String} product_id
    */
    product_id = undefined;
    /**
    * The actual variation attribute id - value pairs.
    * @member {Object.<String, String>} variation_values
    */
    variation_values = undefined;








}