@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_
111 lines (104 loc) • 5.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _DistrictRankingEventPoints = _interopRequireDefault(require("./DistrictRankingEventPoints"));
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 DistrictRanking model module.
* @module model/DistrictRanking
* @version 3.8.0
*/
var DistrictRanking = /*#__PURE__*/function () {
/**
* Constructs a new <code>DistrictRanking</code>.
* Rank of a team in a district.
* @alias module:model/DistrictRanking
* @param teamKey {String} TBA team key for the team.
* @param rank {Number} Numerical rank of the team, 1 being top rank.
* @param pointTotal {Number} Total district points for the team.
*/
function DistrictRanking(teamKey, rank, pointTotal) {
_classCallCheck(this, DistrictRanking);
DistrictRanking.initialize(this, teamKey, rank, pointTotal);
}
/**
* 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(DistrictRanking, null, [{
key: "initialize",
value: function initialize(obj, teamKey, rank, pointTotal) {
obj['team_key'] = teamKey;
obj['rank'] = rank;
obj['point_total'] = pointTotal;
}
/**
* Constructs a <code>DistrictRanking</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/DistrictRanking} obj Optional instance to populate.
* @return {module:model/DistrictRanking} The populated <code>DistrictRanking</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new DistrictRanking();
if (data.hasOwnProperty('team_key')) {
obj['team_key'] = _ApiClient["default"].convertToType(data['team_key'], 'String');
}
if (data.hasOwnProperty('rank')) {
obj['rank'] = _ApiClient["default"].convertToType(data['rank'], 'Number');
}
if (data.hasOwnProperty('rookie_bonus')) {
obj['rookie_bonus'] = _ApiClient["default"].convertToType(data['rookie_bonus'], 'Number');
}
if (data.hasOwnProperty('point_total')) {
obj['point_total'] = _ApiClient["default"].convertToType(data['point_total'], 'Number');
}
if (data.hasOwnProperty('event_points')) {
obj['event_points'] = _ApiClient["default"].convertToType(data['event_points'], [_DistrictRankingEventPoints["default"]]);
}
}
return obj;
}
}]);
return DistrictRanking;
}();
/**
* TBA team key for the team.
* @member {String} team_key
*/
DistrictRanking.prototype['team_key'] = undefined;
/**
* Numerical rank of the team, 1 being top rank.
* @member {Number} rank
*/
DistrictRanking.prototype['rank'] = undefined;
/**
* Any points added to a team as a result of the rookie bonus.
* @member {Number} rookie_bonus
*/
DistrictRanking.prototype['rookie_bonus'] = undefined;
/**
* Total district points for the team.
* @member {Number} point_total
*/
DistrictRanking.prototype['point_total'] = undefined;
/**
* List of events that contributed to the point total for the team.
* @member {Array.<module:model/DistrictRankingEventPoints>} event_points
*/
DistrictRanking.prototype['event_points'] = undefined;
var _default = DistrictRanking;
exports["default"] = _default;