File: /var/www/fintechfuel/node_modules/pipedrive/dist/model/AddOrganizationRelationshipRequest.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
/**
* 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.
*
*/
/**
* The AddOrganizationRelationshipRequest model module.
* @module model/AddOrganizationRelationshipRequest
* @version 1.0.0
*/
var AddOrganizationRelationshipRequest = /*#__PURE__*/function () {
/**
* Constructs a new <code>AddOrganizationRelationshipRequest</code>.
* @alias module:model/AddOrganizationRelationshipRequest
* @param type {module:model/AddOrganizationRelationshipRequest.TypeEnum} The type of organization relationship
* @param relOwnerOrgId {Number} The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter.
* @param relLinkedOrgId {Number} The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter.
*/
function AddOrganizationRelationshipRequest(type, relOwnerOrgId, relLinkedOrgId) {
(0, _classCallCheck2["default"])(this, AddOrganizationRelationshipRequest);
AddOrganizationRelationshipRequest.initialize(this, type, relOwnerOrgId, relLinkedOrgId);
}
/**
* 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.
*/
(0, _createClass2["default"])(AddOrganizationRelationshipRequest, null, [{
key: "initialize",
value: function initialize(obj, type, relOwnerOrgId, relLinkedOrgId) {
obj['type'] = type;
obj['rel_owner_org_id'] = relOwnerOrgId;
obj['rel_linked_org_id'] = relLinkedOrgId;
}
/**
* Constructs a <code>AddOrganizationRelationshipRequest</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/AddOrganizationRelationshipRequest} obj Optional instance to populate.
* @return {module:model/AddOrganizationRelationshipRequest} The populated <code>AddOrganizationRelationshipRequest</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new AddOrganizationRelationshipRequest();
if (data.hasOwnProperty('org_id')) {
obj['org_id'] = _ApiClient["default"].convertToType(data['org_id'], 'Number');
delete data['org_id'];
}
if (data.hasOwnProperty('type')) {
obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
delete data['type'];
}
if (data.hasOwnProperty('rel_owner_org_id')) {
obj['rel_owner_org_id'] = _ApiClient["default"].convertToType(data['rel_owner_org_id'], 'Number');
delete data['rel_owner_org_id'];
}
if (data.hasOwnProperty('rel_linked_org_id')) {
obj['rel_linked_org_id'] = _ApiClient["default"].convertToType(data['rel_linked_org_id'], 'Number');
delete data['rel_linked_org_id'];
}
if (Object.keys(data).length > 0) {
Object.assign(obj, data);
}
}
return obj;
}
}]);
return AddOrganizationRelationshipRequest;
}();
/**
* The ID of the base organization for the returned calculated values
* @member {Number} org_id
*/
AddOrganizationRelationshipRequest.prototype['org_id'] = undefined;
/**
* The type of organization relationship
* @member {module:model/AddOrganizationRelationshipRequest.TypeEnum} type
*/
AddOrganizationRelationshipRequest.prototype['type'] = undefined;
/**
* The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter.
* @member {Number} rel_owner_org_id
*/
AddOrganizationRelationshipRequest.prototype['rel_owner_org_id'] = undefined;
/**
* The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter.
* @member {Number} rel_linked_org_id
*/
AddOrganizationRelationshipRequest.prototype['rel_linked_org_id'] = undefined;
/**
* Allowed values for the <code>type</code> property.
* @enum {String}
* @readonly
*/
AddOrganizationRelationshipRequest['TypeEnum'] = {
/**
* value: "parent"
* @const
*/
"parent": "parent",
/**
* value: "related"
* @const
*/
"related": "related"
};
var _default = AddOrganizationRelationshipRequest;
exports["default"] = _default;