biojs-rest-tessapi
Version:
API client to interface with the TeSS Rest API. Retrieve a list of metedata about upcoming Life science events, training materials, and other training opportunities. Return results filtered by metadata facets
279 lines (241 loc) • 9.88 kB
JavaScript
/**
* TeSS API
* Access, search and filter through collections of training materials, events, packages, and workflows in TeSS. As a rule of thumb - You can add .json to the end of most pages to retrieve the data in a common exchange format. e.g - https://tess.elixir-europe.org/events/software-carpentry-west-virginia-university.json - https://tess.elixir-europe.org/materials/rna-seq-de-novo-transcriptome-reconstruction-with-rna-seq.json - https://tess.elixir-europe.org/packages/biocomp-computing-skills-collection.json - https://tess.elixir-europe.org/workflows/das-internet-fur-biologen.json - https://tess.elixir-europe.org/nodes/united-kingdom.json
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/ExternalResource', 'model/ScientificTopic'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./ExternalResource'), require('./ScientificTopic'));
} else {
// Browser globals (root is window)
if (!root.TeSsApi) {
root.TeSsApi = {};
}
root.TeSsApi.Material = factory(root.TeSsApi.ApiClient, root.TeSsApi.ExternalResource, root.TeSsApi.ScientificTopic);
}
}(this, function(ApiClient, ExternalResource, ScientificTopic) {
'use strict';
/**
* The Material model module.
* @module model/Material
* @version 1.0.0
*/
/**
* Constructs a new <code>Material</code>.
* @alias module:model/Material
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Material</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/Material} obj Optional instance to populate.
* @return {module:model/Material} The populated <code>Material</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('title')) {
obj['title'] = ApiClient.convertToType(data['title'], 'String');
}
if (data.hasOwnProperty('url')) {
obj['url'] = ApiClient.convertToType(data['url'], 'String');
}
if (data.hasOwnProperty('short_description')) {
obj['short_description'] = ApiClient.convertToType(data['short_description'], 'String');
}
if (data.hasOwnProperty('long_description')) {
obj['long_description'] = ApiClient.convertToType(data['long_description'], 'String');
}
if (data.hasOwnProperty('doi')) {
obj['doi'] = ApiClient.convertToType(data['doi'], 'String');
}
if (data.hasOwnProperty('remote_updated_date')) {
obj['remote_updated_date'] = ApiClient.convertToType(data['remote_updated_date'], 'Date');
}
if (data.hasOwnProperty('remote_created_date')) {
obj['remote_created_date'] = ApiClient.convertToType(data['remote_created_date'], 'Date');
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'Date');
}
if (data.hasOwnProperty('updated_at')) {
obj['updated_at'] = ApiClient.convertToType(data['updated_at'], 'Date');
}
if (data.hasOwnProperty('package_ids')) {
obj['package_ids'] = ApiClient.convertToType(data['package_ids'], ['Number']);
}
if (data.hasOwnProperty('content_provider_id')) {
obj['content_provider_id'] = ApiClient.convertToType(data['content_provider_id'], 'Number');
}
if (data.hasOwnProperty('keywords')) {
obj['keywords'] = ApiClient.convertToType(data['keywords'], ['String']);
}
if (data.hasOwnProperty('scientific_topics')) {
obj['scientific_topics'] = ApiClient.convertToType(data['scientific_topics'], [ScientificTopic]);
}
if (data.hasOwnProperty('licence')) {
obj['licence'] = ApiClient.convertToType(data['licence'], 'String');
}
if (data.hasOwnProperty('difficulty_level')) {
obj['difficulty_level'] = ApiClient.convertToType(data['difficulty_level'], 'String');
}
if (data.hasOwnProperty('authors')) {
obj['authors'] = ApiClient.convertToType(data['authors'], ['String']);
}
if (data.hasOwnProperty('contributors')) {
obj['contributors'] = ApiClient.convertToType(data['contributors'], ['String']);
}
if (data.hasOwnProperty('target_audience')) {
obj['target_audience'] = ApiClient.convertToType(data['target_audience'], ['String']);
}
if (data.hasOwnProperty('external_resources')) {
obj['external_resources'] = ApiClient.convertToType(data['external_resources'], [ExternalResource]);
}
if (data.hasOwnProperty('slug')) {
obj['slug'] = ApiClient.convertToType(data['slug'], 'String');
}
if (data.hasOwnProperty('user_id')) {
obj['user_id'] = ApiClient.convertToType(data['user_id'], 'Number');
}
}
return obj;
}
/**
* Unique identifier of the material
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* The title of the material
* @member {String} title
*/
exports.prototype['title'] = undefined;
/**
* The URL where the actual material can be found.
* @member {String} url
*/
exports.prototype['url'] = undefined;
/**
* A succinct description of what the training material is about.
* @member {String} short_description
*/
exports.prototype['short_description'] = undefined;
/**
* A longer, more indepth explanation of the content of the training material.
* @member {String} long_description
*/
exports.prototype['long_description'] = undefined;
/**
* The DOI of the material (if it has one).
* @member {String} doi
*/
exports.prototype['doi'] = undefined;
/**
* The date the material was last updated on it's original site
* @member {Date} remote_updated_date
*/
exports.prototype['remote_updated_date'] = undefined;
/**
* The date the material was first created on it's original site
* @member {Date} remote_created_date
*/
exports.prototype['remote_created_date'] = undefined;
/**
* The date the material was first created on TeSS
* @member {Date} created_at
*/
exports.prototype['created_at'] = undefined;
/**
* The date the material was last updated on TeSS
* @member {Date} updated_at
*/
exports.prototype['updated_at'] = undefined;
/**
* IDs of training packages this material belongs to
* @member {Array.<Number>} package_ids
*/
exports.prototype['package_ids'] = undefined;
/**
* The ID of the content provider this material was sourced from
* @member {Number} content_provider_id
*/
exports.prototype['content_provider_id'] = undefined;
/**
* A list of freetext keywords to describe the material
* @member {Array.<String>} keywords
*/
exports.prototype['keywords'] = undefined;
/**
* The classification of the material based on the EDAM ontologies scientific topics.
* @member {Array.<module:model/ScientificTopic>} scientific_topics
*/
exports.prototype['scientific_topics'] = undefined;
/**
* The licence chosed to determine how the material may be re-used.
* @member {String} licence
*/
exports.prototype['licence'] = undefined;
/**
* The difficulty level comprehension of the material requires. Can be Beginner, Intermediate, Advanced, or Not specified.
* @member {String} difficulty_level
*/
exports.prototype['difficulty_level'] = undefined;
/**
* A list of people who wrote or helped write the material
* @member {Array.<String>} authors
*/
exports.prototype['authors'] = undefined;
/**
* Any person who was not the author but contributed in some way. Maybe they produced some software used, reviewed the paper, or helped inspire the author
* @member {Array.<String>} contributors
*/
exports.prototype['contributors'] = undefined;
/**
* The audience the material was intended for.
* @member {Array.<String>} target_audience
*/
exports.prototype['target_audience'] = undefined;
/**
* A list of external resources associated with this tool. These are largely tools from bio.tools, and standards, databases, and policies from biosharing.org - but can be anything.
* @member {Array.<module:model/ExternalResource>} external_resources
*/
exports.prototype['external_resources'] = undefined;
/**
* @member {String} slug
*/
exports.prototype['slug'] = undefined;
/**
* @member {Number} user_id
*/
exports.prototype['user_id'] = undefined;
return exports;
}));