Source: models/Customer.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'
import CustomerAddress from './CustomerAddress'
import CustomerPaymentInstrument from './CustomerPaymentInstrument'





/**
* The Customer model module.
* @module models/Customer
* @version 20.4
*/
export default class Customer {
    /**
    * Constructs a new <code>Customer</code>.
    * Document representing a customer.
    * @alias module:models/Customer
    * @class
    */

    constructor() {








    }

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





            if (data.hasOwnProperty('addresses')) {
                obj.addresses = ApiClient.convertToType(data.addresses, [CustomerAddress])
            }
            if (data.hasOwnProperty('auth_type')) {
                obj.auth_type = ApiClient.convertToType(data.auth_type, 'String')
            }
            if (data.hasOwnProperty('birthday')) {
                obj.birthday = ApiClient.convertToType(data.birthday, 'Date')
            }
            if (data.hasOwnProperty('c_familyStatus')) {
                obj.c_familyStatus = ApiClient.convertToType(data.c_familyStatus, 'String')
            }
            if (data.hasOwnProperty('company_name')) {
                obj.company_name = ApiClient.convertToType(data.company_name, 'String')
            }
            if (data.hasOwnProperty('creation_date')) {
                obj.creation_date = ApiClient.convertToType(data.creation_date, 'Date')
            }
            if (data.hasOwnProperty('customer_id')) {
                obj.customer_id = ApiClient.convertToType(data.customer_id, 'String')
            }
            if (data.hasOwnProperty('customer_no')) {
                obj.customer_no = ApiClient.convertToType(data.customer_no, 'String')
            }
            if (data.hasOwnProperty('email')) {
                obj.email = ApiClient.convertToType(data.email, 'String')
            }
            if (data.hasOwnProperty('enabled')) {
                obj.enabled = ApiClient.convertToType(data.enabled, 'Boolean')
            }
            if (data.hasOwnProperty('fax')) {
                obj.fax = ApiClient.convertToType(data.fax, 'String')
            }
            if (data.hasOwnProperty('first_name')) {
                obj.first_name = ApiClient.convertToType(data.first_name, 'String')
            }
            if (data.hasOwnProperty('gender')) {
                obj.gender = ApiClient.convertToType(data.gender, 'Number')
            }
            if (data.hasOwnProperty('job_title')) {
                obj.job_title = ApiClient.convertToType(data.job_title, 'String')
            }
            if (data.hasOwnProperty('last_login_time')) {
                obj.last_login_time = ApiClient.convertToType(data.last_login_time, 'Date')
            }
            if (data.hasOwnProperty('last_modified')) {
                obj.last_modified = ApiClient.convertToType(data.last_modified, 'Date')
            }
            if (data.hasOwnProperty('last_name')) {
                obj.last_name = ApiClient.convertToType(data.last_name, 'String')
            }
            if (data.hasOwnProperty('last_visit_time')) {
                obj.last_visit_time = ApiClient.convertToType(data.last_visit_time, 'Date')
            }
            if (data.hasOwnProperty('login')) {
                obj.login = ApiClient.convertToType(data.login, 'String')
            }
            if (data.hasOwnProperty('note')) {
                obj.note = ApiClient.convertToType(data.note, 'String')
            }
            if (data.hasOwnProperty('payment_instruments')) {
                obj.payment_instruments = ApiClient.convertToType(data.payment_instruments, [CustomerPaymentInstrument])
            }
            if (data.hasOwnProperty('phone_business')) {
                obj.phone_business = ApiClient.convertToType(data.phone_business, 'String')
            }
            if (data.hasOwnProperty('phone_home')) {
                obj.phone_home = ApiClient.convertToType(data.phone_home, 'String')
            }
            if (data.hasOwnProperty('phone_mobile')) {
                obj.phone_mobile = ApiClient.convertToType(data.phone_mobile, 'String')
            }
            if (data.hasOwnProperty('preferred_locale')) {
                obj.preferred_locale = ApiClient.convertToType(data.preferred_locale, 'String')
            }
            if (data.hasOwnProperty('previous_login_time')) {
                obj.previous_login_time = ApiClient.convertToType(data.previous_login_time, 'Date')
            }
            if (data.hasOwnProperty('previous_visit_time')) {
                obj.previous_visit_time = ApiClient.convertToType(data.previous_visit_time, 'Date')
            }
            if (data.hasOwnProperty('salutation')) {
                obj.salutation = ApiClient.convertToType(data.salutation, 'String')
            }
            if (data.hasOwnProperty('second_name')) {
                obj.second_name = ApiClient.convertToType(data.second_name, 'String')
            }
            if (data.hasOwnProperty('suffix')) {
                obj.suffix = ApiClient.convertToType(data.suffix, 'String')
            }
            if (data.hasOwnProperty('title')) {
                obj.title = ApiClient.convertToType(data.title, 'String')
            }
        }
        return obj
    }

    /**
    * The customer's addresses.
    * @member {Array.<module:models/CustomerAddress>} addresses
    */
    addresses = undefined;
    /**
    * The customer's authorization type (indicates if the customer is a guest  or a registered customer).
    * @member {module:models/Customer.AuthTypeEnum} auth_type
    */
    auth_type = undefined;
    /**
    * The customer's birthday.
    * @member {Date} birthday
    */
    birthday = undefined;
    /**
    * @member {String} c_familyStatus
    */
    c_familyStatus = undefined;
    /**
    * The customer's company name.
    * @member {String} company_name
    */
    company_name = undefined;
    /**
    * Returns the value of attribute 'creationDate'.
    * @member {Date} creation_date
    */
    creation_date = undefined;
    /**
    * The customer's number (id). Both registered and guest customers have a  customer id.
    * @member {String} customer_id
    */
    customer_id = undefined;
    /**
    * The customer's number (id). Only a registered customer has a customer  number.
    * @member {String} customer_no
    */
    customer_no = undefined;
    /**
    * The customer's email address.
    * @member {String} email
    */
    email = undefined;
    /**
    * A flag indicating whether this customer is is enabled and can log in.
    * @member {Boolean} enabled
    */
    enabled = undefined;
    /**
    * The customer's fax number. The length is restricted to 32 characters.
    * @member {String} fax
    */
    fax = undefined;
    /**
    * The customer's first name.
    * @member {String} first_name
    */
    first_name = undefined;
    /**
    * The customer's gender.
    * @member {module:models/Customer.GenderEnum} gender
    */
    gender = undefined;
    /**
    * The customer's job title.
    * @member {String} job_title
    */
    job_title = undefined;
    /**
    * The time when the customer last logged in.
    * @member {Date} last_login_time
    */
    last_login_time = undefined;
    /**
    * Returns the value of attribute 'lastModified'.
    * @member {Date} last_modified
    */
    last_modified = undefined;
    /**
    * The customer's last name.
    * @member {String} last_name
    */
    last_name = undefined;
    /**
    * The time when the customer last visited.
    * @member {Date} last_visit_time
    */
    last_visit_time = undefined;
    /**
    * The customer's login.
    * @member {String} login
    */
    login = undefined;
    /**
    * The customer's note.
    * @member {String} note
    */
    note = undefined;
    /**
    * The customer's payment instruments.
    * @member {Array.<module:models/CustomerPaymentInstrument>} payment_instruments
    */
    payment_instruments = undefined;
    /**
    * The customer's business phone number.
    * @member {String} phone_business
    */
    phone_business = undefined;
    /**
    * The customer's home phone number.
    * @member {String} phone_home
    */
    phone_home = undefined;
    /**
    * The customer's mobile phone number.
    * @member {String} phone_mobile
    */
    phone_mobile = undefined;
    /**
    * The customer's preferred locale.
    * @member {String} preferred_locale
    */
    preferred_locale = undefined;
    /**
    * The time when the customer logged in previously.
    * @member {Date} previous_login_time
    */
    previous_login_time = undefined;
    /**
    * The time when the customer last visited the store.
    * @member {Date} previous_visit_time
    */
    previous_visit_time = undefined;
    /**
    * The salutation to use for the customer.
    * @member {String} salutation
    */
    salutation = undefined;
    /**
    * The customer's second name.
    * @member {String} second_name
    */
    second_name = undefined;
    /**
    * The customer's suffix (for example, \"Jr.\" or \"Sr.\").
    * @member {String} suffix
    */
    suffix = undefined;
    /**
    * The customer's title (for example, \"Mrs\" or \"Mr\").
    * @member {String} title
    */
    title = undefined;






    /**
    * Allowed values for the <code>auth_type</code> property.
    * @enum {String}
    * @readonly
    */
    static AuthTypeEnum = {

        /**
         * value: "guest"
         * @const
         */
        guest: 'guest',

        /**
         * value: "registered"
         * @const
         */
        registered: 'registered'
    };

    /**
    * Allowed values for the <code>gender</code> property.
    * @enum {Number}
    * @readonly
    */
    static GenderEnum = {

        /**
         * value: 1
         * @const
         */
        1: 1,

        /**
         * value: 2
         * @const
         */
        2: 2
    };



}