@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_
214 lines (200 loc) • 8.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _MatchSimpleAlliances = _interopRequireDefault(require("./MatchSimpleAlliances"));
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 MatchSimple model module.
* @module model/MatchSimple
* @version 3.8.0
*/
var MatchSimple = /*#__PURE__*/function () {
/**
* Constructs a new <code>MatchSimple</code>.
* @alias module:model/MatchSimple
* @param key {String} TBA match key with the format `yyyy[EVENT_CODE]_[COMP_LEVEL]m[MATCH_NUMBER]`, where `yyyy` is the year, and `EVENT_CODE` is the event code of the event, `COMP_LEVEL` is (qm, ef, qf, sf, f), and `MATCH_NUMBER` is the match number in the competition level. A set number may append the competition level if more than one match in required per set.
* @param compLevel {module:model/MatchSimple.CompLevelEnum} The competition level the match was played at.
* @param setNumber {Number} The set number in a series of matches where more than one match is required in the match series.
* @param matchNumber {Number} The match number of the match in the competition level.
* @param eventKey {String} Event key of the event the match was played at.
*/
function MatchSimple(key, compLevel, setNumber, matchNumber, eventKey) {
_classCallCheck(this, MatchSimple);
MatchSimple.initialize(this, key, compLevel, setNumber, matchNumber, eventKey);
}
/**
* 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(MatchSimple, null, [{
key: "initialize",
value: function initialize(obj, key, compLevel, setNumber, matchNumber, eventKey) {
obj['key'] = key;
obj['comp_level'] = compLevel;
obj['set_number'] = setNumber;
obj['match_number'] = matchNumber;
obj['event_key'] = eventKey;
}
/**
* Constructs a <code>MatchSimple</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/MatchSimple} obj Optional instance to populate.
* @return {module:model/MatchSimple} The populated <code>MatchSimple</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new MatchSimple();
if (data.hasOwnProperty('key')) {
obj['key'] = _ApiClient["default"].convertToType(data['key'], 'String');
}
if (data.hasOwnProperty('comp_level')) {
obj['comp_level'] = _ApiClient["default"].convertToType(data['comp_level'], 'String');
}
if (data.hasOwnProperty('set_number')) {
obj['set_number'] = _ApiClient["default"].convertToType(data['set_number'], 'Number');
}
if (data.hasOwnProperty('match_number')) {
obj['match_number'] = _ApiClient["default"].convertToType(data['match_number'], 'Number');
}
if (data.hasOwnProperty('alliances')) {
obj['alliances'] = _MatchSimpleAlliances["default"].constructFromObject(data['alliances']);
}
if (data.hasOwnProperty('winning_alliance')) {
obj['winning_alliance'] = _ApiClient["default"].convertToType(data['winning_alliance'], 'String');
}
if (data.hasOwnProperty('event_key')) {
obj['event_key'] = _ApiClient["default"].convertToType(data['event_key'], 'String');
}
if (data.hasOwnProperty('time')) {
obj['time'] = _ApiClient["default"].convertToType(data['time'], 'Number');
}
if (data.hasOwnProperty('predicted_time')) {
obj['predicted_time'] = _ApiClient["default"].convertToType(data['predicted_time'], 'Number');
}
if (data.hasOwnProperty('actual_time')) {
obj['actual_time'] = _ApiClient["default"].convertToType(data['actual_time'], 'Number');
}
}
return obj;
}
}]);
return MatchSimple;
}();
/**
* TBA match key with the format `yyyy[EVENT_CODE]_[COMP_LEVEL]m[MATCH_NUMBER]`, where `yyyy` is the year, and `EVENT_CODE` is the event code of the event, `COMP_LEVEL` is (qm, ef, qf, sf, f), and `MATCH_NUMBER` is the match number in the competition level. A set number may append the competition level if more than one match in required per set.
* @member {String} key
*/
MatchSimple.prototype['key'] = undefined;
/**
* The competition level the match was played at.
* @member {module:model/MatchSimple.CompLevelEnum} comp_level
*/
MatchSimple.prototype['comp_level'] = undefined;
/**
* The set number in a series of matches where more than one match is required in the match series.
* @member {Number} set_number
*/
MatchSimple.prototype['set_number'] = undefined;
/**
* The match number of the match in the competition level.
* @member {Number} match_number
*/
MatchSimple.prototype['match_number'] = undefined;
/**
* @member {module:model/MatchSimpleAlliances} alliances
*/
MatchSimple.prototype['alliances'] = undefined;
/**
* The color (red/blue) of the winning alliance. Will contain an empty string in the event of no winner, or a tie.
* @member {module:model/MatchSimple.WinningAllianceEnum} winning_alliance
*/
MatchSimple.prototype['winning_alliance'] = undefined;
/**
* Event key of the event the match was played at.
* @member {String} event_key
*/
MatchSimple.prototype['event_key'] = undefined;
/**
* UNIX timestamp (seconds since 1-Jan-1970 00:00:00) of the scheduled match time, as taken from the published schedule.
* @member {Number} time
*/
MatchSimple.prototype['time'] = undefined;
/**
* UNIX timestamp (seconds since 1-Jan-1970 00:00:00) of the TBA predicted match start time.
* @member {Number} predicted_time
*/
MatchSimple.prototype['predicted_time'] = undefined;
/**
* UNIX timestamp (seconds since 1-Jan-1970 00:00:00) of actual match start time.
* @member {Number} actual_time
*/
MatchSimple.prototype['actual_time'] = undefined;
/**
* Allowed values for the <code>comp_level</code> property.
* @enum {String}
* @readonly
*/
MatchSimple['CompLevelEnum'] = {
/**
* value: "qm"
* @const
*/
"qm": "qm",
/**
* value: "ef"
* @const
*/
"ef": "ef",
/**
* value: "qf"
* @const
*/
"qf": "qf",
/**
* value: "sf"
* @const
*/
"sf": "sf",
/**
* value: "f"
* @const
*/
"f": "f"
};
/**
* Allowed values for the <code>winning_alliance</code> property.
* @enum {String}
* @readonly
*/
MatchSimple['WinningAllianceEnum'] = {
/**
* value: "red"
* @const
*/
"red": "red",
/**
* value: "blue"
* @const
*/
"blue": "blue",
/**
* value: ""
* @const
*/
"empty": ""
};
var _default = MatchSimple;
exports["default"] = _default;