/**
 * Pipedrive API v1
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * 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';
import DealPersonData from './DealPersonData';
import DealPersonDataEmail from './DealPersonDataEmail';
import DealPersonDataPhone from './DealPersonDataPhone';
import DealPersonDataWithIdAllOf from './DealPersonDataWithIdAllOf';

/**
 * The DealPersonDataWithId model module.
 * @module model/DealPersonDataWithId
 * @version 1.0.0
 */
class DealPersonDataWithId {
    /**
     * Constructs a new <code>DealPersonDataWithId</code>.
     * @alias module:model/DealPersonDataWithId
     * @implements module:model/DealPersonData
     * @implements module:model/DealPersonDataWithIdAllOf
     */
    constructor() { 
        DealPersonData.initialize(this);DealPersonDataWithIdAllOf.initialize(this);
        DealPersonDataWithId.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>DealPersonDataWithId</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/DealPersonDataWithId} obj Optional instance to populate.
     * @return {module:model/DealPersonDataWithId} The populated <code>DealPersonDataWithId</code> instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new DealPersonDataWithId();
            DealPersonData.constructFromObject(data, obj);
            DealPersonDataWithIdAllOf.constructFromObject(data, obj);

            if (data.hasOwnProperty('active_flag')) {
                obj['active_flag'] = ApiClient.convertToType(data['active_flag'], 'Boolean');

                delete data['active_flag'];
            }
            if (data.hasOwnProperty('name')) {
                obj['name'] = ApiClient.convertToType(data['name'], 'String');

                delete data['name'];
            }
            if (data.hasOwnProperty('email')) {
                obj['email'] = ApiClient.convertToType(data['email'], [DealPersonDataEmail]);

                delete data['email'];
            }
            if (data.hasOwnProperty('phone')) {
                obj['phone'] = ApiClient.convertToType(data['phone'], [DealPersonDataPhone]);

                delete data['phone'];
            }
            if (data.hasOwnProperty('owner_id')) {
                obj['owner_id'] = ApiClient.convertToType(data['owner_id'], 'Number');

                delete data['owner_id'];
            }
            if (data.hasOwnProperty('value')) {
                obj['value'] = ApiClient.convertToType(data['value'], 'Number');

                delete data['value'];
            }

            if (Object.keys(data).length > 0) {
                Object.assign(obj, data);
            }

        }
        return obj;
    }


}

/**
 * Whether the associated person is active or not
 * @member {Boolean} active_flag
 */
DealPersonDataWithId.prototype['active_flag'] = undefined;

/**
 * The name of the person associated with the deal
 * @member {String} name
 */
DealPersonDataWithId.prototype['name'] = undefined;

/**
 * The emails of the person associated with the deal
 * @member {Array.<module:model/DealPersonDataEmail>} email
 */
DealPersonDataWithId.prototype['email'] = undefined;

/**
 * The phone numbers of the person associated with the deal
 * @member {Array.<module:model/DealPersonDataPhone>} phone
 */
DealPersonDataWithId.prototype['phone'] = undefined;

/**
 * The ID of the owner of the person that is associated with the deal
 * @member {Number} owner_id
 */
DealPersonDataWithId.prototype['owner_id'] = undefined;

/**
 * The ID of the person associated with the deal
 * @member {Number} value
 */
DealPersonDataWithId.prototype['value'] = undefined;


// Implement DealPersonData interface:
/**
 * Whether the associated person is active or not
 * @member {Boolean} active_flag
 */
DealPersonData.prototype['active_flag'] = undefined;
/**
 * The name of the person associated with the deal
 * @member {String} name
 */
DealPersonData.prototype['name'] = undefined;
/**
 * The emails of the person associated with the deal
 * @member {Array.<module:model/DealPersonDataEmail>} email
 */
DealPersonData.prototype['email'] = undefined;
/**
 * The phone numbers of the person associated with the deal
 * @member {Array.<module:model/DealPersonDataPhone>} phone
 */
DealPersonData.prototype['phone'] = undefined;
/**
 * The ID of the owner of the person that is associated with the deal
 * @member {Number} owner_id
 */
DealPersonData.prototype['owner_id'] = undefined;
// Implement DealPersonDataWithIdAllOf interface:
/**
 * The ID of the person associated with the deal
 * @member {Number} value
 */
DealPersonDataWithIdAllOf.prototype['value'] = undefined;




export default DealPersonDataWithId;

