@brayjamin/tba-api-v3client
Version:
_Overview__Information_and_statistics_about_FIRST_Robotics_Competition_teams_and_events___Authentication_All_endpoints_require_an_Auth_Key_to_be_passed_in_the_header_X_TBA_Auth_Key__If_you_do_not_have_an_auth_key_yet_you_can_obtain_one_from_your__Account_
190 lines (181 loc) • 6.63 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); }
/**
* The Media model module.
* @module model/Media
* @version 3.8.0
*/
var Media = /*#__PURE__*/function () {
/**
* Constructs a new <code>Media</code>.
* The `Media` object contains a reference for most any media associated with a team or event on TBA.
* @alias module:model/Media
* @param type {module:model/Media.TypeEnum} String type of the media element.
* @param foreignKey {String} The key used to identify this media on the media site.
*/
function Media(type, foreignKey) {
_classCallCheck(this, Media);
Media.initialize(this, type, foreignKey);
}
/**
* 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(Media, null, [{
key: "initialize",
value: function initialize(obj, type, foreignKey) {
obj['type'] = type;
obj['foreign_key'] = foreignKey;
}
/**
* Constructs a <code>Media</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/Media} obj Optional instance to populate.
* @return {module:model/Media} The populated <code>Media</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new Media();
if (data.hasOwnProperty('type')) {
obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('foreign_key')) {
obj['foreign_key'] = _ApiClient["default"].convertToType(data['foreign_key'], 'String');
}
if (data.hasOwnProperty('details')) {
obj['details'] = _ApiClient["default"].convertToType(data['details'], Object);
}
if (data.hasOwnProperty('preferred')) {
obj['preferred'] = _ApiClient["default"].convertToType(data['preferred'], 'Boolean');
}
if (data.hasOwnProperty('direct_url')) {
obj['direct_url'] = _ApiClient["default"].convertToType(data['direct_url'], 'String');
}
if (data.hasOwnProperty('view_url')) {
obj['view_url'] = _ApiClient["default"].convertToType(data['view_url'], 'String');
}
}
return obj;
}
}]);
return Media;
}();
/**
* String type of the media element.
* @member {module:model/Media.TypeEnum} type
*/
Media.prototype['type'] = undefined;
/**
* The key used to identify this media on the media site.
* @member {String} foreign_key
*/
Media.prototype['foreign_key'] = undefined;
/**
* If required, a JSON dict of additional media information.
* @member {Object} details
*/
Media.prototype['details'] = undefined;
/**
* True if the media is of high quality.
* @member {Boolean} preferred
*/
Media.prototype['preferred'] = undefined;
/**
* Direct URL to the media.
* @member {String} direct_url
*/
Media.prototype['direct_url'] = undefined;
/**
* The URL that leads to the full web page for the media, if one exists.
* @member {String} view_url
*/
Media.prototype['view_url'] = undefined;
/**
* Allowed values for the <code>type</code> property.
* @enum {String}
* @readonly
*/
Media['TypeEnum'] = {
/**
* value: "youtube"
* @const
*/
"youtube": "youtube",
/**
* value: "cdphotothread"
* @const
*/
"cdphotothread": "cdphotothread",
/**
* value: "imgur"
* @const
*/
"imgur": "imgur",
/**
* value: "facebook-profile"
* @const
*/
"facebook-profile": "facebook-profile",
/**
* value: "youtube-channel"
* @const
*/
"youtube-channel": "youtube-channel",
/**
* value: "twitter-profile"
* @const
*/
"twitter-profile": "twitter-profile",
/**
* value: "github-profile"
* @const
*/
"github-profile": "github-profile",
/**
* value: "instagram-profile"
* @const
*/
"instagram-profile": "instagram-profile",
/**
* value: "periscope-profile"
* @const
*/
"periscope-profile": "periscope-profile",
/**
* value: "grabcad"
* @const
*/
"grabcad": "grabcad",
/**
* value: "instagram-image"
* @const
*/
"instagram-image": "instagram-image",
/**
* value: "external-link"
* @const
*/
"external-link": "external-link",
/**
* value: "avatar"
* @const
*/
"avatar": "avatar"
};
var _default = Media;
exports["default"] = _default;