@kinde-oss/kinde-nodejs-sdk
Version:
Kinde Nodejs SDK allows integrate with Express server using middleware, helpers function
120 lines (114 loc) • 10.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _CreateUserRequestIdentitiesInnerDetails = _interopRequireDefault(require("./CreateUserRequestIdentitiesInnerDetails"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
* Kinde Management API
* Provides endpoints to manage your Kinde Businesses
*
* The version of the OpenAPI document: 1
* Contact: support@kinde.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* The CreateUserRequestIdentitiesInner model module.
* @module model/CreateUserRequestIdentitiesInner
* @version 1
*/
var CreateUserRequestIdentitiesInner = /*#__PURE__*/function () {
/**
* Constructs a new <code>CreateUserRequestIdentitiesInner</code>.
* The result of the user creation operation.
* @alias module:model/CreateUserRequestIdentitiesInner
*/
function CreateUserRequestIdentitiesInner() {
_classCallCheck(this, CreateUserRequestIdentitiesInner);
CreateUserRequestIdentitiesInner.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.
*/
_createClass(CreateUserRequestIdentitiesInner, null, [{
key: "initialize",
value: function initialize(obj) {}
/**
* Constructs a <code>CreateUserRequestIdentitiesInner</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/CreateUserRequestIdentitiesInner} obj Optional instance to populate.
* @return {module:model/CreateUserRequestIdentitiesInner} The populated <code>CreateUserRequestIdentitiesInner</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new CreateUserRequestIdentitiesInner();
if (data.hasOwnProperty('type')) {
obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('details')) {
obj['details'] = _CreateUserRequestIdentitiesInnerDetails["default"].constructFromObject(data['details']);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>CreateUserRequestIdentitiesInner</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateUserRequestIdentitiesInner</code>.
*/
}, {
key: "validateJSON",
value: function validateJSON(data) {
// ensure the json data is a string
if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
}
// validate the optional field `details`
if (data['details']) {
// data not null
_CreateUserRequestIdentitiesInnerDetails["default"].validateJSON(data['details']);
}
return true;
}
}]);
return CreateUserRequestIdentitiesInner;
}();
/**
* The type of identity to create, for e.g. email.
* @member {module:model/CreateUserRequestIdentitiesInner.TypeEnum} type
*/
CreateUserRequestIdentitiesInner.prototype['type'] = undefined;
/**
* @member {module:model/CreateUserRequestIdentitiesInnerDetails} details
*/
CreateUserRequestIdentitiesInner.prototype['details'] = undefined;
/**
* Allowed values for the <code>type</code> property.
* @enum {String}
* @readonly
*/
CreateUserRequestIdentitiesInner['TypeEnum'] = {
/**
* value: "email"
* @const
*/
"email": "email"
};
var _default = CreateUserRequestIdentitiesInner;
exports["default"] = _default;