UNPKG

@seminarcatalog/sdk

Version:

This project is the official Javascript API client implementation for the SeminarCatalog developed by the Databay AG.

1,573 lines (1,314 loc) 998 kB
import superagent from 'superagent'; import querystring from 'querystring'; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } /** * @module ApiClient * @version 1.0.0 */ /** * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. * @alias module:ApiClient * @class */ var ApiClient = /*#__PURE__*/function () { function ApiClient() { _classCallCheck(this, ApiClient); /** * The base URL against which to resolve every API call's (relative) path. * @type {String} * @default https://localhost */ this.basePath = 'https://localhost'.replace(/\/+$/, ''); /** * The authentication methods to be included for all API calls. * @type {Array.<String>} */ this.authentications = { 'api_key': { type: 'apiKey', 'in': 'header', name: 'Authorization' } }; /** * The default HTTP headers to be included for all API calls. * @type {Array.<String>} * @default {} */ this.defaultHeaders = {}; /** * The default HTTP timeout for all API calls. * @type {Number} * @default 60000 */ this.timeout = 60000; /** * If set to false an additional timestamp parameter is added to all API GET calls to * prevent browser caching * @type {Boolean} * @default true */ this.cache = true; /** * If set to true, the client will save the cookies from each server * response, and return them in the next request. * @default false */ this.enableCookies = false; /* * Used to save and return cookies in a node.js (non-browser) setting, * if this.enableCookies is set to true. */ if (typeof window === 'undefined') { this.agent = new superagent.agent(); } /* * Allow user to override superagent agent */ this.requestAgent = null; } /** * Returns a string representation for an actual parameter. * @param param The actual parameter. * @returns {String} The string representation of <code>param</code>. */ _createClass(ApiClient, [{ key: "paramToString", value: function paramToString(param) { if (param == undefined || param == null) { return ''; } if (param instanceof Date) { return param.toJSON(); } return param.toString(); } /** * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. * NOTE: query parameters are not handled here. * @param {String} path The path to append to the base URL. * @param {Object} pathParams The parameter values to append. * @returns {String} The encoded path with parameter values substituted. */ }, { key: "buildUrl", value: function buildUrl(path, pathParams) { var _this = this; if (!path.match(/^\//)) { path = '/' + path; } var url = this.basePath + path; url = url.replace(/\{([\w-]+)\}/g, function (fullMatch, key) { var value; if (pathParams.hasOwnProperty(key)) { value = _this.paramToString(pathParams[key]); } else { value = fullMatch; } return encodeURIComponent(value); }); return url; } /** * Checks whether the given content type represents JSON.<br> * JSON content type examples:<br> * <ul> * <li>application/json</li> * <li>application/json; charset=UTF8</li> * <li>APPLICATION/JSON</li> * </ul> * @param {String} contentType The MIME content type to check. * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>. */ }, { key: "isJsonMime", value: function isJsonMime(contentType) { return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); } /** * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. * @param {Array.<String>} contentTypes * @returns {String} The chosen content type, preferring JSON. */ }, { key: "jsonPreferredMime", value: function jsonPreferredMime(contentTypes) { for (var i = 0; i < contentTypes.length; i++) { if (this.isJsonMime(contentTypes[i])) { return contentTypes[i]; } } return contentTypes[0]; } /** * Checks whether the given parameter value represents file-like content. * @param param The parameter to check. * @returns {Boolean} <code>true</code> if <code>param</code> represents a file. */ }, { key: "isFileParam", value: function isFileParam(param) { // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) if (typeof require === 'function') { var fs; try { fs = require('fs'); } catch (err) {} if (fs && fs.ReadStream && param instanceof fs.ReadStream) { return true; } } // Buffer in Node.js if (typeof Buffer === 'function' && param instanceof Buffer) { return true; } // Blob in browser if (typeof Blob === 'function' && param instanceof Blob) { return true; } // File in browser (it seems File object is also instance of Blob, but keep this for safe) if (typeof File === 'function' && param instanceof File) { return true; } return false; } /** * Normalizes parameter values: * <ul> * <li>remove nils</li> * <li>keep files and arrays</li> * <li>format to string with `paramToString` for other cases</li> * </ul> * @param {Object.<String, Object>} params The parameters as object properties. * @returns {Object.<String, Object>} normalized parameters. */ }, { key: "normalizeParams", value: function normalizeParams(params) { var newParams = {}; for (var key in params) { if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { var value = params[key]; if (this.isFileParam(value) || Array.isArray(value)) { newParams[key] = value; } else { newParams[key] = this.paramToString(value); } } } return newParams; } /** * Enumeration of collection format separator strategies. * @enum {String} * @readonly */ }, { key: "buildCollectionParam", /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>. */ value: function buildCollectionParam(param, collectionFormat) { if (param == null) { return null; } switch (collectionFormat) { case 'csv': return param.map(this.paramToString).join(','); case 'ssv': return param.map(this.paramToString).join(' '); case 'tsv': return param.map(this.paramToString).join('\t'); case 'pipes': return param.map(this.paramToString).join('|'); case 'multi': //return the array directly as SuperAgent will handle it as expected return param.map(this.paramToString); default: throw new Error('Unknown collection format: ' + collectionFormat); } } /** * Applies authentication headers to the request. * @param {Object} request The request object created by a <code>superagent()</code> call. * @param {Array.<String>} authNames An array of authentication method names. */ }, { key: "applyAuthToRequest", value: function applyAuthToRequest(request, authNames) { var _this2 = this; authNames.forEach(function (authName) { var auth = _this2.authentications[authName]; switch (auth.type) { case 'basic': if (auth.username || auth.password) { request.auth(auth.username || '', auth.password || ''); } break; case 'apiKey': if (auth.apiKey) { var data = {}; if (auth.apiKeyPrefix) { data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; } else { data[auth.name] = auth.apiKey; } if (auth['in'] === 'header') { request.set(data); } else { request.query(data); } } break; case 'oauth2': if (auth.accessToken) { request.set({ 'Authorization': 'Bearer ' + auth.accessToken }); } break; default: throw new Error('Unknown authentication type: ' + auth.type); } }); } /** * Deserializes an HTTP response body into a value of the specified type. * @param {Object} response A SuperAgent response object. * @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on <code>data<code> will be converted to this type. * @returns A value of the specified type. */ }, { key: "deserialize", value: function deserialize(response, returnType) { if (response == null || returnType == null || response.status == 204) { return null; } // Rely on SuperAgent for parsing response body. // See http://visionmedia.github.io/superagent/#parsing-response-bodies var data = response.body; if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) { // SuperAgent does not always produce a body; use the unparsed response as a fallback data = response.text; } return ApiClient.convertToType(data, returnType); } /** * Invokes the REST service using the supplied settings and parameters. * @param {String} path The base URL to invoke. * @param {String} httpMethod The HTTP method to use. * @param {Object.<String, String>} pathParams A map of path parameters and their values. * @param {Object.<String, Object>} queryParams A map of query parameters and their values. * @param {Object.<String, Object>} headerParams A map of header parameters and their values. * @param {Object.<String, Object>} formParams A map of form parameters and their values. * @param {Object} bodyParam The value to pass as the request body. * @param {Array.<String>} authNames An array of authentication type names. * @param {Array.<String>} contentTypes An array of request MIME types. * @param {Array.<String>} accepts An array of acceptable response MIME types. * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the * constructor for a complex type. * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. */ }, { key: "callApi", value: function callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType) { var _this3 = this; var url = this.buildUrl(path, pathParams); var request = superagent(httpMethod, url); // apply authentications this.applyAuthToRequest(request, authNames); // set query parameters if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { queryParams['_'] = new Date().getTime(); } request.query(this.normalizeParams(queryParams)); // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); // set requestAgent if it is set by user if (this.requestAgent) { request.agent(this.requestAgent); } // set request timeout request.timeout(this.timeout); var contentType = this.jsonPreferredMime(contentTypes); if (contentType) { // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) if (contentType != 'multipart/form-data') { request.type(contentType); } } else if (!request.header['Content-Type']) { request.type('application/json'); } if (contentType === 'application/x-www-form-urlencoded') { request.send(querystring.stringify(this.normalizeParams(formParams))); } else if (contentType == 'multipart/form-data') { var _formParams = this.normalizeParams(formParams); for (var key in _formParams) { if (_formParams.hasOwnProperty(key)) { if (this.isFileParam(_formParams[key])) { // file field request.attach(key, _formParams[key]); } else { request.field(key, _formParams[key]); } } } } else if (bodyParam) { request.send(bodyParam); } var accept = this.jsonPreferredMime(accepts); if (accept) { request.accept(accept); } if (returnType === 'Blob') { request.responseType('blob'); } else if (returnType === 'String') { request.responseType('string'); } // Attach previously saved cookies, if enabled if (this.enableCookies) { if (typeof window === 'undefined') { this.agent.attachCookies(request); } else { request.withCredentials(); } } return new Promise(function (resolve, reject) { request.end(function (error, response) { if (error) { reject(error); } else { try { var data = _this3.deserialize(response, returnType); if (_this3.enableCookies && typeof window === 'undefined') { _this3.agent.saveCookies(response); } resolve({ data: data, response: response }); } catch (err) { reject(err); } } }); }); } /** * Parses an ISO-8601 string representation of a date value. * @param {String} str The date value as a string. * @returns {Date} The parsed date object. */ }], [{ key: "parseDate", value: function parseDate(str) { return new Date(str); } /** * Converts a value to the specified type. * @param {(String|Object)} data The data to convert, as a string or object. * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on <code>data<code> will be converted to this type. * @returns An instance of the specified type or null or undefined if data is null or undefined. */ }, { key: "convertToType", value: function convertToType(data, type) { if (data === null || data === undefined) return data; switch (type) { case 'Boolean': return Boolean(data); case 'Integer': return parseInt(data, 10); case 'Number': return parseFloat(data); case 'String': return String(data); case 'Date': return ApiClient.parseDate(String(data)); case 'Blob': return data; default: if (type === Object) { // generic object, return directly return data; } else if (typeof type === 'function') { // for model type like: User return type.constructFromObject(data); } else if (Array.isArray(type)) { // for array type like: ['String'] var itemType = type[0]; return data.map(function (item) { return ApiClient.convertToType(item, itemType); }); } else if (_typeof(type) === 'object') { // for plain object type like: {'String': 'Integer'} var keyType, valueType; for (var k in type) { if (type.hasOwnProperty(k)) { keyType = k; valueType = type[k]; break; } } var result = {}; for (var k in data) { if (data.hasOwnProperty(k)) { var key = ApiClient.convertToType(k, keyType); var value = ApiClient.convertToType(data[k], valueType); result[key] = value; } } return result; } else { // for unknown type, return the data directly return data; } } } /** * Constructs a new map or array model from REST data. * @param data {Object|Array} The REST data. * @param obj {Object|Array} The target object or array. */ }, { key: "constructFromObject", value: function constructFromObject(data, obj, itemType) { if (Array.isArray(data)) { for (var i = 0; i < data.length; i++) { if (data.hasOwnProperty(i)) obj[i] = ApiClient.convertToType(data[i], itemType); } } else { for (var k in data) { if (data.hasOwnProperty(k)) obj[k] = ApiClient.convertToType(data[k], itemType); } } } }]); return ApiClient; }(); /** * The default API client implementation. * @type {module:ApiClient} */ _defineProperty(ApiClient, "CollectionFormatEnum", { /** * Comma-separated values. Value: <code>csv</code> * @const */ CSV: ',', /** * Space-separated values. Value: <code>ssv</code> * @const */ SSV: ' ', /** * Tab-separated values. Value: <code>tsv</code> * @const */ TSV: '\t', /** * Pipe(|)-separated values. Value: <code>pipes</code> * @const */ PIPES: '|', /** * Native array. Value: <code>multi</code> * @const */ MULTI: 'multi' }); ApiClient.instance = new ApiClient(); /** * The Address model module. * @module model/Address * @version 1.0.0 */ var Address = /*#__PURE__*/function () { /** * Constructs a new <code>Address</code>. * @alias module:model/Address * @class */ function Address() { _classCallCheck(this, Address); } /** * Constructs a <code>Address</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/Address} obj Optional instance to populate. * @return {module:model/Address} The populated <code>Address</code> instance. */ _createClass(Address, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new Address(); if (data.hasOwnProperty('customer')) obj.customer = ApiClient.convertToType(data['customer'], 'String'); if (data.hasOwnProperty('addressType')) obj.addressType = ApiClient.convertToType(data['addressType'], 'String'); if (data.hasOwnProperty('company')) obj.company = ApiClient.convertToType(data['company'], 'String'); if (data.hasOwnProperty('department')) obj.department = ApiClient.convertToType(data['department'], 'String'); if (data.hasOwnProperty('gender')) obj.gender = ApiClient.convertToType(data['gender'], 'String'); if (data.hasOwnProperty('title')) obj.title = ApiClient.convertToType(data['title'], 'String'); if (data.hasOwnProperty('firstname')) obj.firstname = ApiClient.convertToType(data['firstname'], 'String'); if (data.hasOwnProperty('lastname')) obj.lastname = ApiClient.convertToType(data['lastname'], 'String'); if (data.hasOwnProperty('degree')) obj.degree = ApiClient.convertToType(data['degree'], 'String'); if (data.hasOwnProperty('customerNumber')) obj.customerNumber = ApiClient.convertToType(data['customerNumber'], 'String'); if (data.hasOwnProperty('street')) obj.street = ApiClient.convertToType(data['street'], 'String'); if (data.hasOwnProperty('zipcode')) obj.zipcode = ApiClient.convertToType(data['zipcode'], 'String'); if (data.hasOwnProperty('city')) obj.city = ApiClient.convertToType(data['city'], 'String'); if (data.hasOwnProperty('country')) obj.country = ApiClient.convertToType(data['country'], 'String'); if (data.hasOwnProperty('countryId')) obj.countryId = ApiClient.convertToType(data['countryId'], 'Number'); if (data.hasOwnProperty('countryCode')) obj.countryCode = ApiClient.convertToType(data['countryCode'], 'String'); if (data.hasOwnProperty('phone')) obj.phone = ApiClient.convertToType(data['phone'], 'String'); if (data.hasOwnProperty('fax')) obj.fax = ApiClient.convertToType(data['fax'], 'String'); if (data.hasOwnProperty('email')) obj.email = ApiClient.convertToType(data['email'], 'String'); if (data.hasOwnProperty('invoiceEmail')) obj.invoiceEmail = ApiClient.convertToType(data['invoiceEmail'], 'String'); if (data.hasOwnProperty('useInvoiceEmail')) obj.useInvoiceEmail = ApiClient.convertToType(data['useInvoiceEmail'], 'Number'); if (data.hasOwnProperty('extra1')) obj.extra1 = ApiClient.convertToType(data['extra1'], 'String'); if (data.hasOwnProperty('extra2')) obj.extra2 = ApiClient.convertToType(data['extra2'], 'String'); if (data.hasOwnProperty('orderNumber')) obj.orderNumber = ApiClient.convertToType(data['orderNumber'], 'String'); if (data.hasOwnProperty('supplierNumber')) obj.supplierNumber = ApiClient.convertToType(data['supplierNumber'], 'String'); if (data.hasOwnProperty('vatNo')) obj.vatNo = ApiClient.convertToType(data['vatNo'], 'String'); if (data.hasOwnProperty('noOrderNumberNeeded')) obj.noOrderNumberNeeded = ApiClient.convertToType(data['noOrderNumberNeeded'], 'Number'); if (data.hasOwnProperty('participationDefault')) obj.participationDefault = ApiClient.convertToType(data['participationDefault'], 'Number'); if (data.hasOwnProperty('shippingDefault')) obj.shippingDefault = ApiClient.convertToType(data['shippingDefault'], 'Number'); if (data.hasOwnProperty('billingDefault')) obj.billingDefault = ApiClient.convertToType(data['billingDefault'], 'Number'); if (data.hasOwnProperty('client')) obj.client = ApiClient.convertToType(data['client'], 'Number'); if (data.hasOwnProperty('_syncFields')) obj.syncFields = ApiClient.convertToType(data['_syncFields'], ['String']); if (data.hasOwnProperty('id')) obj.id = ApiClient.convertToType(data['id'], 'Number'); if (data.hasOwnProperty('foreignId')) obj.foreignId = ApiClient.convertToType(data['foreignId'], 'String'); if (data.hasOwnProperty('language')) obj.language = ApiClient.convertToType(data['language'], 'Number'); if (data.hasOwnProperty('createDate')) obj.createDate = ApiClient.convertToType(data['createDate'], 'Number'); if (data.hasOwnProperty('changeDate')) obj.changeDate = ApiClient.convertToType(data['changeDate'], 'Number'); if (data.hasOwnProperty('deleted')) obj.deleted = ApiClient.convertToType(data['deleted'], 'Number'); if (data.hasOwnProperty('hidden')) obj.hidden = ApiClient.convertToType(data['hidden'], 'Number'); if (data.hasOwnProperty('sorting')) obj.sorting = ApiClient.convertToType(data['sorting'], 'Number'); if (data.hasOwnProperty('tags')) obj.tags = ApiClient.convertToType(data['tags'], 'String'); } return obj; } }]); return Address; }(); /** * @member {String} customer */ Address.prototype.customer = undefined; /** * @member {String} addressType */ Address.prototype.addressType = undefined; /** * @member {String} company */ Address.prototype.company = undefined; /** * @member {String} department */ Address.prototype.department = undefined; /** * @member {String} gender */ Address.prototype.gender = undefined; /** * @member {String} title */ Address.prototype.title = undefined; /** * @member {String} firstname */ Address.prototype.firstname = undefined; /** * @member {String} lastname */ Address.prototype.lastname = undefined; /** * @member {String} degree */ Address.prototype.degree = undefined; /** * @member {String} customerNumber */ Address.prototype.customerNumber = undefined; /** * @member {String} street */ Address.prototype.street = undefined; /** * @member {String} zipcode */ Address.prototype.zipcode = undefined; /** * @member {String} city */ Address.prototype.city = undefined; /** * @member {String} country */ Address.prototype.country = undefined; /** * @member {Number} countryId */ Address.prototype.countryId = undefined; /** * @member {String} countryCode */ Address.prototype.countryCode = undefined; /** * @member {String} phone */ Address.prototype.phone = undefined; /** * @member {String} fax */ Address.prototype.fax = undefined; /** * @member {String} email */ Address.prototype.email = undefined; /** * @member {String} invoiceEmail */ Address.prototype.invoiceEmail = undefined; /** * @member {Number} useInvoiceEmail */ Address.prototype.useInvoiceEmail = undefined; /** * @member {String} extra1 */ Address.prototype.extra1 = undefined; /** * @member {String} extra2 */ Address.prototype.extra2 = undefined; /** * @member {String} orderNumber */ Address.prototype.orderNumber = undefined; /** * @member {String} supplierNumber */ Address.prototype.supplierNumber = undefined; /** * @member {String} vatNo */ Address.prototype.vatNo = undefined; /** * @member {Number} noOrderNumberNeeded */ Address.prototype.noOrderNumberNeeded = undefined; /** * @member {Number} participationDefault */ Address.prototype.participationDefault = undefined; /** * @member {Number} shippingDefault */ Address.prototype.shippingDefault = undefined; /** * @member {Number} billingDefault */ Address.prototype.billingDefault = undefined; /** * @member {Number} client */ Address.prototype.client = undefined; /** * @member {Array.<String>} syncFields */ Address.prototype.syncFields = undefined; /** * @member {Number} id */ Address.prototype.id = undefined; /** * @member {String} foreignId */ Address.prototype.foreignId = undefined; /** * @member {Number} language */ Address.prototype.language = undefined; /** * @member {Number} createDate */ Address.prototype.createDate = undefined; /** * @member {Number} changeDate */ Address.prototype.changeDate = undefined; /** * @member {Number} deleted */ Address.prototype.deleted = undefined; /** * @member {Number} hidden */ Address.prototype.hidden = undefined; /** * @member {Number} sorting */ Address.prototype.sorting = undefined; /** * @member {String} tags */ Address.prototype.tags = undefined; /** * The AddressPaginationResult model module. * @module model/AddressPaginationResult * @version 1.0.0 */ var AddressPaginationResult = /*#__PURE__*/function () { /** * Constructs a new <code>AddressPaginationResult</code>. * @alias module:model/AddressPaginationResult * @class */ function AddressPaginationResult() { _classCallCheck(this, AddressPaginationResult); } /** * Constructs a <code>AddressPaginationResult</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/AddressPaginationResult} obj Optional instance to populate. * @return {module:model/AddressPaginationResult} The populated <code>AddressPaginationResult</code> instance. */ _createClass(AddressPaginationResult, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new AddressPaginationResult(); if (data.hasOwnProperty('limit')) obj.limit = ApiClient.convertToType(data['limit'], 'Number'); if (data.hasOwnProperty('offset')) obj.offset = ApiClient.convertToType(data['offset'], 'Number'); if (data.hasOwnProperty('entryCount')) obj.entryCount = ApiClient.convertToType(data['entryCount'], 'Number'); if (data.hasOwnProperty('maxEntryCount')) obj.maxEntryCount = ApiClient.convertToType(data['maxEntryCount'], 'Number'); if (data.hasOwnProperty('entries')) obj.entries = ApiClient.convertToType(data['entries'], [Address]); } return obj; } }]); return AddressPaginationResult; }(); /** * @member {Number} limit */ AddressPaginationResult.prototype.limit = undefined; /** * @member {Number} offset */ AddressPaginationResult.prototype.offset = undefined; /** * @member {Number} entryCount */ AddressPaginationResult.prototype.entryCount = undefined; /** * @member {Number} maxEntryCount */ AddressPaginationResult.prototype.maxEntryCount = undefined; /** * @member {Array.<module:model/Address>} entries */ AddressPaginationResult.prototype.entries = undefined; /** * The AllocationWaitingList model module. * @module model/AllocationWaitingList * @version 1.0.0 */ var AllocationWaitingList = /*#__PURE__*/function () { /** * Constructs a new <code>AllocationWaitingList</code>. * @alias module:model/AllocationWaitingList * @class */ function AllocationWaitingList() { _classCallCheck(this, AllocationWaitingList); } /** * Constructs a <code>AllocationWaitingList</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/AllocationWaitingList} obj Optional instance to populate. * @return {module:model/AllocationWaitingList} The populated <code>AllocationWaitingList</code> instance. */ _createClass(AllocationWaitingList, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new AllocationWaitingList(); if (data.hasOwnProperty('interestedPerson')) obj.interestedPerson = ApiClient.convertToType(data['interestedPerson'], 'String'); if (data.hasOwnProperty('allocationType')) obj.allocationType = ApiClient.convertToType(data['allocationType'], 'String'); if (data.hasOwnProperty('event')) obj.event = ApiClient.convertToType(data['event'], 'String'); if (data.hasOwnProperty('_syncFields')) obj.syncFields = ApiClient.convertToType(data['_syncFields'], ['String']); if (data.hasOwnProperty('id')) obj.id = ApiClient.convertToType(data['id'], 'Number'); if (data.hasOwnProperty('foreignId')) obj.foreignId = ApiClient.convertToType(data['foreignId'], 'String'); if (data.hasOwnProperty('language')) obj.language = ApiClient.convertToType(data['language'], 'Number'); if (data.hasOwnProperty('createDate')) obj.createDate = ApiClient.convertToType(data['createDate'], 'Number'); if (data.hasOwnProperty('changeDate')) obj.changeDate = ApiClient.convertToType(data['changeDate'], 'Number'); if (data.hasOwnProperty('deleted')) obj.deleted = ApiClient.convertToType(data['deleted'], 'Number'); if (data.hasOwnProperty('hidden')) obj.hidden = ApiClient.convertToType(data['hidden'], 'Number'); if (data.hasOwnProperty('sorting')) obj.sorting = ApiClient.convertToType(data['sorting'], 'Number'); if (data.hasOwnProperty('tags')) obj.tags = ApiClient.convertToType(data['tags'], 'String'); } return obj; } }]); return AllocationWaitingList; }(); /** * @member {String} interestedPerson */ AllocationWaitingList.prototype.interestedPerson = undefined; /** * @member {String} allocationType */ AllocationWaitingList.prototype.allocationType = undefined; /** * @member {String} event */ AllocationWaitingList.prototype.event = undefined; /** * @member {Array.<String>} syncFields */ AllocationWaitingList.prototype.syncFields = undefined; /** * @member {Number} id */ AllocationWaitingList.prototype.id = undefined; /** * @member {String} foreignId */ AllocationWaitingList.prototype.foreignId = undefined; /** * @member {Number} language */ AllocationWaitingList.prototype.language = undefined; /** * @member {Number} createDate */ AllocationWaitingList.prototype.createDate = undefined; /** * @member {Number} changeDate */ AllocationWaitingList.prototype.changeDate = undefined; /** * @member {Number} deleted */ AllocationWaitingList.prototype.deleted = undefined; /** * @member {Number} hidden */ AllocationWaitingList.prototype.hidden = undefined; /** * @member {Number} sorting */ AllocationWaitingList.prototype.sorting = undefined; /** * @member {String} tags */ AllocationWaitingList.prototype.tags = undefined; /** * The AllocationWaitingListPaginationResult model module. * @module model/AllocationWaitingListPaginationResult * @version 1.0.0 */ var AllocationWaitingListPaginationResult = /*#__PURE__*/function () { /** * Constructs a new <code>AllocationWaitingListPaginationResult</code>. * @alias module:model/AllocationWaitingListPaginationResult * @class */ function AllocationWaitingListPaginationResult() { _classCallCheck(this, AllocationWaitingListPaginationResult); } /** * Constructs a <code>AllocationWaitingListPaginationResult</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/AllocationWaitingListPaginationResult} obj Optional instance to populate. * @return {module:model/AllocationWaitingListPaginationResult} The populated <code>AllocationWaitingListPaginationResult</code> instance. */ _createClass(AllocationWaitingListPaginationResult, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new AllocationWaitingListPaginationResult(); if (data.hasOwnProperty('limit')) obj.limit = ApiClient.convertToType(data['limit'], 'Number'); if (data.hasOwnProperty('offset')) obj.offset = ApiClient.convertToType(data['offset'], 'Number'); if (data.hasOwnProperty('entryCount')) obj.entryCount = ApiClient.convertToType(data['entryCount'], 'Number'); if (data.hasOwnProperty('maxEntryCount')) obj.maxEntryCount = ApiClient.convertToType(data['maxEntryCount'], 'Number'); if (data.hasOwnProperty('entries')) obj.entries = ApiClient.convertToType(data['entries'], [AllocationWaitingList]); } return obj; } }]); return AllocationWaitingListPaginationResult; }(); /** * @member {Number} limit */ AllocationWaitingListPaginationResult.prototype.limit = undefined; /** * @member {Number} offset */ AllocationWaitingListPaginationResult.prototype.offset = undefined; /** * @member {Number} entryCount */ AllocationWaitingListPaginationResult.prototype.entryCount = undefined; /** * @member {Number} maxEntryCount */ AllocationWaitingListPaginationResult.prototype.maxEntryCount = undefined; /** * @member {Array.<module:model/AllocationWaitingList>} entries */ AllocationWaitingListPaginationResult.prototype.entries = undefined; /** * The BookingInterest model module. * @module model/BookingInterest * @version 1.0.0 */ var BookingInterest = /*#__PURE__*/function () { /** * Constructs a new <code>BookingInterest</code>. * @alias module:model/BookingInterest * @class */ function BookingInterest() { _classCallCheck(this, BookingInterest); } /** * Constructs a <code>BookingInterest</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/BookingInterest} obj Optional instance to populate. * @return {module:model/BookingInterest} The populated <code>BookingInterest</code> instance. */ _createClass(BookingInterest, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new BookingInterest(); if (data.hasOwnProperty('status')) obj.status = ApiClient.convertToType(data['status'], 'Number'); if (data.hasOwnProperty('seminar')) obj.seminar = ApiClient.convertToType(data['seminar'], 'Number'); if (data.hasOwnProperty('event')) obj.event = ApiClient.convertToType(data['event'], 'Number'); if (data.hasOwnProperty('customer')) obj.customer = ApiClient.convertToType(data['customer'], 'Number'); if (data.hasOwnProperty('numberLicenses')) obj.numberLicenses = ApiClient.convertToType(data['numberLicenses'], 'Number'); if (data.hasOwnProperty('note')) obj.note = ApiClient.convertToType(data['note'], 'String'); if (data.hasOwnProperty('_syncFields')) obj.syncFields = ApiClient.convertToType(data['_syncFields'], ['String']); if (data.hasOwnProperty('id')) obj.id = ApiClient.convertToType(data['id'], 'Number'); if (data.hasOwnProperty('foreignId')) obj.foreignId = ApiClient.convertToType(data['foreignId'], 'String'); if (data.hasOwnProperty('language')) obj.language = ApiClient.convertToType(data['language'], 'Number'); if (data.hasOwnProperty('createDate')) obj.createDate = ApiClient.convertToType(data['createDate'], 'Number'); if (data.hasOwnProperty('changeDate')) obj.changeDate = ApiClient.convertToType(data['changeDate'], 'Number'); if (data.hasOwnProperty('deleted')) obj.deleted = ApiClient.convertToType(data['deleted'], 'Number'); if (data.hasOwnProperty('hidden')) obj.hidden = ApiClient.convertToType(data['hidden'], 'Number'); if (data.hasOwnProperty('sorting')) obj.sorting = ApiClient.convertToType(data['sorting'], 'Number'); if (data.hasOwnProperty('tags')) obj.tags = ApiClient.convertToType(data['tags'], 'String'); } return obj; } }]); return BookingInterest; }(); /** * @member {Number} status */ BookingInterest.prototype.status = undefined; /** * @member {Number} seminar */ BookingInterest.prototype.seminar = undefined; /** * @member {Number} event */ BookingInterest.prototype.event = undefined; /** * @member {Number} customer */ BookingInterest.prototype.customer = undefined; /** * @member {Number} numberLicenses */ BookingInterest.prototype.numberLicenses = undefined; /** * @member {String} note */ BookingInterest.prototype.note = undefined; /** * @member {Array.<String>} syncFields */ BookingInterest.prototype.syncFields = undefined; /** * @member {Number} id */ BookingInterest.prototype.id = undefined; /** * @member {String} foreignId */ BookingInterest.prototype.foreignId = undefined; /** * @member {Number} language */ BookingInterest.prototype.language = undefined; /** * @member {Number} createDate */ BookingInterest.prototype.createDate = undefined; /** * @member {Number} changeDate */ BookingInterest.prototype.changeDate = undefined; /** * @member {Number} deleted */ BookingInterest.prototype.deleted = undefined; /** * @member {Number} hidden */ BookingInterest.prototype.hidden = undefined; /** * @member {Number} sorting */ BookingInterest.prototype.sorting = undefined; /** * @member {String} tags */ BookingInterest.prototype.tags = undefined; /** * The BookingInterestPaginationResult model module. * @module model/BookingInterestPaginationResult * @version 1.0.0 */ var BookingInterestPaginationResult = /*#__PURE__*/function () { /** * Constructs a new <code>BookingInterestPaginationResult</code>. * @alias module:model/BookingInterestPaginationResult * @class */ function BookingInterestPaginationResult() { _classCallCheck(this, BookingInterestPaginationResult); } /** * Constructs a <code>BookingInterestPaginationResult</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/BookingInterestPaginationResult} obj Optional instance to populate. * @return {module:model/BookingInterestPaginationResult} The populated <code>BookingInterestPaginationResult</code> instance. */ _createClass(BookingInterestPaginationResult, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new BookingInterestPaginationResult(); if (data.hasOwnProperty('limit')) obj.limit = ApiClient.convertToType(data['limit'], 'Number'); if (data.hasOwnProperty('offset')) obj.offset = ApiClient.convertToType(data['offset'], 'Number'); if (data.hasOwnProperty('entryCount')) obj.entryCount = ApiClient.convertToType(data['entryCount'], 'Number'); if (data.hasOwnProperty('maxEntryCount')) obj.maxEntryCount = ApiClient.convertToType(data['maxEntryCount'], 'Number'); if (data.hasOwnProperty('entries')) obj.entries = ApiClient.convertToType(data['entries'], [BookingInterest]); } return obj; } }]); return BookingInterestPaginationResult; }(); /** * @member {Number} limit */ BookingInterestPaginationResult.prototype.limit = undefined; /** * @member {Number} offset */ BookingInterestPaginationResult.prototype.offset = undefined; /** * @member {Number} entryCount */ BookingInterestPaginationResult.prototype.entryCount = undefined; /** * @member {Number} maxEntryCount */ BookingInterestPaginationResult.prototype.maxEntryCount = undefined; /** * @member {Array.<module:model/BookingInterest>} entries */ BookingInterestPaginationResult.prototype.entries = undefined; /** * The Category model module. * @module model/Category * @version 1.0.0 */ var Category = /*#__PURE__*/function () { /** * Constructs a new <code>Category</code>. * @alias module:model/Category * @class */ function Category() { _classCallCheck(this, Category); } /** * Constructs a <code>Category</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/Category} obj Optional instance to populate. * @return {module:model/Category} The populated <code>Category</code> instance. */ _createClass(Category, null, [{ key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new Category(); if (data.hasOwnProperty('_syncFields')) obj.syncFields = ApiClient.convertToType(data['_syncFields'], ['String']); if (data.hasOwnProperty('name')) obj.name = ApiClient.convertToType(data['name'], 'String'); if (data.hasOwnProperty('description')) obj.description = ApiClient.convertToType(data['description'], 'String'); if (data.hasOwnProperty('hideInFilter')) obj.hideInFilter = ApiClient.convertToType(data['hideInFilter'], 'Number'); if (data.hasOwnProperty('id')) obj.id = ApiClient.convertToType(data['id'], 'Number'); if (data.hasOwnProperty('foreignId')) obj.foreignId = ApiClient.convertToType(data['foreignId'], 'String'); if (data.hasOwnProperty('language')) obj.language = ApiClient.convertToType(data['language'], 'Number'); if (data.hasOwnProperty('createDate')) obj.createDate = ApiClient.convertToType(data['createDate'], 'Number'); if (data.hasOwnProperty('changeDate')) obj.changeDate = ApiClient.convertToType(data['changeDate'], 'Number'); if (data.hasOwnProperty('deleted')) obj.deleted = ApiClient.convertToType(data['deleted'], 'Number'); if (data.hasOwnProperty('hidden')) obj.hidden = ApiClient.convertToType(data['hidden'], 'Number'); if (data.hasOwnProperty('sorting')) obj.sorting = ApiClient.convertToType(data['sorting'], 'Number'); if (data.hasOwnProperty('tags')) obj.tags = ApiClient.convertToType(data['tags'], 'String'); if (data.hasOwnProperty('media')) obj.media = ApiClient.convertToType(data['media'], ['Number']); if (data.hasOwnProperty('glyphicon')) obj.glyphicon = ApiClient.convertToType(data['glyphicon'], 'String'); } return obj; } }]); return Category; }(); /** * @member {Array.<String>} syncFields */ Category.prototype.syncFields = undefined; /** * @member {String} name */ Category.prototype.name = undefined; /** * @member {String} description */ Category.prototype.description = undefined; /** * @member {Number} hideInFilter */ Category.prototype.hideInFilter = undefined; /** * @member {Number} id */ Category.prototype.id = undefined; /** * @m