"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _TenantAwareModel = _interopRequireDefault(require("../../../common/v1/config/TenantAwareModel"));
var _ExternalizableAbstractModel = _interopRequireDefault(require("../../../common/v1/response/ExternalizableAbstractModel"));
var _DpdConfig = _interopRequireDefault(require("./DpdConfig"));
var _GatewayRole = _interopRequireDefault(require("./GatewayRole"));
var _IPSubnet = _interopRequireDefault(require("./IPSubnet"));
var _IpsecConfig = _interopRequireDefault(require("./IpsecConfig"));
var _NetworkingBaseModel = _interopRequireDefault(require("./NetworkingBaseModel"));
var _QosConfig = _interopRequireDefault(require("./QosConfig"));
var _Status = _interopRequireDefault(require("./Status"));
var _VpnConnection2 = _interopRequireDefault(require("./VpnConnection"));
var _ValidationScopes = _interopRequireDefault(require("../../../validation/ValidationScopes"));
var _ValidationUtils = _interopRequireDefault(require("../../../../utils/ValidationUtils"));
var _ValidationError = _interopRequireDefault(require("../../../validation/ValidationError"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } /*
 * Nutanix Networking APIs
 *
 * OpenAPI spec version: 4.0.1
 *
 * NOTE: This class is auto generated by the Open API Dev Platform.
 *
 * Open API Dev Platform Codegen version: 16.9.0.8546-RELEASE
 *
 * Do not edit the class manually.
 *
 */
/**
 * The RemoteVpnConnection model module.
 * @module Ntnx/RemoteVpnConnection
 * @version 4.0.1
 * @class RemoteVpnConnection
 * @extends VpnConnection
 * 
 * @param {  } name VPN connection name
 * 
 * @param {  } localGatewayReference The local VPN gateway reference
 * 
 * @param {  } remoteGatewayReference The remote VPN gateway reference
 * 
 * @param {  } ipsecConfig 
 * 
 * @param {  } localGatewayRole 
 */
var _RemoteVpnConnection_brand = /*#__PURE__*/new WeakSet();
var RemoteVpnConnection = exports["default"] = /*#__PURE__*/function (_VpnConnection) {
  /**
   * Constructs a new <code>RemoteVpnConnection</code>.
   * Information about a VPN connection from the specified Prism Central cluster.
   * @alias module:Ntnx/RemoteVpnConnection
   * @extends module:Ntnx/VpnConnection
   * 
   * @param {  } name VPN connection name
   * 
   * @param {  } localGatewayReference The local VPN gateway reference
   * 
   * @param {  } remoteGatewayReference The remote VPN gateway reference
   * 
   * @param {  } ipsecConfig 
   * 
   * @param {  } localGatewayRole 
  */
  function RemoteVpnConnection(name, localGatewayReference, remoteGatewayReference, ipsecConfig, localGatewayRole) {
    var _this;
    _classCallCheck(this, RemoteVpnConnection);
    _this = _callSuper(this, RemoteVpnConnection, [name, localGatewayReference, remoteGatewayReference, ipsecConfig, localGatewayRole]);
    /*
    * toJson method for a map type which supports map with primitive keys and values of object types
    * @param {Object} obj
    * @returns {Object|Map} Returns a new transofrmed Map by calling toJson on the values if applicable.
    * Otherwise, just returns the input object.
    */
    _classPrivateMethodInitSpec(_this, _RemoteVpnConnection_brand);
    _this.$objectType = "networking.v4.config.RemoteVpnConnection";
    /** @type {object<string, any>} */
    _this.$reserved = {
      '$fv': "v4.r0"
    };
    /** @type {object<string, any>} */
    _this.$unknownFields = {};
    return _this;
  }

  /**
   * Constructs a <code>RemoteVpnConnection</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:Ntnx/RemoteVpnConnection} obj Optional instance to populate.
   * @param callFromChild {Boolean} Flag to recognise calling instance
   * @return {module:Ntnx/RemoteVpnConnection} The populated <code>RemoteVpnConnection</code> instance.
   */
  _inherits(RemoteVpnConnection, _VpnConnection);
  return _createClass(RemoteVpnConnection, [{
    key: "getClusterReference",
    value:
    /**
     * Returns Reference to the remote Prism Element cluster where the VPN connection's gateway is located.
     * @return {string}
     */
    function getClusterReference() {
      return this.clusterReference;
    }

    /**
     * Sets Reference to the remote Prism Element cluster where the VPN connection's gateway is located.
     * @param {string} clusterReference Reference to the remote Prism Element cluster where the VPN connection's gateway is located.
     */
  }, {
    key: "setClusterReference",
    value: function setClusterReference(clusterReference) {
      this.clusterReference = clusterReference;
    }

    /**
     * Returns Name of the remote Prism Element cluster where the VPN connection's gateway is located.
     * @return {string}
     */
  }, {
    key: "getClusterName",
    value: function getClusterName() {
      return this.clusterName;
    }

    /**
     * Sets Name of the remote Prism Element cluster where the VPN connection's gateway is located.
     * @param {string} clusterName Name of the remote Prism Element cluster where the VPN connection's gateway is located.
     */
  }, {
    key: "setClusterName",
    value: function setClusterName(clusterName) {
      this.clusterName = clusterName;
    }

    /**
     * Returns Reference to the VPC associated with the VPN connection.
     * @return {string}
     */
  }, {
    key: "getVpcReference",
    value: function getVpcReference() {
      return this.vpcReference;
    }

    /**
     * Sets Reference to the VPC associated with the VPN connection.
     * @param {string} vpcReference Reference to the VPC associated with the VPN connection.
     */
  }, {
    key: "setVpcReference",
    value: function setVpcReference(vpcReference) {
      this.vpcReference = vpcReference;
    }

    /**
     * Returns Name of the VPC associated with the VPN connection.
     * @return {string}
     */
  }, {
    key: "getVpcName",
    value: function getVpcName() {
      return this.vpcName;
    }

    /**
     * Sets Name of the VPC associated with the VPN connection.
     * @param {string} vpcName Name of the VPC associated with the VPN connection.
     */
  }, {
    key: "setVpcName",
    value: function setVpcName(vpcName) {
      this.vpcName = vpcName;
    }
  }, {
    key: "toJson",
    value: function toJson(forMutation) {
      if (forMutation === false) {
        return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof this.getClusterReference() !== 'undefined' && this.getClusterReference() !== null ? {
          'clusterReference': this.getClusterReference()
        } : {}), typeof this.getClusterName() !== 'undefined' && this.getClusterName() !== null ? {
          'clusterName': this.getClusterName()
        } : {}), typeof this.getVpcReference() !== 'undefined' && this.getVpcReference() !== null ? {
          'vpcReference': this.getVpcReference()
        } : {}), typeof this.getVpcName() !== 'undefined' && this.getVpcName() !== null ? {
          'vpcName': this.getVpcName()
        } : {}), typeof this.getName() !== 'undefined' && this.getName() !== null ? {
          'name': this.getName()
        } : {}), typeof this.getDescription() !== 'undefined' && this.getDescription() !== null ? {
          'description': this.getDescription()
        } : {}), typeof this.getLocalGatewayReference() !== 'undefined' && this.getLocalGatewayReference() !== null ? {
          'localGatewayReference': this.getLocalGatewayReference()
        } : {}), typeof this.getRemoteGatewayReference() !== 'undefined' && this.getRemoteGatewayReference() !== null ? {
          'remoteGatewayReference': this.getRemoteGatewayReference()
        } : {}), typeof this.getIpsecConfig() !== 'undefined' && this.getIpsecConfig() !== null ? {
          'ipsecConfig': this.getIpsecConfig().toJson(false)
        } : {}), typeof this.getDpdConfig() !== 'undefined' && this.getDpdConfig() !== null ? {
          'dpdConfig': this.getDpdConfig().toJson(false)
        } : {}), typeof this.getQosConfig() !== 'undefined' && this.getQosConfig() !== null ? {
          'qosConfig': this.getQosConfig().toJson(false)
        } : {}), typeof this.getLocalGatewayRole() !== 'undefined' && this.getLocalGatewayRole() !== null ? {
          'localGatewayRole': this.getLocalGatewayRole()
        } : {}), typeof this.getDynamicRoutePriority() !== 'undefined' && this.getDynamicRoutePriority() !== null ? {
          'dynamicRoutePriority': this.getDynamicRoutePriority()
        } : {}), typeof this.getAdvertisedPrefixes() !== 'undefined' && this.getAdvertisedPrefixes() !== null ? {
          'advertisedPrefixes': this.getAdvertisedPrefixes().map(function (item) {
            return item.toJson(false);
          })
        } : {}), typeof this.getLearnedPrefixes() !== 'undefined' && this.getLearnedPrefixes() !== null ? {
          'learnedPrefixes': this.getLearnedPrefixes().map(function (item) {
            return item.toJson(false);
          })
        } : {}), typeof this.getIpsecTunnelStatus() !== 'undefined' && this.getIpsecTunnelStatus() !== null ? {
          'ipsecTunnelStatus': this.getIpsecTunnelStatus().toJson(false)
        } : {}), typeof this.getEbgpStatus() !== 'undefined' && this.getEbgpStatus() !== null ? {
          'ebgpStatus': this.getEbgpStatus().toJson(false)
        } : {}), typeof this.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
          'metadata': this.getMetadata().toJson(false)
        } : {}), typeof this.getExtId() !== 'undefined' && this.getExtId() !== null ? {
          'extId': this.getExtId()
        } : {}), typeof this.getLinks() !== 'undefined' && this.getLinks() !== null ? {
          'links': this.getLinks().map(function (item) {
            return item.toJson(false);
          })
        } : {}), typeof this.getTenantId() !== 'undefined' && this.getTenantId() !== null ? {
          'tenantId': this.getTenantId()
        } : {}), {}, {
          '$reserved': this.get$Reserved(),
          '$objectType': this.get$ObjectType(),
          '$unknownFields': this.get$UnknownFields()
        });
      }
      return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typeof this.getClusterReference() !== 'undefined' && this.getClusterReference() !== null ? {
        'clusterReference': this.getClusterReference()
      } : {}), typeof this.getClusterName() !== 'undefined' && this.getClusterName() !== null ? {
        'clusterName': this.getClusterName()
      } : {}), typeof this.getVpcReference() !== 'undefined' && this.getVpcReference() !== null ? {
        'vpcReference': this.getVpcReference()
      } : {}), typeof this.getVpcName() !== 'undefined' && this.getVpcName() !== null ? {
        'vpcName': this.getVpcName()
      } : {}), typeof this.getName() !== 'undefined' && this.getName() !== null ? {
        'name': this.getName()
      } : {}), typeof this.getDescription() !== 'undefined' && this.getDescription() !== null ? {
        'description': this.getDescription()
      } : {}), typeof this.getLocalGatewayReference() !== 'undefined' && this.getLocalGatewayReference() !== null ? {
        'localGatewayReference': this.getLocalGatewayReference()
      } : {}), typeof this.getRemoteGatewayReference() !== 'undefined' && this.getRemoteGatewayReference() !== null ? {
        'remoteGatewayReference': this.getRemoteGatewayReference()
      } : {}), typeof this.getIpsecConfig() !== 'undefined' && this.getIpsecConfig() !== null ? {
        'ipsecConfig': this.getIpsecConfig().toJson(false)
      } : {}), typeof this.getDpdConfig() !== 'undefined' && this.getDpdConfig() !== null ? {
        'dpdConfig': this.getDpdConfig().toJson(false)
      } : {}), typeof this.getQosConfig() !== 'undefined' && this.getQosConfig() !== null ? {
        'qosConfig': this.getQosConfig().toJson(false)
      } : {}), typeof this.getLocalGatewayRole() !== 'undefined' && this.getLocalGatewayRole() !== null ? {
        'localGatewayRole': this.getLocalGatewayRole()
      } : {}), typeof this.getDynamicRoutePriority() !== 'undefined' && this.getDynamicRoutePriority() !== null ? {
        'dynamicRoutePriority': this.getDynamicRoutePriority()
      } : {}), typeof this.getIpsecTunnelStatus() !== 'undefined' && this.getIpsecTunnelStatus() !== null ? {
        'ipsecTunnelStatus': this.getIpsecTunnelStatus().toJson(false)
      } : {}), typeof this.getEbgpStatus() !== 'undefined' && this.getEbgpStatus() !== null ? {
        'ebgpStatus': this.getEbgpStatus().toJson(false)
      } : {}), typeof this.getMetadata() !== 'undefined' && this.getMetadata() !== null ? {
        'metadata': this.getMetadata().toJson(false)
      } : {}), {}, {
        '$reserved': this.get$Reserved(),
        '$objectType': this.get$ObjectType(),
        '$unknownFields': this.get$UnknownFields()
      });
    }
  }, {
    key: "validate",
    value: function validate(scope, properties) {
      var _this2 = this;
      var propList = [];
      if (arguments.length === 0 || arguments.length === 1 && arguments[0] instanceof _ValidationScopes["default"]) {
        //cases validate() and validate(scope)
        propList = ["name", "localGatewayReference", "remoteGatewayReference", "ipsecConfig", "localGatewayRole"];
      } else if (arguments.length === 1) {
        //case validate(properties)
        propList = arguments[0];
        scope = null;
      } else {
        //case validate(scope, properties)
        propList = arguments[1];
      }
      var res = [];
      var err = null;
      propList.forEach(function (property) {
        err = _this2.validateProperty(property, scope);
        if (err) {
          res.push(err);
        }
      });
      return new Promise(function (resolve, reject) {
        if (res.length !== 0) {
          reject(err);
        } else {
          resolve();
        }
      });
    }
  }, {
    key: "validateProperty",
    value: function validateProperty(scope, property) {
      if (property === "clusterReference") {
        if (typeof this.clusterReference === 'undefined' || this.clusterReference === null) {
          return new _ValidationError["default"]("clusterReference", "undefined or null");
        }
        if (!_ValidationUtils["default"].validatePattern(this.clusterReference, /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)) {
          return new _ValidationError["default"]("clusterReference", "does not satisfy required pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/");
        }
      }
      if (property === "clusterName") {
        if (typeof this.clusterName === 'undefined' || this.clusterName === null) {
          return new _ValidationError["default"]("clusterName", "undefined or null");
        }
        if (!_ValidationUtils["default"].validateMaxLength(this.clusterName, 128)) {
          return new _ValidationError["default"]("clusterName", "does not satisfy required maxLength constraint: 128");
        }
      }
      if (property === "vpcReference") {
        if (typeof this.vpcReference === 'undefined' || this.vpcReference === null) {
          return new _ValidationError["default"]("vpcReference", "undefined or null");
        }
        if (!_ValidationUtils["default"].validatePattern(this.vpcReference, /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)) {
          return new _ValidationError["default"]("vpcReference", "does not satisfy required pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/");
        }
      }
      if (property === "vpcName") {
        if (typeof this.vpcName === 'undefined' || this.vpcName === null) {
          return new _ValidationError["default"]("vpcName", "undefined or null");
        }
        if (!_ValidationUtils["default"].validateMaxLength(this.vpcName, 128)) {
          return new _ValidationError["default"]("vpcName", "does not satisfy required maxLength constraint: 128");
        }
      }
      return new _ValidationError["default"](property, "no such property exists");
    }
  }], [{
    key: "constructFromObject",
    value: function constructFromObject(data) {
      var obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var callFromChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
      var items, item, i, itemArr, discriminator;
      if (data) {
        obj = obj || new RemoteVpnConnection();
        _VpnConnection2["default"].constructFromObject(data, obj, true);
        if (data.hasOwnProperty('clusterReference') && data.clusterReference !== null && data.clusterReference !== undefined) {
          obj.setClusterReference(data['clusterReference']);
        }
        if (data.hasOwnProperty('clusterName') && data.clusterName !== null && data.clusterName !== undefined) {
          obj.setClusterName(data['clusterName']);
        }
        if (data.hasOwnProperty('vpcReference') && data.vpcReference !== null && data.vpcReference !== undefined) {
          obj.setVpcReference(data['vpcReference']);
        }
        if (data.hasOwnProperty('vpcName') && data.vpcName !== null && data.vpcName !== undefined) {
          obj.setVpcName(data['vpcName']);
        }
        if (!callFromChild) {
          obj.$unknownFields = _objectSpread({}, data.$unknownFields);
          for (var property in data) {
            // Check if the `property` is not already present in `obj` keys, either in snake_case or camelCase,
            // as the model's fields are generated in camelCase, but the server might return snake_case (e.g., due to standards like OIDC).
            // Also, ensure the `property` does not start with '$' and end with 'ItemDiscriminator'.
            // If all conditions are true, add the `property` from `data` to `obj.$unknownFields` as an unknown field.
            if (!Object.keys(obj).includes(property) && !Object.keys(obj).includes(this.snakeToCamel(property)) && !(property[0] === "$" && property.endsWith("ItemDiscriminator"))) {
              obj.$unknownFields[property] = data[property];
            }
          }
        }
      }
      return obj;
    }

    /**
    * Converts a given snake_case string to camelCase.
    * @param {string} snakeStr - The input string in snake_case format.
    * @returns {string} - The converted string in camelCase format.
    */
  }, {
    key: "snakeToCamel",
    value: function snakeToCamel(snakeStr) {
      return snakeStr.replace(/(_\w)/g, function (match) {
        return match[1].toUpperCase();
      });
    }
  }]);
}(_VpnConnection2["default"]);
/**
 * Reference to the remote Prism Element cluster where the VPN connection's gateway is located.
 * @memberof RemoteVpnConnection
 */
