@kinde-oss/kinde-nodejs-sdk
Version:
Kinde Nodejs SDK allows integrate with Express server using middleware, helpers function
191 lines (180 loc) • 12.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
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 CreateOrganizationRequest model module.
* @module model/CreateOrganizationRequest
* @version 1
*/
var CreateOrganizationRequest = /*#__PURE__*/function () {
/**
* Constructs a new <code>CreateOrganizationRequest</code>.
* @alias module:model/CreateOrganizationRequest
*/
function CreateOrganizationRequest() {
_classCallCheck(this, CreateOrganizationRequest);
CreateOrganizationRequest.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(CreateOrganizationRequest, null, [{
key: "initialize",
value: function initialize(obj) {}
/**
* Constructs a <code>CreateOrganizationRequest</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/CreateOrganizationRequest} obj Optional instance to populate.
* @return {module:model/CreateOrganizationRequest} The populated <code>CreateOrganizationRequest</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new CreateOrganizationRequest();
if (data.hasOwnProperty('name')) {
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('feature_flags')) {
obj['feature_flags'] = _ApiClient["default"].convertToType(data['feature_flags'], {
'String': 'String'
});
}
if (data.hasOwnProperty('external_id')) {
obj['external_id'] = _ApiClient["default"].convertToType(data['external_id'], 'String');
}
if (data.hasOwnProperty('background_color')) {
obj['background_color'] = _ApiClient["default"].convertToType(data['background_color'], 'String');
}
if (data.hasOwnProperty('button_color')) {
obj['button_color'] = _ApiClient["default"].convertToType(data['button_color'], 'String');
}
if (data.hasOwnProperty('button_text_color')) {
obj['button_text_color'] = _ApiClient["default"].convertToType(data['button_text_color'], 'String');
}
if (data.hasOwnProperty('link_color')) {
obj['link_color'] = _ApiClient["default"].convertToType(data['link_color'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>CreateOrganizationRequest</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>CreateOrganizationRequest</code>.
*/
}, {
key: "validateJSON",
value: function validateJSON(data) {
// ensure the json data is a string
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
}
// ensure the json data is a string
if (data['external_id'] && !(typeof data['external_id'] === 'string' || data['external_id'] instanceof String)) {
throw new Error("Expected the field `external_id` to be a primitive type in the JSON string but got " + data['external_id']);
}
// ensure the json data is a string
if (data['background_color'] && !(typeof data['background_color'] === 'string' || data['background_color'] instanceof String)) {
throw new Error("Expected the field `background_color` to be a primitive type in the JSON string but got " + data['background_color']);
}
// ensure the json data is a string
if (data['button_color'] && !(typeof data['button_color'] === 'string' || data['button_color'] instanceof String)) {
throw new Error("Expected the field `button_color` to be a primitive type in the JSON string but got " + data['button_color']);
}
// ensure the json data is a string
if (data['button_text_color'] && !(typeof data['button_text_color'] === 'string' || data['button_text_color'] instanceof String)) {
throw new Error("Expected the field `button_text_color` to be a primitive type in the JSON string but got " + data['button_text_color']);
}
// ensure the json data is a string
if (data['link_color'] && !(typeof data['link_color'] === 'string' || data['link_color'] instanceof String)) {
throw new Error("Expected the field `link_color` to be a primitive type in the JSON string but got " + data['link_color']);
}
return true;
}
}]);
return CreateOrganizationRequest;
}();
/**
* The organization's name.
* @member {String} name
*/
CreateOrganizationRequest.prototype['name'] = undefined;
/**
* The organization's feature flag settings.
* @member {Object.<String, module:model/CreateOrganizationRequest.InnerEnum>} feature_flags
*/
CreateOrganizationRequest.prototype['feature_flags'] = undefined;
/**
* The organization's ID.
* @member {String} external_id
*/
CreateOrganizationRequest.prototype['external_id'] = undefined;
/**
* The organization's brand settings - background color.
* @member {String} background_color
*/
CreateOrganizationRequest.prototype['background_color'] = undefined;
/**
* The organization's brand settings - button color.
* @member {String} button_color
*/
CreateOrganizationRequest.prototype['button_color'] = undefined;
/**
* The organization's brand settings - button text color.
* @member {String} button_text_color
*/
CreateOrganizationRequest.prototype['button_text_color'] = undefined;
/**
* The organization's brand settings - link color.
* @member {String} link_color
*/
CreateOrganizationRequest.prototype['link_color'] = undefined;
/**
* Allowed values for the <code>inner</code> property.
* @enum {String}
* @readonly
*/
CreateOrganizationRequest['InnerEnum'] = {
/**
* value: "str"
* @const
*/
"str": "str",
/**
* value: "int"
* @const
*/
"int": "int",
/**
* value: "bool"
* @const
*/
"bool": "bool"
};
var _default = CreateOrganizationRequest;
exports["default"] = _default;