UNPKG

@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_

140 lines (130 loc) 6.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _ApiClient = _interopRequireDefault(require("../ApiClient")); var _WLTRecord = _interopRequireDefault(require("./WLTRecord")); 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 EventRankingRankings model module. * @module model/EventRankingRankings * @version 3.8.0 */ var EventRankingRankings = /*#__PURE__*/function () { /** * Constructs a new <code>EventRankingRankings</code>. * @alias module:model/EventRankingRankings * @param matchesPlayed {Number} Number of matches played by this team. * @param record {module:model/WLTRecord} * @param rank {Number} The team's rank at the event as provided by FIRST. * @param dq {Number} Number of times disqualified. * @param teamKey {String} The team with this rank. */ function EventRankingRankings(matchesPlayed, record, rank, dq, teamKey) { _classCallCheck(this, EventRankingRankings); EventRankingRankings.initialize(this, matchesPlayed, record, rank, dq, teamKey); } /** * 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(EventRankingRankings, null, [{ key: "initialize", value: function initialize(obj, matchesPlayed, record, rank, dq, teamKey) { obj['matches_played'] = matchesPlayed; obj['record'] = record; obj['rank'] = rank; obj['dq'] = dq; obj['team_key'] = teamKey; } /** * Constructs a <code>EventRankingRankings</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/EventRankingRankings} obj Optional instance to populate. * @return {module:model/EventRankingRankings} The populated <code>EventRankingRankings</code> instance. */ }, { key: "constructFromObject", value: function constructFromObject(data, obj) { if (data) { obj = obj || new EventRankingRankings(); if (data.hasOwnProperty('matches_played')) { obj['matches_played'] = _ApiClient["default"].convertToType(data['matches_played'], 'Number'); } if (data.hasOwnProperty('qual_average')) { obj['qual_average'] = _ApiClient["default"].convertToType(data['qual_average'], 'Number'); } if (data.hasOwnProperty('extra_stats')) { obj['extra_stats'] = _ApiClient["default"].convertToType(data['extra_stats'], ['Number']); } if (data.hasOwnProperty('sort_orders')) { obj['sort_orders'] = _ApiClient["default"].convertToType(data['sort_orders'], ['Number']); } if (data.hasOwnProperty('record')) { obj['record'] = _WLTRecord["default"].constructFromObject(data['record']); } if (data.hasOwnProperty('rank')) { obj['rank'] = _ApiClient["default"].convertToType(data['rank'], 'Number'); } if (data.hasOwnProperty('dq')) { obj['dq'] = _ApiClient["default"].convertToType(data['dq'], 'Number'); } if (data.hasOwnProperty('team_key')) { obj['team_key'] = _ApiClient["default"].convertToType(data['team_key'], 'String'); } } return obj; } }]); return EventRankingRankings; }(); /** * Number of matches played by this team. * @member {Number} matches_played */ EventRankingRankings.prototype['matches_played'] = undefined; /** * The average match score during qualifications. Year specific. May be null if not relevant for a given year. * @member {Number} qual_average */ EventRankingRankings.prototype['qual_average'] = undefined; /** * Additional special data on the team's performance calculated by TBA. * @member {Array.<Number>} extra_stats */ EventRankingRankings.prototype['extra_stats'] = undefined; /** * Additional year-specific information, may be null. See parent `sort_order_info` for details. * @member {Array.<Number>} sort_orders */ EventRankingRankings.prototype['sort_orders'] = undefined; /** * @member {module:model/WLTRecord} record */ EventRankingRankings.prototype['record'] = undefined; /** * The team's rank at the event as provided by FIRST. * @member {Number} rank */ EventRankingRankings.prototype['rank'] = undefined; /** * Number of times disqualified. * @member {Number} dq */ EventRankingRankings.prototype['dq'] = undefined; /** * The team with this rank. * @member {String} team_key */ EventRankingRankings.prototype['team_key'] = undefined; var _default = EventRankingRankings; exports["default"] = _default;