function _toJsonMapType(obj, forMutation) {
  if (obj instanceof Map) {
    return Object.fromEntries(Array.from(obj, function (_ref) {
      var _ref2 = _slicedToArray(_ref, 2),
        k = _ref2[0],
        v = _ref2[1];
      return [k, typeof v.toJson !== "undefined" ? v.toJson(forMutation) : v];
    }));
  } else if (_typeof(obj) === 'object' && obj != null && obj.constructor === Object) {
    return Object.fromEntries(Array.from(Object.entries(obj), function (entry) {
      return [entry[0], typeof entry[1].toJson !== "undefined" ? entry[1].toJson(forMutation) : entry[1]];
    }));
  }
  return obj;
}
/*
* toJson method for a date type which serializes a Date object to proper Date or DateTime formatting
* @param {Object} obj Object to serialize
* @param {boolean} isDateOnly Boolean variable to identify Date or DateTime format for serialization
* @returns {Object|string} Returns serialized date object or original input object
*/
function _handleDateType(obj, isDateOnly) {
  if (obj instanceof Date && isDateOnly !== undefined) {
    return isDateOnly ? obj.toISOString().slice(0, 10) : obj.toISOString();
  }
  return obj;
}
RemoteVpnConnection.prototype.clusterReference = undefined;

