@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_
69 lines (66 loc) • 3.92 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _APIStatus = _interopRequireDefault(require("../model/APIStatus"));
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); }
/**
* TBA service.
* @module api/TBAApi
* @version 3.8.0
*/
var TBAApi = /*#__PURE__*/function () {
/**
* Constructs a new TBAApi.
* @alias module:api/TBAApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function TBAApi(apiClient) {
_classCallCheck(this, TBAApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the getStatus operation.
* @callback module:api/TBAApi~getStatusCallback
* @param {String} error Error message, if any.
* @param {module:model/APIStatus} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Returns API status, and TBA status information.
* @param {Object} opts Optional parameters
* @param {String} opts.ifModifiedSince Value of the `Last-Modified` header in the most recently cached response by the client.
* @param {module:api/TBAApi~getStatusCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIStatus}
*/
_createClass(TBAApi, [{
key: "getStatus",
value: function getStatus(opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {};
var headerParams = {
'If-Modified-Since': opts['ifModifiedSince']
};
var formParams = {};
var authNames = ['apiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = _APIStatus["default"];
return this.apiClient.callApi('/status', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
return TBAApi;
}();
exports["default"] = TBAApi;