text: /**
   * 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 BasePersonItemPhone from './BasePersonItemPhone';
  import BasicPerson from './BasicPerson';
  import BasicPersonEmail from './BasicPersonEmail';
  import MarketingStatus from './MarketingStatus';
  import NewPersonAllOf from './NewPersonAllOf';
  import VisibleTo from './VisibleTo';
  
  /**
   * The NewPerson model module.
   * @module model/NewPerson
   * @version 1.0.0
   */
  class NewPerson {
      /**
       * Constructs a new <code>NewPerson</code>.
       * @alias module:model/NewPerson
       * @implements module:model/BasicPerson
       * @implements module:model/NewPersonAllOf
       * @param name {String} The name of the person
       */
      constructor(name) { 
          BasicPerson.initialize(this);NewPersonAllOf.initialize(this);
          NewPerson.initialize(this, name);
      }
  
      /**
       * 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, name) { 
          obj['name'] = name;
      }
  
      /**
       * Constructs a <code>NewPerson</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/NewPerson} obj Optional instance to populate.
       * @return {module:model/NewPerson} The populated <code>NewPerson</code> instance.
       */
      static constructFromObject(data, obj) {
          if (data) {
              obj = obj || new NewPerson();
              BasicPerson.constructFromObject(data, obj);
              NewPersonAllOf.constructFromObject(data, obj);
  
              if (data.hasOwnProperty('name')) {
                  obj['name'] = ApiClient.convertToType(data['name'], 'String');
  
                  delete data['name'];
              }
              if (data.hasOwnProperty('owner_id')) {
                  obj['owner_id'] = ApiClient.convertToType(data['owner_id'], 'Number');
  
                  delete data['owner_id'];
              }
              if (data.hasOwnProperty('org_id')) {
                  obj['org_id'] = ApiClient.convertToType(data['org_id'], 'Number');
  
                  delete data['org_id'];
              }
              if (data.hasOwnProperty('email')) {
                  obj['email'] = ApiClient.convertToType(data['email'], [BasicPersonEmail]);
  
                  delete data['email'];
              }
              if (data.hasOwnProperty('phone')) {
                  obj['phone'] = ApiClient.convertToType(data['phone'], [BasePersonItemPhone]);
  
                  delete data['phone'];
              }
              if (data.hasOwnProperty('visible_to')) {
                  obj['visible_to'] = ApiClient.convertToType(data['visible_to'], VisibleTo);
  
                  delete data['visible_to'];
              }
              if (data.hasOwnProperty('marketing_status')) {
                  obj['marketing_status'] = ApiClient.convertToType(data['marketing_status'], MarketingStatus);
  
                  delete data['marketing_status'];
              }
              if (data.hasOwnProperty('add_time')) {
                  obj['add_time'] = ApiClient.convertToType(data['add_time'], 'String');
  
                  delete data['add_time'];
              }
  
              if (Object.keys(data).length > 0) {
                  Object.assign(obj, data);
              }
  
          }
          return obj;
      }
  
  
  }
  
  /**
   * The name of the person
   * @member {String} name
   */
  NewPerson.prototype['name'] = undefined;
  
  /**
   * The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used.
   * @member {Number} owner_id
   */
  NewPerson.prototype['owner_id'] = undefined;
  
  /**
   * The ID of the organization this person will belong to
   * @member {Number} org_id
   */
  NewPerson.prototype['org_id'] = undefined;
  
  /**
   * List of email data related to the person
   * @member {Array.<module:model/BasicPersonEmail>} email
   */
  NewPerson.prototype['email'] = undefined;
  
  /**
   * List of phone data related to the person
   * @member {Array.<module:model/BasePersonItemPhone>} phone
   */
  NewPerson.prototype['phone'] = undefined;
  
  /**
   * The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table>
   * @member {module:model/VisibleTo} visible_to
   */
  NewPerson.prototype['visible_to'] = undefined;
  
  /**
   * If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table>
   * @member {module:model/MarketingStatus} marketing_status
   */
  NewPerson.prototype['marketing_status'] = undefined;
  
  /**
   * The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS
   * @member {String} add_time
   */
  NewPerson.prototype['add_time'] = undefined;
  
  
  // Implement BasicPerson interface:
  /**
   * The name of the person
   * @member {String} name
   */
  BasicPerson.prototype['name'] = undefined;
  /**
   * The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used.
   * @member {Number} owner_id
   */
  BasicPerson.prototype['owner_id'] = undefined;
  /**
   * The ID of the organization this person will belong to
   * @member {Number} org_id
   */
  BasicPerson.prototype['org_id'] = undefined;
  /**
   * List of email data related to the person
   * @member {Array.<module:model/BasicPersonEmail>} email
   */
  BasicPerson.prototype['email'] = undefined;
  /**
   * List of phone data related to the person
   * @member {Array.<module:model/BasePersonItemPhone>} phone
   */
  BasicPerson.prototype['phone'] = undefined;
  /**
   * The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table>
   * @member {module:model/VisibleTo} visible_to
   */
  BasicPerson.prototype['visible_to'] = undefined;
  /**
   * If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table>
   * @member {module:model/MarketingStatus} marketing_status
   */
  BasicPerson.prototype['marketing_status'] = undefined;
  // Implement NewPersonAllOf interface:
  /**
   * The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS
   * @member {String} add_time
   */
  NewPersonAllOf.prototype['add_time'] = undefined;
  
  
  
  
  export default NewPerson;
  
  