@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_
114 lines (107 loc) • 5.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _AwardRecipient = _interopRequireDefault(require("./AwardRecipient"));
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 Award model module.
* @module model/Award
* @version 3.8.0
*/
var Award = /*#__PURE__*/function () {
/**
* Constructs a new <code>Award</code>.
* @alias module:model/Award
* @param name {String} The name of the award as provided by FIRST. May vary for the same award type.
* @param awardType {Number} Type of award given. See https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/award_type.py#L6
* @param eventKey {String} The event_key of the event the award was won at.
* @param recipientList {Array.<module:model/AwardRecipient>} A list of recipients of the award at the event. May have either a team_key or an awardee, both, or neither (in the case the award wasn't awarded at the event).
* @param year {Number} The year this award was won.
*/
function Award(name, awardType, eventKey, recipientList, year) {
_classCallCheck(this, Award);
Award.initialize(this, name, awardType, eventKey, recipientList, year);
}
/**
* 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(Award, null, [{
key: "initialize",
value: function initialize(obj, name, awardType, eventKey, recipientList, year) {
obj['name'] = name;
obj['award_type'] = awardType;
obj['event_key'] = eventKey;
obj['recipient_list'] = recipientList;
obj['year'] = year;
}
/**
* Constructs a <code>Award</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/Award} obj Optional instance to populate.
* @return {module:model/Award} The populated <code>Award</code> instance.
*/
}, {
key: "constructFromObject",
value: function constructFromObject(data, obj) {
if (data) {
obj = obj || new Award();
if (data.hasOwnProperty('name')) {
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('award_type')) {
obj['award_type'] = _ApiClient["default"].convertToType(data['award_type'], 'Number');
}
if (data.hasOwnProperty('event_key')) {
obj['event_key'] = _ApiClient["default"].convertToType(data['event_key'], 'String');
}
if (data.hasOwnProperty('recipient_list')) {
obj['recipient_list'] = _ApiClient["default"].convertToType(data['recipient_list'], [_AwardRecipient["default"]]);
}
if (data.hasOwnProperty('year')) {
obj['year'] = _ApiClient["default"].convertToType(data['year'], 'Number');
}
}
return obj;
}
}]);
return Award;
}();
/**
* The name of the award as provided by FIRST. May vary for the same award type.
* @member {String} name
*/
Award.prototype['name'] = undefined;
/**
* Type of award given. See https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/award_type.py#L6
* @member {Number} award_type
*/
Award.prototype['award_type'] = undefined;
/**
* The event_key of the event the award was won at.
* @member {String} event_key
*/
Award.prototype['event_key'] = undefined;
/**
* A list of recipients of the award at the event. May have either a team_key or an awardee, both, or neither (in the case the award wasn't awarded at the event).
* @member {Array.<module:model/AwardRecipient>} recipient_list
*/
Award.prototype['recipient_list'] = undefined;
/**
* The year this award was won.
* @member {Number} year
*/
Award.prototype['year'] = undefined;
var _default = Award;
exports["default"] = _default;