/**
 * Name of the remote Prism Element cluster where the VPN connection's gateway is located.
 * @memberof RemoteVpnConnection
 */
RemoteVpnConnection.prototype.clusterName = undefined;

/**
 * Reference to the VPC associated with the VPN connection.
 * @memberof RemoteVpnConnection
 */
RemoteVpnConnection.prototype.vpcReference = undefined;

/**
 * Name of the VPC associated with the VPN connection.
 * @memberof RemoteVpnConnection
 */
RemoteVpnConnection.prototype.vpcName = undefined;

/**
  * VPN connection name
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.name = undefined;
/**
  * VPN connection description
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.description = undefined;
/**
  * The local VPN gateway reference
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.localGatewayReference = undefined;
/**
  * The remote VPN gateway reference
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.remoteGatewayReference = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.ipsecConfig = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.dpdConfig = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.qosConfig = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.localGatewayRole = undefined;
/**
  * Priority assigned to routes received on this connection over eBGP. A higher priority value indicates that the routes are more preferred 
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.dynamicRoutePriority = undefined;
/**
  * IP prefixes advertised to the remote gateway over BGP.
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.advertisedPrefixes = undefined;
/**
  * IP prefixes learned from the remote gateway over BGP.
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.learnedPrefixes = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.ipsecTunnelStatus = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_VpnConnection2["default"].prototype.ebgpStatus = undefined;
/**
  * @memberof RemoteVpnConnection
  */
_NetworkingBaseModel["default"].prototype.metadata = undefined;
/**
  * A globally unique identifier of an instance that is suitable for external consumption. 
  * @memberof RemoteVpnConnection
  */
_ExternalizableAbstractModel["default"].prototype.extId = undefined;
/**
  * A HATEOAS style link for the response.  Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource. 
  * @memberof RemoteVpnConnection
  */
_ExternalizableAbstractModel["default"].prototype.links = undefined;
/**
  * A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server). 
  * @memberof RemoteVpnConnection
  */
_TenantAwareModel["default"].prototype.tenantId = undefined;
// Implement OneOfnetworking.v4.config.RemoteVpnConnectionApiResponsedata interface: