From 26a8a31435d5494990423b1d518c66d0ab7f5d31 Mon Sep 17 00:00:00 2001 From: Serena Li Date: Fri, 18 Aug 2023 17:14:58 -0700 Subject: [PATCH] switch to typescript-fetch for api generation --- .pre-commit-config.yaml | 5 +- frontend2/.prettierignore | 1 - frontend2/generate_types.bat | 2 +- .../BattlecodeTableBottomElement.tsx | 8 +- .../src/components/CurrentUserProvider.tsx | 4 +- frontend2/src/components/elements/Input.tsx | 2 +- .../sidebar/__test__/Sidebar.test.tsx | 8 +- frontend2/src/contexts/CurrentUserContext.ts | 6 +- frontend2/src/index.tsx | 4 +- frontend2/src/utils/api.ts | 252 +- frontend2/src/utils/apiTypes.ts | 517 +- frontend2/src/utils/auth.ts | 20 +- .../src/utils/types/.openapi-generator/FILES | 127 +- .../utils/types/.openapi-generator/VERSION | 2 +- frontend2/src/utils/types/api/ApiApi.ts | 4442 ----------------- frontend2/src/utils/types/api/api.ts | 3 - frontend2/src/utils/types/apis/ApiApi.ts | 3043 +++++++++++ frontend2/src/utils/types/apis/index.ts | 3 + frontend2/src/utils/types/configuration.ts | 6 - frontend2/src/utils/types/git_push.sh | 57 - frontend2/src/utils/types/index.ts | 9 +- frontend2/src/utils/types/model/Autoscrim.ts | 18 - .../src/utils/types/model/ClassRequirement.ts | 24 - .../src/utils/types/model/CountryEnum.ts | 265 - .../utils/types/model/EligibilityCriterion.ts | 24 - frontend2/src/utils/types/model/Email.ts | 18 - frontend2/src/utils/types/model/Episode.ts | 40 - frontend2/src/utils/types/model/GenderEnum.ts | 21 - .../src/utils/types/model/HistoricalRating.ts | 20 - .../src/utils/types/model/LanguageEnum.ts | 18 - frontend2/src/utils/types/model/Match.ts | 38 - .../src/utils/types/model/MatchParticipant.ts | 32 - .../src/utils/types/model/MatchReport.ts | 20 - frontend2/src/utils/types/model/ModelMap.ts | 24 - .../model/PaginatedClassRequirementList.ts | 24 - .../utils/types/model/PaginatedEpisodeList.ts | 24 - .../utils/types/model/PaginatedMatchList.ts | 24 - .../model/PaginatedScrimmageRequestList.ts | 24 - .../types/model/PaginatedSubmissionList.ts | 24 - .../types/model/PaginatedTeamPublicList.ts | 24 - .../types/model/PaginatedTournamentList.ts | 24 - .../model/PaginatedTournamentRoundList.ts | 24 - .../src/utils/types/model/PasswordToken.ts | 20 - .../utils/types/model/PatchedTeamPrivate.ts | 32 - .../utils/types/model/PatchedUserPrivate.ts | 36 - .../src/utils/types/model/PlayerOrderEnum.ts | 19 - .../utils/types/model/ReleaseStatusEnum.ts | 19 - frontend2/src/utils/types/model/ResetToken.ts | 18 - .../src/utils/types/model/SaturnInvocation.ts | 24 - .../src/utils/types/model/ScrimmageRequest.ts | 46 - .../types/model/ScrimmageRequestStatusEnum.ts | 19 - .../src/utils/types/model/Status526Enum.ts | 20 - .../src/utils/types/model/StatusBccEnum.ts | 23 - frontend2/src/utils/types/model/StyleEnum.ts | 18 - frontend2/src/utils/types/model/Submission.ts | 44 - .../utils/types/model/SubmissionDownload.ts | 22 - .../src/utils/types/model/SubmissionReport.ts | 20 - frontend2/src/utils/types/model/TeamAvatar.ts | 18 - frontend2/src/utils/types/model/TeamCreate.ts | 32 - frontend2/src/utils/types/model/TeamJoin.ts | 20 - .../src/utils/types/model/TeamPrivate.ts | 32 - .../utils/types/model/TeamProfilePrivate.ts | 34 - .../utils/types/model/TeamProfilePublic.ts | 32 - frontend2/src/utils/types/model/TeamPublic.ts | 32 - frontend2/src/utils/types/model/TeamReport.ts | 18 - .../src/utils/types/model/TokenObtainPair.ts | 24 - .../src/utils/types/model/TokenRefresh.ts | 20 - .../src/utils/types/model/TokenVerify.ts | 18 - frontend2/src/utils/types/model/Tournament.ts | 44 - .../src/utils/types/model/TournamentRound.ts | 30 - .../utils/types/model/TournamentSubmission.ts | 46 - frontend2/src/utils/types/model/UserAvatar.ts | 18 - frontend2/src/utils/types/model/UserCreate.ts | 38 - frontend2/src/utils/types/model/UserPassed.ts | 24 - .../src/utils/types/model/UserPrivate.ts | 36 - .../utils/types/model/UserProfilePrivate.ts | 36 - .../utils/types/model/UserProfilePublic.ts | 24 - frontend2/src/utils/types/model/UserPublic.ts | 30 - frontend2/src/utils/types/model/UserResume.ts | 24 - frontend2/src/utils/types/models/Autoscrim.ts | 66 + .../utils/types/models/ClassRequirement.ts | 93 + .../src/utils/types/models/CountryEnum.ts | 284 ++ .../types/models/EligibilityCriterion.ts | 89 + frontend2/src/utils/types/models/Email.ts | 66 + frontend2/src/utils/types/models/Episode.ts | 163 + .../src/utils/types/models/GenderEnum.ts | 40 + .../utils/types/models/HistoricalRating.ts | 75 + .../src/utils/types/models/LanguageEnum.ts | 37 + frontend2/src/utils/types/models/Match.ts | 151 + .../utils/types/models/MatchParticipant.ts | 121 + .../src/utils/types/models/MatchReport.ts | 81 + frontend2/src/utils/types/models/ModelMap.ts | 89 + .../models/PaginatedClassRequirementList.ts | 96 + .../types/models/PaginatedEpisodeList.ts | 96 + .../utils/types/models/PaginatedMatchList.ts | 96 + .../models/PaginatedScrimmageRequestList.ts | 96 + .../types/models/PaginatedSubmissionList.ts | 96 + .../types/models/PaginatedTeamPublicList.ts | 96 + .../types/models/PaginatedTournamentList.ts | 96 + .../models/PaginatedTournamentRoundList.ts | 96 + .../src/utils/types/models/PasswordToken.ts | 75 + .../utils/types/models/PatchedTeamPrivate.ts | 127 + .../utils/types/models/PatchedUserPrivate.ts | 117 + .../src/utils/types/models/PlayerOrderEnum.ts | 38 + .../utils/types/models/ReleaseStatusEnum.ts | 38 + .../src/utils/types/models/ResetToken.ts | 66 + .../utils/types/models/SaturnInvocation.ts | 89 + .../utils/types/models/ScrimmageRequest.ts | 186 + .../models/ScrimmageRequestStatusEnum.ts | 38 + .../src/utils/types/models/Status526Enum.ts | 39 + .../src/utils/types/models/StatusBccEnum.ts | 42 + frontend2/src/utils/types/models/StyleEnum.ts | 37 + .../src/utils/types/models/Submission.ts | 169 + .../utils/types/models/SubmissionDownload.ts | 81 + .../utils/types/models/SubmissionReport.ts | 81 + .../src/utils/types/models/TeamAvatar.ts | 66 + .../src/utils/types/models/TeamCreate.ts | 133 + frontend2/src/utils/types/models/TeamJoin.ts | 75 + .../src/utils/types/models/TeamPrivate.ts | 132 + .../utils/types/models/TeamProfilePrivate.ts | 129 + .../utils/types/models/TeamProfilePublic.ts | 121 + .../src/utils/types/models/TeamPublic.ts | 133 + .../src/utils/types/models/TeamReport.ts | 66 + .../src/utils/types/models/TokenObtainPair.ts | 91 + .../src/utils/types/models/TokenRefresh.ts | 74 + .../src/utils/types/models/TokenVerify.ts | 66 + .../src/utils/types/models/Tournament.ts | 177 + .../src/utils/types/models/TournamentRound.ts | 114 + .../types/models/TournamentSubmission.ts | 177 + .../src/utils/types/models/UserAvatar.ts | 66 + .../src/utils/types/models/UserCreate.ts | 133 + .../src/utils/types/models/UserPassed.ts | 93 + .../src/utils/types/models/UserPrivate.ts | 123 + .../utils/types/models/UserProfilePrivate.ts | 144 + .../utils/types/models/UserProfilePublic.ts | 89 + .../src/utils/types/models/UserPublic.ts | 97 + .../src/utils/types/models/UserResume.ts | 90 + .../{model/models.ts => models/index.ts} | 2 + frontend2/src/utils/types/runtime.ts | 425 ++ frontend2/src/utils/types/variables.ts | 7 - frontend2/src/views/Rankings.tsx | 16 +- 141 files changed, 9705 insertions(+), 6765 deletions(-) delete mode 100644 frontend2/src/utils/types/api/ApiApi.ts delete mode 100644 frontend2/src/utils/types/api/api.ts create mode 100644 frontend2/src/utils/types/apis/ApiApi.ts create mode 100644 frontend2/src/utils/types/apis/index.ts delete mode 100644 frontend2/src/utils/types/configuration.ts delete mode 100644 frontend2/src/utils/types/git_push.sh delete mode 100644 frontend2/src/utils/types/model/Autoscrim.ts delete mode 100644 frontend2/src/utils/types/model/ClassRequirement.ts delete mode 100644 frontend2/src/utils/types/model/CountryEnum.ts delete mode 100644 frontend2/src/utils/types/model/EligibilityCriterion.ts delete mode 100644 frontend2/src/utils/types/model/Email.ts delete mode 100644 frontend2/src/utils/types/model/Episode.ts delete mode 100644 frontend2/src/utils/types/model/GenderEnum.ts delete mode 100644 frontend2/src/utils/types/model/HistoricalRating.ts delete mode 100644 frontend2/src/utils/types/model/LanguageEnum.ts delete mode 100644 frontend2/src/utils/types/model/Match.ts delete mode 100644 frontend2/src/utils/types/model/MatchParticipant.ts delete mode 100644 frontend2/src/utils/types/model/MatchReport.ts delete mode 100644 frontend2/src/utils/types/model/ModelMap.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedClassRequirementList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedEpisodeList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedMatchList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedScrimmageRequestList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedSubmissionList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedTeamPublicList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedTournamentList.ts delete mode 100644 frontend2/src/utils/types/model/PaginatedTournamentRoundList.ts delete mode 100644 frontend2/src/utils/types/model/PasswordToken.ts delete mode 100644 frontend2/src/utils/types/model/PatchedTeamPrivate.ts delete mode 100644 frontend2/src/utils/types/model/PatchedUserPrivate.ts delete mode 100644 frontend2/src/utils/types/model/PlayerOrderEnum.ts delete mode 100644 frontend2/src/utils/types/model/ReleaseStatusEnum.ts delete mode 100644 frontend2/src/utils/types/model/ResetToken.ts delete mode 100644 frontend2/src/utils/types/model/SaturnInvocation.ts delete mode 100644 frontend2/src/utils/types/model/ScrimmageRequest.ts delete mode 100644 frontend2/src/utils/types/model/ScrimmageRequestStatusEnum.ts delete mode 100644 frontend2/src/utils/types/model/Status526Enum.ts delete mode 100644 frontend2/src/utils/types/model/StatusBccEnum.ts delete mode 100644 frontend2/src/utils/types/model/StyleEnum.ts delete mode 100644 frontend2/src/utils/types/model/Submission.ts delete mode 100644 frontend2/src/utils/types/model/SubmissionDownload.ts delete mode 100644 frontend2/src/utils/types/model/SubmissionReport.ts delete mode 100644 frontend2/src/utils/types/model/TeamAvatar.ts delete mode 100644 frontend2/src/utils/types/model/TeamCreate.ts delete mode 100644 frontend2/src/utils/types/model/TeamJoin.ts delete mode 100644 frontend2/src/utils/types/model/TeamPrivate.ts delete mode 100644 frontend2/src/utils/types/model/TeamProfilePrivate.ts delete mode 100644 frontend2/src/utils/types/model/TeamProfilePublic.ts delete mode 100644 frontend2/src/utils/types/model/TeamPublic.ts delete mode 100644 frontend2/src/utils/types/model/TeamReport.ts delete mode 100644 frontend2/src/utils/types/model/TokenObtainPair.ts delete mode 100644 frontend2/src/utils/types/model/TokenRefresh.ts delete mode 100644 frontend2/src/utils/types/model/TokenVerify.ts delete mode 100644 frontend2/src/utils/types/model/Tournament.ts delete mode 100644 frontend2/src/utils/types/model/TournamentRound.ts delete mode 100644 frontend2/src/utils/types/model/TournamentSubmission.ts delete mode 100644 frontend2/src/utils/types/model/UserAvatar.ts delete mode 100644 frontend2/src/utils/types/model/UserCreate.ts delete mode 100644 frontend2/src/utils/types/model/UserPassed.ts delete mode 100644 frontend2/src/utils/types/model/UserPrivate.ts delete mode 100644 frontend2/src/utils/types/model/UserProfilePrivate.ts delete mode 100644 frontend2/src/utils/types/model/UserProfilePublic.ts delete mode 100644 frontend2/src/utils/types/model/UserPublic.ts delete mode 100644 frontend2/src/utils/types/model/UserResume.ts create mode 100644 frontend2/src/utils/types/models/Autoscrim.ts create mode 100644 frontend2/src/utils/types/models/ClassRequirement.ts create mode 100644 frontend2/src/utils/types/models/CountryEnum.ts create mode 100644 frontend2/src/utils/types/models/EligibilityCriterion.ts create mode 100644 frontend2/src/utils/types/models/Email.ts create mode 100644 frontend2/src/utils/types/models/Episode.ts create mode 100644 frontend2/src/utils/types/models/GenderEnum.ts create mode 100644 frontend2/src/utils/types/models/HistoricalRating.ts create mode 100644 frontend2/src/utils/types/models/LanguageEnum.ts create mode 100644 frontend2/src/utils/types/models/Match.ts create mode 100644 frontend2/src/utils/types/models/MatchParticipant.ts create mode 100644 frontend2/src/utils/types/models/MatchReport.ts create mode 100644 frontend2/src/utils/types/models/ModelMap.ts create mode 100644 frontend2/src/utils/types/models/PaginatedClassRequirementList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedEpisodeList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedMatchList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedScrimmageRequestList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedSubmissionList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedTeamPublicList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedTournamentList.ts create mode 100644 frontend2/src/utils/types/models/PaginatedTournamentRoundList.ts create mode 100644 frontend2/src/utils/types/models/PasswordToken.ts create mode 100644 frontend2/src/utils/types/models/PatchedTeamPrivate.ts create mode 100644 frontend2/src/utils/types/models/PatchedUserPrivate.ts create mode 100644 frontend2/src/utils/types/models/PlayerOrderEnum.ts create mode 100644 frontend2/src/utils/types/models/ReleaseStatusEnum.ts create mode 100644 frontend2/src/utils/types/models/ResetToken.ts create mode 100644 frontend2/src/utils/types/models/SaturnInvocation.ts create mode 100644 frontend2/src/utils/types/models/ScrimmageRequest.ts create mode 100644 frontend2/src/utils/types/models/ScrimmageRequestStatusEnum.ts create mode 100644 frontend2/src/utils/types/models/Status526Enum.ts create mode 100644 frontend2/src/utils/types/models/StatusBccEnum.ts create mode 100644 frontend2/src/utils/types/models/StyleEnum.ts create mode 100644 frontend2/src/utils/types/models/Submission.ts create mode 100644 frontend2/src/utils/types/models/SubmissionDownload.ts create mode 100644 frontend2/src/utils/types/models/SubmissionReport.ts create mode 100644 frontend2/src/utils/types/models/TeamAvatar.ts create mode 100644 frontend2/src/utils/types/models/TeamCreate.ts create mode 100644 frontend2/src/utils/types/models/TeamJoin.ts create mode 100644 frontend2/src/utils/types/models/TeamPrivate.ts create mode 100644 frontend2/src/utils/types/models/TeamProfilePrivate.ts create mode 100644 frontend2/src/utils/types/models/TeamProfilePublic.ts create mode 100644 frontend2/src/utils/types/models/TeamPublic.ts create mode 100644 frontend2/src/utils/types/models/TeamReport.ts create mode 100644 frontend2/src/utils/types/models/TokenObtainPair.ts create mode 100644 frontend2/src/utils/types/models/TokenRefresh.ts create mode 100644 frontend2/src/utils/types/models/TokenVerify.ts create mode 100644 frontend2/src/utils/types/models/Tournament.ts create mode 100644 frontend2/src/utils/types/models/TournamentRound.ts create mode 100644 frontend2/src/utils/types/models/TournamentSubmission.ts create mode 100644 frontend2/src/utils/types/models/UserAvatar.ts create mode 100644 frontend2/src/utils/types/models/UserCreate.ts create mode 100644 frontend2/src/utils/types/models/UserPassed.ts create mode 100644 frontend2/src/utils/types/models/UserPrivate.ts create mode 100644 frontend2/src/utils/types/models/UserProfilePrivate.ts create mode 100644 frontend2/src/utils/types/models/UserProfilePublic.ts create mode 100644 frontend2/src/utils/types/models/UserPublic.ts create mode 100644 frontend2/src/utils/types/models/UserResume.ts rename frontend2/src/utils/types/{model/models.ts => models/index.ts} (97%) create mode 100644 frontend2/src/utils/types/runtime.ts delete mode 100644 frontend2/src/utils/types/variables.ts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f90d8ce6..a8f6a0ae3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,16 +4,19 @@ repos: hooks: - id: check-merge-conflict - id: end-of-file-fixer + exclude: ^frontend2/src/utils/types - id: mixed-line-ending args: ["--fix=lf"] + exclude: ^frontend2/src/utils/types - id: trailing-whitespace + exclude: ^frontend2/src/utils/types - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.7.1 hooks: - id: prettier types_or: [css, html, javascript, json, jsx, markdown] - exclude: ^frontend/public/assets + exclude: ^frontend/public/assets | ^frontend2/src/utils/types - repo: https://github.com/dnephin/pre-commit-golang rev: v0.5.1 diff --git a/frontend2/.prettierignore b/frontend2/.prettierignore index f94045d21..0282f4b13 100644 --- a/frontend2/.prettierignore +++ b/frontend2/.prettierignore @@ -2,7 +2,6 @@ /node_modules /.pnp .pnp.js -/types # production /build diff --git a/frontend2/generate_types.bat b/frontend2/generate_types.bat index 3e5ccb73d..e77b02f63 100644 --- a/frontend2/generate_types.bat +++ b/frontend2/generate_types.bat @@ -8,4 +8,4 @@ python backend/manage.py spectacular --file schema.yml :: npm install @openapitools/openapi-generator-cli -g :: if you have a java error, just install java 8 and reload terminal echo "Generate typescript types from schema" -npx @openapitools/openapi-generator-cli generate -i schema.yml -o frontend2/src/utils/types -g typescript-jquery --additional-properties=modelPropertyNaming=camelCase --additional-properties=disallowAdditionalPropertiesIfNotPresent=false +npx @openapitools/openapi-generator-cli generate -i schema.yml -o frontend2/src/utils/types -g typescript-fetch --additional-properties=modelPropertyNaming=original --additional-properties=disallowAdditionalPropertiesIfNotPresent=false --additional-properties=stringEnums=true diff --git a/frontend2/src/components/BattlecodeTableBottomElement.tsx b/frontend2/src/components/BattlecodeTableBottomElement.tsx index 21e6d635d..2732ec030 100644 --- a/frontend2/src/components/BattlecodeTableBottomElement.tsx +++ b/frontend2/src/components/BattlecodeTableBottomElement.tsx @@ -40,16 +40,16 @@ const BattlecodeTableBottomElement: React.FC = ({ return [1, "..."].concat( Array.from( { length: MAX_PAGES - 2 }, - (_, idx) => pageCount - MAX_PAGES + idx + 3 - ) + (_, idx) => pageCount - MAX_PAGES + idx + 3, + ), ); } else { return [1, "..."] .concat( Array.from( { length: MAX_PAGES - 4 }, - (_, idx) => idx + currentPage - 5 - ) + (_, idx) => idx + currentPage - 5, + ), ) .concat(["...", pageCount]); } diff --git a/frontend2/src/components/CurrentUserProvider.tsx b/frontend2/src/components/CurrentUserProvider.tsx index 59f2cc2fd..6f743cea6 100644 --- a/frontend2/src/components/CurrentUserProvider.tsx +++ b/frontend2/src/components/CurrentUserProvider.tsx @@ -6,7 +6,7 @@ import { CurrentUserContext, } from "../contexts/CurrentUserContext"; import * as Api from "../utils/api"; -import { removeApiTokens, doApiTokensExist } from "../utils/cookies"; +import { removeApiTokens } from "../utils/cookies"; export const CurrentUserProvider: React.FC<{ children: React.ReactNode }> = ({ children, @@ -33,7 +33,7 @@ export const CurrentUserProvider: React.FC<{ children: React.ReactNode }> = ({ useEffect(() => { const checkLoggedIn = async (): Promise => { // check if cookies exist before attempting to load user - if (!doApiTokensExist()) { + if (!(await Api.verifyCurrentToken())) { logout(); return; } diff --git a/frontend2/src/components/elements/Input.tsx b/frontend2/src/components/elements/Input.tsx index a34adfcc8..6f7830591 100644 --- a/frontend2/src/components/elements/Input.tsx +++ b/frontend2/src/components/elements/Input.tsx @@ -7,7 +7,7 @@ interface InputProps extends React.ComponentPropsWithoutRef<"input"> { const Input = forwardRef(function Input( { label, required, ...rest }, - ref + ref, ) { required = required ?? false; return ( diff --git a/frontend2/src/components/sidebar/__test__/Sidebar.test.tsx b/frontend2/src/components/sidebar/__test__/Sidebar.test.tsx index 487590334..c4630b6d8 100644 --- a/frontend2/src/components/sidebar/__test__/Sidebar.test.tsx +++ b/frontend2/src/components/sidebar/__test__/Sidebar.test.tsx @@ -9,14 +9,14 @@ test("UI: should link to default episode", () => { render( - + , ); const linkElement = screen .getByText("Resources") .closest("a") ?.getAttribute("href"); expect(linkElement).toEqual( - expect.stringContaining(`/${DEFAULT_EPISODE}/resources`) + expect.stringContaining(`/${DEFAULT_EPISODE}/resources`), ); }); @@ -24,7 +24,7 @@ test("UI: should collapse sidebar", () => { render( - + , ); expect(screen.queryByText("Home")).toBeNull(); }); @@ -37,7 +37,7 @@ test("UI: should link to episode in surrounding context", () => { > - + , ); const linkElement = screen .getByText("Resources") diff --git a/frontend2/src/contexts/CurrentUserContext.ts b/frontend2/src/contexts/CurrentUserContext.ts index 7ab9d51c8..9977054f8 100644 --- a/frontend2/src/contexts/CurrentUserContext.ts +++ b/frontend2/src/contexts/CurrentUserContext.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from "react"; -import { type UserPrivate } from "../utils/types/model/models"; +import { type UserPrivate } from "../utils/types"; export enum AuthStateEnum { LOADING = "loading", @@ -17,7 +17,7 @@ interface CurrentUserContextType { } export const CurrentUserContext = createContext( - null + null, ); export const useCurrentUser = (): CurrentUserContextType => { @@ -25,7 +25,7 @@ export const useCurrentUser = (): CurrentUserContextType => { if (currentUserContext === null) { throw new Error( - "useCurrentUser has to be used within " + "useCurrentUser has to be used within ", ); } diff --git a/frontend2/src/index.tsx b/frontend2/src/index.tsx index cfd778490..e36f82832 100644 --- a/frontend2/src/index.tsx +++ b/frontend2/src/index.tsx @@ -4,10 +4,10 @@ import "./index.css"; import App from "./App"; const root = ReactDOM.createRoot( - document.getElementById("root") as HTMLElement + document.getElementById("root") as HTMLElement, ); root.render( - + , ); diff --git a/frontend2/src/utils/api.ts b/frontend2/src/utils/api.ts index e932878ef..3dd2d1e5c 100644 --- a/frontend2/src/utils/api.ts +++ b/frontend2/src/utils/api.ts @@ -1,8 +1,9 @@ -import { ApiApi } from "./types/api/ApiApi"; +import { ApiApi } from "./types/apis/ApiApi"; import Cookies from "js-cookie"; import * as $ from "jquery"; -import * as models from "./types/model/models"; +import * as models from "./types/models"; import type * as customModels from "./apiTypes"; +import { Configuration } from "./types"; // hacky, fall back to localhost for now const baseUrl = process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"; @@ -11,7 +12,7 @@ const baseUrl = process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"; // TODO: how does url work? @index.tsx? // This is an instance of the auto-generated API class. // The "ApiApi" class should not be imported/used anywhere but this file and auth.ts! -const API = new ApiApi(baseUrl); +const API = new ApiApi(new Configuration({ basePath: baseUrl })); // -- TOKEN HANDLING --// @@ -21,9 +22,9 @@ const API = new ApiApi(baseUrl); * @param credentials The user's credentials. */ export const getApiTokens = async ( - credentials: models.TokenObtainPair + credentials: models.TokenObtainPair, ): Promise => { - return (await API.apiTokenCreate(credentials)).body; + return await API.apiTokenCreate({ tokenObtainPair: credentials }); }; /** @@ -32,12 +33,13 @@ export const getApiTokens = async ( */ export const verifyCurrentToken = async (): Promise => { const accessToken = Cookies.get("access"); - if (accessToken !== undefined) { - return ( - (await API.apiTokenVerifyCreate({ token: accessToken })).response - .status === 200 - ); - } else { + if (accessToken === undefined) { + return false; + } + try { + await API.apiTokenVerifyCreate({ tokenVerify: { token: accessToken } }); + return true; + } catch { return false; } }; @@ -48,11 +50,11 @@ export const verifyCurrentToken = async (): Promise => { * @param episodeId The current episode's ID. */ export const getAllMaps = async ( - episodeId: string + episodeId: string, ): Promise => { return ( ((await $.get( - `${baseUrl}/api/episode/${episodeId}/map/` + `${baseUrl}/api/episode/${episodeId}/map/`, )) as models.ModelMap[]) ?? [] ); }; @@ -65,19 +67,18 @@ export const getAllMaps = async ( */ export const createTeam = async ( episodeId: string, - teamName: string + teamName: string, ): Promise => { // build default object... why? I couldn't tell you - const teamCreate = { + const teamCreate: models.TeamCreate = { id: -1, - episodeId, name: teamName, members: [], - joinKey: "", + join_key: "", status: models.Status526Enum.R, }; - return (await API.apiTeamTCreate(episodeId, teamCreate)).body; + return await API.apiTeamTCreate({ episodeId, teamCreate }); }; /** @@ -89,13 +90,13 @@ export const createTeam = async ( export const joinTeam = async ( episodeId: string, teamName: string, - joinKey: string + joinKey: string, ): Promise => { - const teamInfo = { + const teamJoin: models.TeamJoin = { name: teamName, - joinKey, + join_key: joinKey, }; - await API.apiTeamTJoinCreate(episodeId, teamInfo); + await API.apiTeamTJoinCreate({ episodeId, teamJoin }); }; /** @@ -103,7 +104,7 @@ export const joinTeam = async ( * @param episodeId The current episode's ID. */ export const leaveTeam = async (episodeId: string): Promise => { - await API.apiTeamTLeaveCreate(episodeId); + await API.apiTeamTLeaveCreate({ episodeId }); }; /** @@ -113,9 +114,12 @@ export const leaveTeam = async (episodeId: string): Promise => { */ export const updateUserTeamCode = async ( episodeId: string, - joinKey: string + joinKey: string, ): Promise => { - return (await API.apiTeamTMePartialUpdate(episodeId, { joinKey })).body; + return await API.apiTeamTMePartialUpdate({ + episodeId, + patchedTeamPrivate: { join_key: joinKey }, + }); }; // -- TEAM STATS --// @@ -162,7 +166,7 @@ export const searchTeams = async ( episodeId: string, searchQuery: string, requireActiveSubmission: boolean, - page?: number + page?: number, ): Promise => { const apiURL = `${baseUrl}/api/team/${episodeId}/t`; const encQuery = encodeURIComponent(searchQuery); @@ -179,9 +183,9 @@ export const searchTeams = async ( * @param episodeId The current episode's ID. */ export const getEpisodeInfo = async ( - episodeId: string + episodeId: string, ): Promise => { - return (await API.apiEpisodeERetrieve(episodeId)).body; + return await API.apiEpisodeERetrieve({ id: episodeId }); }; /** @@ -212,7 +216,7 @@ export const uploadSubmission = async ( file: File; packageName: string; description: string; - } + }, ): Promise => { const fileData = new FormData(); fileData.append("source_code", submission.file); @@ -235,28 +239,27 @@ export const uploadSubmission = async ( */ export const downloadSubmission = async ( episodeId: string, - submissionId: number + submissionId: number, ): Promise => { + // the url where the submission is located const url: string = ( - await API.apiCompeteSubmissionDownloadRetrieve( + await API.apiCompeteSubmissionDownloadRetrieve({ episodeId, - submissionId.toString() - ) - ).body.url; - - await fetch(url) - .then(async (response) => await response.blob()) - .then((blob) => { - // code to download the file given by the URL - const objUrl = window.URL.createObjectURL(blob); - const aHelper = document.createElement("a"); - aHelper.style.display = "none"; - aHelper.href = objUrl; - aHelper.download = `battlecode_source_${submissionId}.zip`; - document.body.appendChild(aHelper); - aHelper.click(); - window.URL.revokeObjectURL(objUrl); - }); + id: submissionId.toString(), + }) + ).url; + + const response = await fetch(url); + const blob = await response.blob(); + // code to download the file given by the URL + const objUrl = window.URL.createObjectURL(blob); + const aHelper = document.createElement("a"); + aHelper.style.display = "none"; + aHelper.href = objUrl; + aHelper.download = `battlecode_source_${submissionId}.zip`; + document.body.appendChild(aHelper); + aHelper.click(); + window.URL.revokeObjectURL(objUrl); }; /** @@ -266,9 +269,9 @@ export const downloadSubmission = async ( */ export const getAllSubmissions = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteSubmissionList(episodeId, page)).body; + return await API.apiCompeteSubmissionList({ episodeId, page }); }; /** @@ -278,12 +281,12 @@ export const getAllSubmissions = async ( */ export const getAllUserTournamentSubmissions = async ( episodeId: string, - page?: number + page?: number, ): Promise => { const res: models.Submission[] = (await $.get( `${baseUrl}/api/compete/${episodeId}/submission/tournament/?page=${ page ?? 1 - }` + }`, )) as unknown as models.Submission[]; return { count: res.length, @@ -297,31 +300,33 @@ export const getAllUserTournamentSubmissions = async ( * Create a new user. * @param user The user's info. */ -export const createUser = async ( - user: customModels.CreateUserInput -): Promise => { - const defaultUser = { +export const createUser = async ({ + username, + password, + email, + firstName, + lastName, + profile: { gender, genderDetails, school, country }, +}: customModels.CreateUserInput): Promise => { + const userCreate: models.UserCreate = { id: -1, - isStaff: false, + is_staff: false, + username, + password, + email, + first_name: firstName, + last_name: lastName, profile: { - avatarUrl: "", - hasAvatar: false, - hasResume: false, + gender: gender as models.GenderEnum, + country, + gender_details: genderDetails, + avatar_url: "", + has_avatar: false, + has_resume: false, }, }; // convert our input into models.UserCreate. - return ( - await API.apiUserUCreate({ - ...defaultUser, - ...user, - profile: { - ...defaultUser.profile, - ...user.profile, - gender: user.profile.gender as unknown as models.GenderEnum, - country: user.profile.country as unknown as models.CountryEnum, - }, - }) - ).body; + return await API.apiUserUCreate({ userCreate }); }; /** @@ -329,16 +334,16 @@ export const createUser = async ( * @param userId The user's ID. */ export const getUserProfileByUser = async ( - userId: number + userId: number, ): Promise => { - return (await API.apiUserURetrieve(userId)).body; + return await API.apiUserURetrieve({ id: userId }); }; /** * Get the currently logged in user's profile. */ export const getUserUserProfile = async (): Promise => { - return (await API.apiUserUMeRetrieve()).body; + return await API.apiUserUMeRetrieve(); }; /** @@ -346,18 +351,18 @@ export const getUserUserProfile = async (): Promise => { * @param userId The user's ID. */ export const getTeamsByUser = async ( - userId: number + userId: number, ): Promise => { - return (await API.apiUserUTeamsRetrieve(userId)).body; + return await API.apiUserUTeamsRetrieve({ id: userId }); }; /** * Update the currently logged in user's info. */ export const updateUser = async ( - user: models.PatchedUserPrivate + user: models.PatchedUserPrivate, ): Promise => { - await API.apiUserUMePartialUpdate(user); + await API.apiUserUMePartialUpdate({ patchedUserPrivate: user }); }; // -- AVATARS/RESUMES/REPORTS --// @@ -386,7 +391,7 @@ export const avatarUpload = async (avatarFile: File): Promise => { */ export const teamAvatarUpload = async ( episodeId: string, - avatarFile: File + avatarFile: File, ): Promise => { const data = new FormData(); data.append("avatar", avatarFile); @@ -445,7 +450,7 @@ export const downloadResume = async (): Promise => { */ export const uploadUserTeamReport = async ( episodeId: string, - reportFile: File + reportFile: File, ): Promise => { const data = new FormData(); data.append("report", reportFile); @@ -468,10 +473,10 @@ export const uploadUserTeamReport = async ( */ export const acceptScrimmage = async ( episodeId: string, - scrimmageId: number + scrimmageId: number, ): Promise => { const scrimId = scrimmageId.toString(); - await API.apiCompeteRequestAcceptCreate(episodeId, scrimId); + await API.apiCompeteRequestAcceptCreate({ episodeId, id: scrimId }); }; /** @@ -481,10 +486,10 @@ export const acceptScrimmage = async ( */ export const rejectScrimmage = async ( episodeId: string, - scrimmageId: number + scrimmageId: number, ): Promise => { const scrimId = scrimmageId.toString(); - await API.apiCompeteRequestRejectCreate(episodeId, scrimId); + await API.apiCompeteRequestRejectCreate({ episodeId, id: scrimId }); }; /** @@ -493,9 +498,9 @@ export const rejectScrimmage = async ( */ export const getUserScrimmagesInbox = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteRequestInboxList(episodeId, page)).body; + return await API.apiCompeteRequestInboxList({ episodeId, page }); }; /** @@ -504,9 +509,9 @@ export const getUserScrimmagesInbox = async ( */ export const getUserScrimmagesOutbox = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteRequestOutboxList(episodeId, page)).body; + return await API.apiCompeteRequestOutboxList({ episodeId, page }); }; /** @@ -521,23 +526,26 @@ export const requestScrimmage = async ( requestedTo: number; playerOrder: models.PlayerOrderEnum; mapNames: string[]; - } + }, ): Promise => { // Once again, the important values are params, we can just throw in the rest here to make the type happy - const scrimRequest: models.ScrimmageRequest = { - ...request, + const scrimmageRequest: models.ScrimmageRequest = { + is_ranked: request.isRanked, + requested_to: request.requestedTo, + player_order: request.playerOrder, + map_names: request.mapNames, id: -1, episode: "", - created: "", + created: new Date(), status: models.ScrimmageRequestStatusEnum.P, - requestedBy: -1, - requestedByName: "", - requestedByRating: -1, - requestedToName: "", - requestedToRating: -1, + requested_by: -1, + requested_by_name: "", + requested_by_rating: -1, + requested_to_name: "", + requested_to_rating: -1, maps: [], }; - await API.apiCompeteRequestCreate(episodeId, scrimRequest); + await API.apiCompeteRequestCreate({ episodeId, scrimmageRequest }); }; /** @@ -547,9 +555,9 @@ export const requestScrimmage = async ( */ export const getUserScrimmages = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, page)).body; + return await API.apiCompeteMatchScrimmageList({ episodeId, page }); }; /** @@ -561,9 +569,9 @@ export const getUserScrimmages = async ( export const getScrimmagesByTeam = async ( episodeId: string, teamId: number, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, teamId, page)).body; + return await API.apiCompeteMatchScrimmageList({ episodeId, teamId, page }); }; /** @@ -580,17 +588,15 @@ export const getMatchesByTeam = async ( teamId: number, tournamentId?: string, roundId?: number, - page?: number + page?: number, ): Promise => { - return ( - await API.apiCompeteMatchTournamentList( - episodeId, - page, - roundId, - teamId, - tournamentId - ) - ).body; + return await API.apiCompeteMatchTournamentList({ + episodeId, + page, + roundId, + teamId, + tournamentId, + }); }; /** @@ -600,9 +606,9 @@ export const getMatchesByTeam = async ( */ export const getAllMatches = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteMatchList(episodeId, page)).body; + return await API.apiCompeteMatchList({ episodeId, page }); }; /** @@ -612,9 +618,9 @@ export const getAllMatches = async ( */ export const getAllScrimmages = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, page)).body; + return await API.apiCompeteMatchScrimmageList({ episodeId, page }); }; /** @@ -624,9 +630,9 @@ export const getAllScrimmages = async ( */ export const getUserMatches = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiCompeteMatchList(episodeId, page)).body; + return await API.apiCompeteMatchList({ episodeId, page }); }; // -- TOURNAMENTS --// @@ -635,9 +641,9 @@ export const getUserMatches = async ( * @param episodeId The current episode's ID. */ export const getNextTournament = async ( - episodeId: string + episodeId: string, ): Promise => { - return (await API.apiEpisodeTournamentNextRetrieve(episodeId)).body; + return await API.apiEpisodeTournamentNextRetrieve({ episodeId }); }; /** @@ -647,7 +653,7 @@ export const getNextTournament = async ( */ export const getAllTournaments = async ( episodeId: string, - page?: number + page?: number, ): Promise => { - return (await API.apiEpisodeTournamentList(episodeId, page)).body; + return await API.apiEpisodeTournamentList({ episodeId, page }); }; diff --git a/frontend2/src/utils/apiTypes.ts b/frontend2/src/utils/apiTypes.ts index 6667bd6aa..802ad9af8 100644 --- a/frontend2/src/utils/apiTypes.ts +++ b/frontend2/src/utils/apiTypes.ts @@ -1,272 +1,273 @@ +import { type CountryEnum, GenderEnum as GeneratedGenderEnum } from "./types"; + export enum GenderEnum { - FEMALE = "F", - MALE = "M", - NONBINARY = "N", - SELF_DESCRIBED = "*", - RATHER_NOT_SAY = "?", + FEMALE = GeneratedGenderEnum.F, + MALE = GeneratedGenderEnum.M, + NONBINARY = GeneratedGenderEnum.N, + SELF_DESCRIBED = GeneratedGenderEnum.Star, + RATHER_NOT_SAY = GeneratedGenderEnum.QuestionMark, } export type Gender = `${GenderEnum}`; -const countries = [ - "AF", - "AX", - "AL", - "DZ", - "AS", - "AD", - "AO", - "AI", - "AQ", - "AG", - "AR", - "AM", - "AW", - "AU", - "AT", - "AZ", - "BS", - "BH", - "BD", - "BB", - "BY", - "BE", - "BZ", - "BJ", - "BM", - "BT", - "BO", - "BQ", - "BA", - "BW", - "BV", - "BR", - "IO", - "BN", - "BG", - "BF", - "BI", - "CV", - "KH", - "CM", - "CA", - "KY", - "CF", - "TD", - "CL", - "CN", - "CX", - "CC", - "CO", - "KM", - "CG", - "CD", - "CK", - "CR", - "CI", - "HR", - "CU", - "CW", - "CY", - "CZ", - "DK", - "DJ", - "DM", - "DO", - "EC", - "EG", - "SV", - "GQ", - "ER", - "EE", - "SZ", - "ET", - "FK", - "FO", - "FJ", - "FI", - "FR", - "GF", - "PF", - "TF", - "GA", - "GM", - "GE", - "DE", - "GH", - "GI", - "GR", - "GL", - "GD", - "GP", - "GU", - "GT", - "GG", - "GN", - "GW", - "GY", - "HT", - "HM", - "VA", - "HN", - "HK", - "HU", - "IS", - "IN", - "ID", - "IR", - "IQ", - "IE", - "IM", - "IL", - "IT", - "JM", - "JP", - "JE", - "JO", - "KZ", - "KE", - "KI", - "KW", - "KG", - "LA", - "LV", - "LB", - "LS", - "LR", - "LY", - "LI", - "LT", - "LU", - "MO", - "MG", - "MW", - "MY", - "MV", - "ML", - "MT", - "MH", - "MQ", - "MR", - "MU", - "YT", - "MX", - "FM", - "MD", - "MC", - "MN", - "ME", - "MS", - "MA", - "MZ", - "MM", - "NA", - "NR", - "NP", - "NL", - "NC", - "NZ", - "NI", - "NE", - "NG", - "NU", - "NF", - "KP", - "MK", - "MP", - "NO", - "OM", - "PK", - "PW", - "PS", - "PA", - "PG", - "PY", - "PE", - "PH", - "PN", - "PL", - "PT", - "PR", - "QA", - "RE", - "RO", - "RU", - "RW", - "BL", - "SH", - "KN", - "LC", - "MF", - "PM", - "VC", - "WS", - "SM", - "ST", - "SA", - "SN", - "RS", - "SC", - "SL", - "SG", - "SX", - "SK", - "SI", - "SB", - "SO", - "ZA", - "GS", - "KR", - "SS", - "ES", - "LK", - "SD", - "SR", - "SJ", - "SE", - "CH", - "SY", - "TW", - "TJ", - "TZ", - "TH", - "TL", - "TG", - "TK", - "TO", - "TT", - "TN", - "TR", - "TM", - "TC", - "TV", - "UG", - "UA", - "AE", - "GB", - "UM", - "US", - "UY", - "UZ", - "VU", - "VE", - "VN", - "VG", - "VI", - "WF", - "EH", - "YE", - "ZM", - "ZW", -]; +export const COUNTRIES: Record = { + US: "United States of America", + CA: "Canada", + AU: "Australia", + GB: "United Kingdom", + NL: "Netherlands", + KR: "South Korea", + FR: "France", + AF: "Afghanistan", + AX: "Åland Islands", + AL: "Albania", + DZ: "Algeria", + AS: "American Samoa", + AD: "Andorra", + AO: "Angola", + AI: "Anguilla", + AQ: "Antarctica", + AG: "Antigua and Barbuda", + AR: "Argentina", + AM: "Armenia", + AW: "Aruba", + AT: "Austria", + AZ: "Azerbaijan", + BS: "Bahamas", + BH: "Bahrain", + BD: "Bangladesh", + BB: "Barbados", + BY: "Belarus", + BE: "Belgium", + BZ: "Belize", + BJ: "Benin", + BM: "Bermuda", + BT: "Bhutan", + BO: "Bolivia", + BQ: "Bonaire, Sint Eustatius and Saba", + BA: "Bosnia and Herzegovina", + BW: "Botswana", + BV: "Bouvet Island", + BR: "Brazil", + IO: "British Indian Ocean Territory", + BN: "Brunei", + BG: "Bulgaria", + BF: "Burkina Faso", + BI: "Burundi", + CV: "Cabo Verde", + KH: "Cambodia", + CM: "Cameroon", + KY: "Cayman Islands", + CF: "Central African Republic", + TD: "Chad", + CL: "Chile", + CN: "China", + CX: "Christmas Island", + CC: "Cocos (Keeling) Islands", + CO: "Colombia", + KM: "Comoros", + CG: "Congo", + CD: "Congo (the Democratic Republic of the)", + CK: "Cook Islands", + CR: "Costa Rica", + CI: "Côte d'Ivoire", + HR: "Croatia", + CU: "Cuba", + CW: "Curaçao", + CY: "Cyprus", + CZ: "Czechia", + DK: "Denmark", + DJ: "Djibouti", + DM: "Dominica", + DO: "Dominican Republic", + EC: "Ecuador", + EG: "Egypt", + SV: "El Salvador", + GQ: "Equatorial Guinea", + ER: "Eritrea", + EE: "Estonia", + SZ: "Eswatini", + ET: "Ethiopia", + FK: "Falkland Islands (Malvinas)", + FO: "Faroe Islands", + FJ: "Fiji", + FI: "Finland", + GF: "French Guiana", + PF: "French Polynesia", + TF: "French Southern Territories", + GA: "Gabon", + GM: "Gambia", + GE: "Georgia", + DE: "Germany", + GH: "Ghana", + GI: "Gibraltar", + GR: "Greece", + GL: "Greenland", + GD: "Grenada", + GP: "Guadeloupe", + GU: "Guam", + GT: "Guatemala", + GG: "Guernsey", + GN: "Guinea", + GW: "Guinea-Bissau", + GY: "Guyana", + HT: "Haiti", + HM: "Heard Island and McDonald Islands", + VA: "Holy See", + HN: "Honduras", + HK: "Hong Kong", + HU: "Hungary", + IS: "Iceland", + IN: "India", + ID: "Indonesia", + IR: "Iran", + IQ: "Iraq", + IE: "Ireland", + IM: "Isle of Man", + IL: "Israel", + IT: "Italy", + JM: "Jamaica", + JP: "Japan", + JE: "Jersey", + JO: "Jordan", + KZ: "Kazakhstan", + KE: "Kenya", + KI: "Kiribati", + KW: "Kuwait", + KG: "Kyrgyzstan", + LA: "Laos", + LV: "Latvia", + LB: "Lebanon", + LS: "Lesotho", + LR: "Liberia", + LY: "Libya", + LI: "Liechtenstein", + LT: "Lithuania", + LU: "Luxembourg", + MO: "Macao", + MG: "Madagascar", + MW: "Malawi", + MY: "Malaysia", + MV: "Maldives", + ML: "Mali", + MT: "Malta", + MH: "Marshall Islands", + MQ: "Martinique", + MR: "Mauritania", + MU: "Mauritius", + YT: "Mayotte", + MX: "Mexico", + FM: "Micronesia (Federated States of)", + MD: "Moldova", + MC: "Monaco", + MN: "Mongolia", + ME: "Montenegro", + MS: "Montserrat", + MA: "Morocco", + MZ: "Mozambique", + MM: "Myanmar", + NA: "Namibia", + NR: "Nauru", + NP: "Nepal", + NC: "New Caledonia", + NZ: "New Zealand", + NI: "Nicaragua", + NE: "Niger", + NG: "Nigeria", + NU: "Niue", + NF: "Norfolk Island", + KP: "North Korea", + MK: "North Macedonia", + MP: "Northern Mariana Islands", + NO: "Norway", + OM: "Oman", + PK: "Pakistan", + PW: "Palau", + PS: "Palestine, State of", + PA: "Panama", + PG: "Papua New Guinea", + PY: "Paraguay", + PE: "Peru", + PH: "Philippines", + PN: "Pitcairn", + PL: "Poland", + PT: "Portugal", + PR: "Puerto Rico", + QA: "Qatar", + RE: "Réunion", + RO: "Romania", + RU: "Russia", + RW: "Rwanda", + BL: "Saint Barthélemy", + SH: "Saint Helena, Ascension and Tristan da Cunha", + KN: "Saint Kitts and Nevis", + LC: "Saint Lucia", + MF: "Saint Martin (French part)", + PM: "Saint Pierre and Miquelon", + VC: "Saint Vincent and the Grenadines", + WS: "Samoa", + SM: "San Marino", + ST: "Sao Tome and Principe", + SA: "Saudi Arabia", + SN: "Senegal", + RS: "Serbia", + SC: "Seychelles", + SL: "Sierra Leone", + SG: "Singapore", + SX: "Sint Maarten (Dutch part)", + SK: "Slovakia", + SI: "Slovenia", + SB: "Solomon Islands", + SO: "Somalia", + ZA: "South Africa", + GS: "South Georgia and the South Sandwich Islands", + SS: "South Sudan", + ES: "Spain", + LK: "Sri Lanka", + SD: "Sudan", + SR: "Suriname", + SJ: "Svalbard and Jan Mayen", + SE: "Sweden", + CH: "Switzerland", + SY: "Syria", + TW: "Taiwan", + TJ: "Tajikistan", + TZ: "Tanzania", + TH: "Thailand", + TL: "Timor-Leste", + TG: "Togo", + TK: "Tokelau", + TO: "Tonga", + TT: "Trinidad and Tobago", + TN: "Tunisia", + TR: "Turkey", + TM: "Turkmenistan", + TC: "Turks and Caicos Islands", + TV: "Tuvalu", + UG: "Uganda", + UA: "Ukraine", + AE: "United Arab Emirates", + UM: "United States Minor Outlying Islands", + UY: "Uruguay", + UZ: "Uzbekistan", + VU: "Vanuatu", + VE: "Venezuela", + VN: "Vietnam", + VG: "Virgin Islands (British)", + VI: "Virgin Islands (U.S.)", + WF: "Wallis and Futuna", + EH: "Western Sahara", + YE: "Yemen", + ZM: "Zambia", + ZW: "Zimbabwe", +} as const; -export type Country = (typeof countries)[number]; export interface CreateUserInput { profile: { gender: Gender; genderDetails?: string; school?: string; - country: Country; + country: CountryEnum; }; /** diff --git a/frontend2/src/utils/auth.ts b/frontend2/src/utils/auth.ts index 429128a53..a7f18fef9 100644 --- a/frontend2/src/utils/auth.ts +++ b/frontend2/src/utils/auth.ts @@ -1,17 +1,17 @@ import * as Api from "./api"; import Cookies from "js-cookie"; -import type * as models from "./types/model/models"; -import { ApiApi } from "./types/api/ApiApi"; +import type * as models from "./types/models"; +import { ApiApi } from "./types/apis/ApiApi"; import type * as customModels from "./apiTypes"; +import { Configuration } from "./types"; /** This file contains all frontend authentication functions. Responsible for interacting with Cookies and expiring/setting JWT tokens. */ // hacky, fall back to localhost for now const baseUrl = process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"; - // This is an instance of the auto-generated API class. // The "ApiApi" class should not be imported/used anywhere but this file and auth.ts! -const API = new ApiApi(baseUrl); +const API = new ApiApi(new Configuration({ basePath: baseUrl })); /** * Clear the access and refresh tokens from the browser's cookies. @@ -30,7 +30,7 @@ export const logout = (): void => { */ export const login = async ( username: string, - password: string + password: string, ): Promise => { const credentials = { username, @@ -75,7 +75,7 @@ export const loginCheck = async (): Promise => { * @param user The user to register. */ export const register = async ( - user: customModels.CreateUserInput + user: customModels.CreateUserInput, ): Promise => { const returnedUser = await Api.createUser(user); await login(user.username, user.password); @@ -89,14 +89,16 @@ export const register = async ( */ export const doResetPassword = async ( password: string, - token: string + token: string, ): Promise => { - await API.apiUserPasswordResetConfirmCreate({ password, token }); + await API.apiUserPasswordResetConfirmCreate({ + passwordToken: { password, token }, + }); }; /** * Request a password reset token to be sent to the provided email. */ export const forgotPassword = async (email: string): Promise => { - await API.apiUserPasswordResetCreate({ email }); + await API.apiUserPasswordResetCreate({ email: { email } }); }; diff --git a/frontend2/src/utils/types/.openapi-generator/FILES b/frontend2/src/utils/types/.openapi-generator/FILES index 45ab4061d..25d7e7496 100644 --- a/frontend2/src/utils/types/.openapi-generator/FILES +++ b/frontend2/src/utils/types/.openapi-generator/FILES @@ -1,65 +1,64 @@ -api/ApiApi.ts -api/api.ts -configuration.ts -git_push.sh +.openapi-generator-ignore +apis/ApiApi.ts +apis/index.ts index.ts -model/Autoscrim.ts -model/ClassRequirement.ts -model/CountryEnum.ts -model/EligibilityCriterion.ts -model/Email.ts -model/Episode.ts -model/GenderEnum.ts -model/HistoricalRating.ts -model/LanguageEnum.ts -model/Match.ts -model/MatchParticipant.ts -model/MatchReport.ts -model/ModelMap.ts -model/PaginatedClassRequirementList.ts -model/PaginatedEpisodeList.ts -model/PaginatedMatchList.ts -model/PaginatedScrimmageRequestList.ts -model/PaginatedSubmissionList.ts -model/PaginatedTeamPublicList.ts -model/PaginatedTournamentList.ts -model/PaginatedTournamentRoundList.ts -model/PasswordToken.ts -model/PatchedTeamPrivate.ts -model/PatchedUserPrivate.ts -model/PlayerOrderEnum.ts -model/ReleaseStatusEnum.ts -model/ResetToken.ts -model/SaturnInvocation.ts -model/ScrimmageRequest.ts -model/ScrimmageRequestStatusEnum.ts -model/Status526Enum.ts -model/StatusBccEnum.ts -model/StyleEnum.ts -model/Submission.ts -model/SubmissionDownload.ts -model/SubmissionReport.ts -model/TeamAvatar.ts -model/TeamCreate.ts -model/TeamJoin.ts -model/TeamPrivate.ts -model/TeamProfilePrivate.ts -model/TeamProfilePublic.ts -model/TeamPublic.ts -model/TeamReport.ts -model/TokenObtainPair.ts -model/TokenRefresh.ts -model/TokenVerify.ts -model/Tournament.ts -model/TournamentRound.ts -model/TournamentSubmission.ts -model/UserAvatar.ts -model/UserCreate.ts -model/UserPassed.ts -model/UserPrivate.ts -model/UserProfilePrivate.ts -model/UserProfilePublic.ts -model/UserPublic.ts -model/UserResume.ts -model/models.ts -variables.ts +models/Autoscrim.ts +models/ClassRequirement.ts +models/CountryEnum.ts +models/EligibilityCriterion.ts +models/Email.ts +models/Episode.ts +models/GenderEnum.ts +models/HistoricalRating.ts +models/LanguageEnum.ts +models/Match.ts +models/MatchParticipant.ts +models/MatchReport.ts +models/ModelMap.ts +models/PaginatedClassRequirementList.ts +models/PaginatedEpisodeList.ts +models/PaginatedMatchList.ts +models/PaginatedScrimmageRequestList.ts +models/PaginatedSubmissionList.ts +models/PaginatedTeamPublicList.ts +models/PaginatedTournamentList.ts +models/PaginatedTournamentRoundList.ts +models/PasswordToken.ts +models/PatchedTeamPrivate.ts +models/PatchedUserPrivate.ts +models/PlayerOrderEnum.ts +models/ReleaseStatusEnum.ts +models/ResetToken.ts +models/SaturnInvocation.ts +models/ScrimmageRequest.ts +models/ScrimmageRequestStatusEnum.ts +models/Status526Enum.ts +models/StatusBccEnum.ts +models/StyleEnum.ts +models/Submission.ts +models/SubmissionDownload.ts +models/SubmissionReport.ts +models/TeamAvatar.ts +models/TeamCreate.ts +models/TeamJoin.ts +models/TeamPrivate.ts +models/TeamProfilePrivate.ts +models/TeamProfilePublic.ts +models/TeamPublic.ts +models/TeamReport.ts +models/TokenObtainPair.ts +models/TokenRefresh.ts +models/TokenVerify.ts +models/Tournament.ts +models/TournamentRound.ts +models/TournamentSubmission.ts +models/UserAvatar.ts +models/UserCreate.ts +models/UserPassed.ts +models/UserPrivate.ts +models/UserProfilePrivate.ts +models/UserProfilePublic.ts +models/UserPublic.ts +models/UserResume.ts +models/index.ts +runtime.ts diff --git a/frontend2/src/utils/types/.openapi-generator/VERSION b/frontend2/src/utils/types/.openapi-generator/VERSION index 826f5ce03..cd802a1ec 100644 --- a/frontend2/src/utils/types/.openapi-generator/VERSION +++ b/frontend2/src/utils/types/.openapi-generator/VERSION @@ -1 +1 @@ -6.6.0 +6.6.0 \ No newline at end of file diff --git a/frontend2/src/utils/types/api/ApiApi.ts b/frontend2/src/utils/types/api/ApiApi.ts deleted file mode 100644 index fb30c624c..000000000 --- a/frontend2/src/utils/types/api/ApiApi.ts +++ /dev/null @@ -1,4442 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as $ from 'jquery'; -import * as models from '../model/models'; -import { COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; - -/* tslint:disable:no-unused-variable member-ordering */ - - -export class ApiApi { - protected basePath = 'http://localhost'; - public defaultHeaders: Array = []; - public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = undefined; - public configuration: Configuration = new Configuration(); - - constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - } - if (defaultExtraJQueryAjaxSettings) { - this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; - } - } - - private extendObj(objA: T2, objB: T2): T1|T2 { - for (let key in objB) { - if (objB.hasOwnProperty(key)) { - objA[key] = objB[key]; - } - } - return objA; - } - - /** - * List the historical rating of a team. - * @param episodeId - * @param teamId A team to filter for. Defaults to your own team. - */ - public apiCompeteMatchHistoricalRatingRetrieve(episodeId: string, teamId?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.HistoricalRating; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/historical_rating/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchHistoricalRatingRetrieve.'); - } - - if (teamId !== null && teamId !== undefined) { - queryParameters['team_id'] = teamId; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.HistoricalRating; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.HistoricalRating, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for viewing and retrieving Matches. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiCompeteMatchList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedMatchList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Publish the result of a tournament match to the public bracket. - * @param episodeId - * @param id - */ - public apiCompeteMatchPublishPublicBracketCreate(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/{id}/publish_public_bracket/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchPublishPublicBracketCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteMatchPublishPublicBracketCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Try to finalize the rating of this match. - * @param episodeId - * @param id - */ - public apiCompeteMatchRatingUpdateCreate(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/{id}/rating_update/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchRatingUpdateCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteMatchRatingUpdateCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Report the outcome of this match on Saturn. - * @param episodeId - * @param id - * @param matchReport - */ - public apiCompeteMatchReportCreate(episodeId: string, id: string, matchReport: models.MatchReport, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/{id}/report/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchReportCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteMatchReportCreate.'); - } - - // verify required parameter 'matchReport' is not null or undefined - if (matchReport === null || matchReport === undefined) { - throw new Error('Required parameter matchReport was null or undefined when calling apiCompeteMatchReportCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(matchReport); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for viewing and retrieving Matches. - * @param episodeId - * @param id - */ - public apiCompeteMatchRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Match; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteMatchRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Match; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Match, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * List all scrimmages that a particular team participated in. - * @param episodeId - * @param page A page number within the paginated result set. - * @param teamId A team to filter for. Defaults to your own team. - */ - public apiCompeteMatchScrimmageList(episodeId: string, page?: number, teamId?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/scrimmage/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchScrimmageList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - if (teamId !== null && teamId !== undefined) { - queryParameters['team_id'] = teamId; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedMatchList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * List matches played in a tournament. - * @param episodeId - * @param page A page number within the paginated result set. - * @param roundId A tournament round to filter for. - * @param teamId A team to filter for. - * @param tournamentId A tournament to filter for. - */ - public apiCompeteMatchTournamentList(episodeId: string, page?: number, roundId?: number, teamId?: number, tournamentId?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/match/tournament/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteMatchTournamentList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - if (roundId !== null && roundId !== undefined) { - queryParameters['round_id'] = roundId; - } - if (teamId !== null && teamId !== undefined) { - queryParameters['team_id'] = teamId; - } - if (tournamentId !== null && tournamentId !== undefined) { - queryParameters['tournament_id'] = tournamentId; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedMatchList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedMatchList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Accept a scrimmage request. - * @param episodeId - * @param id - */ - public apiCompeteRequestAcceptCreate(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/{id}/accept/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestAcceptCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteRequestAcceptCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for creating and responding to Scrimmage Requests. - * @param episodeId - * @param scrimmageRequest - */ - public apiCompeteRequestCreate(episodeId: string, scrimmageRequest: models.ScrimmageRequest, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.ScrimmageRequest; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestCreate.'); - } - - // verify required parameter 'scrimmageRequest' is not null or undefined - if (scrimmageRequest === null || scrimmageRequest === undefined) { - throw new Error('Required parameter scrimmageRequest was null or undefined when calling apiCompeteRequestCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(scrimmageRequest); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.ScrimmageRequest; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.ScrimmageRequest, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Cancel a scrimmage request. - * @param episodeId - * @param id - */ - public apiCompeteRequestDestroy(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestDestroy.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteRequestDestroy.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'DELETE', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Get all pending scrimmage requests received. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiCompeteRequestInboxList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedScrimmageRequestList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/inbox/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestInboxList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedScrimmageRequestList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedScrimmageRequestList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Get all pending scrimmage requests sent. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiCompeteRequestOutboxList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedScrimmageRequestList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/outbox/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestOutboxList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedScrimmageRequestList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedScrimmageRequestList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Reject a scrimmage request. - * @param episodeId - * @param id - */ - public apiCompeteRequestRejectCreate(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/request/{id}/reject/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteRequestRejectCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteRequestRejectCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Create a new submission. This operation creates a submission record in the database, saves the source code to the storage bucket on Google cloud, and enqueues the submission for compilation on Saturn. - * @param episodeId - * @param submission - */ - public apiCompeteSubmissionCreate(episodeId: string, submission: models.Submission, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Submission; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionCreate.'); - } - - // verify required parameter 'submission' is not null or undefined - if (submission === null || submission === undefined) { - throw new Error('Required parameter submission was null or undefined when calling apiCompeteSubmissionCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(submission); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Submission; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Submission, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Download the source code associated with a submission. - * @param episodeId - * @param id - */ - public apiCompeteSubmissionDownloadRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.SubmissionDownload; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/{id}/download/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionDownloadRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteSubmissionDownloadRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.SubmissionDownload; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.SubmissionDownload, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for creating and retrieving Submissions. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiCompeteSubmissionList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedSubmissionList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedSubmissionList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedSubmissionList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Report the outcome of this submission on Saturn. - * @param episodeId - * @param id - * @param submissionReport - */ - public apiCompeteSubmissionReportCreate(episodeId: string, id: string, submissionReport: models.SubmissionReport, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/{id}/report/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionReportCreate.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteSubmissionReportCreate.'); - } - - // verify required parameter 'submissionReport' is not null or undefined - if (submissionReport === null || submissionReport === undefined) { - throw new Error('Required parameter submissionReport was null or undefined when calling apiCompeteSubmissionReportCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(submissionReport); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for creating and retrieving Submissions. - * @param episodeId - * @param id - */ - public apiCompeteSubmissionRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Submission; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiCompeteSubmissionRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Submission; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Submission, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve the submissions used in tournaments by the current team.. - * @param episodeId - */ - public apiCompeteSubmissionTournamentRetrieve(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TournamentSubmission; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/compete/{episode_id}/submission/tournament/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiCompeteSubmissionTournamentRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TournamentSubmission; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TournamentSubmission, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Trigger a round of autoscrimmages. - * @param id - * @param autoscrim - */ - public apiEpisodeEAutoscrimCreate(id: string, autoscrim: models.Autoscrim, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/e/{id}/autoscrim/'.replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiEpisodeEAutoscrimCreate.'); - } - - // verify required parameter 'autoscrim' is not null or undefined - if (autoscrim === null || autoscrim === undefined) { - throw new Error('Required parameter autoscrim was null or undefined when calling apiEpisodeEAutoscrimCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(autoscrim); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Episodes. - * @param page A page number within the paginated result set. - */ - public apiEpisodeEList(page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedEpisodeList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/e/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedEpisodeList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedEpisodeList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Episodes. - * @param id - */ - public apiEpisodeERetrieve(id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Episode; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/e/{id}/'.replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiEpisodeERetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Episode; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Episode, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Maps. - * @param episodeId - */ - public apiEpisodeMapList(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: Array; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/map/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeMapList.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: Array; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: Array, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Maps. - * @param episodeId - * @param id - */ - public apiEpisodeMapRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/map/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeMapRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiEpisodeMapRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Tournaments. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiEpisodeTournamentList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedTournamentList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/tournament/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeTournamentList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedTournamentList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedTournamentList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve the next upcoming tournament, as ordered by submission freeze time. - * @param episodeId - */ - public apiEpisodeTournamentNextRetrieve(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Tournament; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/tournament/next/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeTournamentNextRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Tournament; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Tournament, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving Tournaments. - * @param episodeId - * @param id - */ - public apiEpisodeTournamentRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Tournament; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/tournament/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeTournamentRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiEpisodeTournamentRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Tournament; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Tournament, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving tournament rounds. - * @param episodeId - * @param tournament - * @param page A page number within the paginated result set. - */ - public apiEpisodeTournamentRoundList(episodeId: string, tournament: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedTournamentRoundList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/tournament/{tournament}/round/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'tournament' + '}', encodeURIComponent(String(tournament))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeTournamentRoundList.'); - } - - // verify required parameter 'tournament' is not null or undefined - if (tournament === null || tournament === undefined) { - throw new Error('Required parameter tournament was null or undefined when calling apiEpisodeTournamentRoundList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedTournamentRoundList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedTournamentRoundList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving tournament rounds. - * @param episodeId - * @param id - * @param tournament - */ - public apiEpisodeTournamentRoundRetrieve(episodeId: string, id: string, tournament: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TournamentRound; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/episode/{episode_id}/tournament/{tournament}/round/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))).replace('{' + 'tournament' + '}', encodeURIComponent(String(tournament))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); - } - - // verify required parameter 'tournament' is not null or undefined - if (tournament === null || tournament === undefined) { - throw new Error('Required parameter tournament was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TournamentRound; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TournamentRound, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json - * @param format - * @param lang - */ - public apiSpecsRetrieve(format?: 'json' | 'yaml', lang?: 'af' | 'ar' | 'ar-dz' | 'ast' | 'az' | 'be' | 'bg' | 'bn' | 'br' | 'bs' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'dsb' | 'el' | 'en' | 'en-au' | 'en-gb' | 'eo' | 'es' | 'es-ar' | 'es-co' | 'es-mx' | 'es-ni' | 'es-ve' | 'et' | 'eu' | 'fa' | 'fi' | 'fr' | 'fy' | 'ga' | 'gd' | 'gl' | 'he' | 'hi' | 'hr' | 'hsb' | 'hu' | 'hy' | 'ia' | 'id' | 'ig' | 'io' | 'is' | 'it' | 'ja' | 'ka' | 'kab' | 'kk' | 'km' | 'kn' | 'ko' | 'ky' | 'lb' | 'lt' | 'lv' | 'mk' | 'ml' | 'mn' | 'mr' | 'my' | 'nb' | 'ne' | 'nl' | 'nn' | 'os' | 'pa' | 'pl' | 'pt' | 'pt-br' | 'ro' | 'ru' | 'sk' | 'sl' | 'sq' | 'sr' | 'sr-latn' | 'sv' | 'sw' | 'ta' | 'te' | 'tg' | 'th' | 'tk' | 'tr' | 'tt' | 'udm' | 'uk' | 'ur' | 'uz' | 'vi' | 'zh-hans' | 'zh-hant', extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: { [key: string]: any; }; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/specs/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - if (format !== null && format !== undefined) { - queryParameters['format'] = format; - } - if (lang !== null && lang !== undefined) { - queryParameters['lang'] = lang; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/vnd.oai.openapi', - 'application/yaml', - 'application/vnd.oai.openapi+json', - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: { [key: string]: any; }; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: { [key: string]: any; }, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and checking class requirements. - * @param episodeId - * @param id - */ - public apiTeamRequirementCheckRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPassed; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/{id}/check/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementCheckRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiTeamRequirementCheckRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPassed; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPassed, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and checking class requirements. - * @param episodeId - * @param id - */ - public apiTeamRequirementComputeRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPassed; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/{id}/compute/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementComputeRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiTeamRequirementComputeRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPassed; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPassed, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and checking class requirements. - * @param episodeId - * @param page A page number within the paginated result set. - */ - public apiTeamRequirementList(episodeId: string, page?: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedClassRequirementList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementList.'); - } - - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedClassRequirementList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedClassRequirementList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update team strategy report - * @param episodeId - */ - public apiTeamRequirementReportRetrieve(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/report/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementReportRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update team strategy report - * @param episodeId - * @param teamReport - */ - public apiTeamRequirementReportUpdate(episodeId: string, teamReport: models.TeamReport, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/report/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementReportUpdate.'); - } - - // verify required parameter 'teamReport' is not null or undefined - if (teamReport === null || teamReport === undefined) { - throw new Error('Required parameter teamReport was null or undefined when calling apiTeamRequirementReportUpdate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PUT', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(teamReport); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and checking class requirements. - * @param episodeId - * @param id - */ - public apiTeamRequirementRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.ClassRequirement; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/requirement/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamRequirementRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiTeamRequirementRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.ClassRequirement; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.ClassRequirement, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Update uploaded avatar. - * @param episodeId - * @param teamAvatar - */ - public apiTeamTAvatarCreate(episodeId: string, teamAvatar: models.TeamAvatar, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/avatar/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTAvatarCreate.'); - } - - // verify required parameter 'teamAvatar' is not null or undefined - if (teamAvatar === null || teamAvatar === undefined) { - throw new Error('Required parameter teamAvatar was null or undefined when calling apiTeamTAvatarCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(teamAvatar); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. - * @param episodeId - * @param teamCreate - */ - public apiTeamTCreate(episodeId: string, teamCreate: models.TeamCreate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamCreate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTCreate.'); - } - - // verify required parameter 'teamCreate' is not null or undefined - if (teamCreate === null || teamCreate === undefined) { - throw new Error('Required parameter teamCreate was null or undefined when calling apiTeamTCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(teamCreate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamCreate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamCreate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. - * @param episodeId - * @param teamJoin - */ - public apiTeamTJoinCreate(episodeId: string, teamJoin: models.TeamJoin, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/join/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTJoinCreate.'); - } - - // verify required parameter 'teamJoin' is not null or undefined - if (teamJoin === null || teamJoin === undefined) { - throw new Error('Required parameter teamJoin was null or undefined when calling apiTeamTJoinCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(teamJoin); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Leave a team. - * @param episodeId - */ - public apiTeamTLeaveCreate(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/leave/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTLeaveCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. - * @param episodeId - * @param ordering Which field to use when ordering the results. - * @param page A page number within the paginated result set. - * @param search A search term. - */ - public apiTeamTList(episodeId: string, ordering?: string, page?: number, search?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PaginatedTeamPublicList; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTList.'); - } - - if (ordering !== null && ordering !== undefined) { - queryParameters['ordering'] = ordering; - } - if (page !== null && page !== undefined) { - queryParameters['page'] = page; - } - if (search !== null && search !== undefined) { - queryParameters['search'] = search; - } - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PaginatedTeamPublicList; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PaginatedTeamPublicList, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the current team. - * @param episodeId - * @param patchedTeamPrivate - */ - public apiTeamTMePartialUpdate(episodeId: string, patchedTeamPrivate?: models.PatchedTeamPrivate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/me/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTMePartialUpdate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PATCH', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(patchedTeamPrivate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the current team. - * @param episodeId - */ - public apiTeamTMeRetrieve(episodeId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/me/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTMeRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the current team. - * @param episodeId - * @param teamPrivate - */ - public apiTeamTMeUpdate(episodeId: string, teamPrivate?: models.TeamPrivate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/me/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTMeUpdate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PUT', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(teamPrivate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. - * @param episodeId - * @param id - */ - public apiTeamTRetrieve(episodeId: string, id: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamPublic; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/team/{episode_id}/t/{id}/'.replace('{' + 'episode_id' + '}', encodeURIComponent(String(episodeId))).replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'episodeId' is not null or undefined - if (episodeId === null || episodeId === undefined) { - throw new Error('Required parameter episodeId was null or undefined when calling apiTeamTRetrieve.'); - } - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiTeamTRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamPublic; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamPublic, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. - * @param tokenObtainPair - */ - public apiTokenCreate(tokenObtainPair: models.TokenObtainPair, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TokenObtainPair; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/token/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'tokenObtainPair' is not null or undefined - if (tokenObtainPair === null || tokenObtainPair === undefined) { - throw new Error('Required parameter tokenObtainPair was null or undefined when calling apiTokenCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(tokenObtainPair); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TokenObtainPair; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TokenObtainPair, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid. - * @param tokenRefresh - */ - public apiTokenRefreshCreate(tokenRefresh: models.TokenRefresh, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TokenRefresh; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/token/refresh/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'tokenRefresh' is not null or undefined - if (tokenRefresh === null || tokenRefresh === undefined) { - throw new Error('Required parameter tokenRefresh was null or undefined when calling apiTokenRefreshCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(tokenRefresh); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TokenRefresh; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TokenRefresh, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Takes a token and indicates if it is valid. This view provides no information about a token\'s fitness for a particular use. - * @param tokenVerify - */ - public apiTokenVerifyCreate(tokenVerify: models.TokenVerify, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TokenVerify; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/token/verify/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'tokenVerify' is not null or undefined - if (tokenVerify === null || tokenVerify === undefined) { - throw new Error('Required parameter tokenVerify was null or undefined when calling apiTokenVerifyCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(tokenVerify); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TokenVerify; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TokenVerify, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * An Api View which provides a method to reset a password based on a unique token - * @param passwordToken - */ - public apiUserPasswordResetConfirmCreate(passwordToken: models.PasswordToken, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.PasswordToken; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/password_reset/confirm/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'passwordToken' is not null or undefined - if (passwordToken === null || passwordToken === undefined) { - throw new Error('Required parameter passwordToken was null or undefined when calling apiUserPasswordResetConfirmCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(passwordToken); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.PasswordToken; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.PasswordToken, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * An Api View which provides a method to request a password reset token based on an e-mail address Sends a signal reset_password_token_created when a reset token was created - * @param email - */ - public apiUserPasswordResetCreate(email: models.Email, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.Email; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/password_reset/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling apiUserPasswordResetCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(email); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.Email; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.Email, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * An Api View which provides a method to verify that a token is valid - * @param resetToken - */ - public apiUserPasswordResetValidateTokenCreate(resetToken: models.ResetToken, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.ResetToken; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/password_reset/validate_token/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'resetToken' is not null or undefined - if (resetToken === null || resetToken === undefined) { - throw new Error('Required parameter resetToken was null or undefined when calling apiUserPasswordResetValidateTokenCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(resetToken); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.ResetToken; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.ResetToken, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Update uploaded avatar. - * @param userAvatar - */ - public apiUserUAvatarCreate(userAvatar: models.UserAvatar, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/avatar/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'userAvatar' is not null or undefined - if (userAvatar === null || userAvatar === undefined) { - throw new Error('Required parameter userAvatar was null or undefined when calling apiUserUAvatarCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(userAvatar); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body?: any; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all user info. - * @param userCreate - */ - public apiUserUCreate(userCreate: models.UserCreate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserCreate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'userCreate' is not null or undefined - if (userCreate === null || userCreate === undefined) { - throw new Error('Required parameter userCreate was null or undefined when calling apiUserUCreate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'POST', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(userCreate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserCreate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserCreate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the logged-in user. - * @param patchedUserPrivate - */ - public apiUserUMePartialUpdate(patchedUserPrivate?: models.PatchedUserPrivate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/me/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PATCH', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(patchedUserPrivate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the logged-in user. - */ - public apiUserUMeRetrieve(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/me/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update information about the logged-in user. - * @param userPrivate - */ - public apiUserUMeUpdate(userPrivate: models.UserPrivate, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/me/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'userPrivate' is not null or undefined - if (userPrivate === null || userPrivate === undefined) { - throw new Error('Required parameter userPrivate was null or undefined when calling apiUserUMeUpdate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PUT', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(userPrivate); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPrivate; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPrivate, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update the uploaded resume. - */ - public apiUserUResumeRetrieve(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserResume; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/resume/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserResume; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserResume, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve or update the uploaded resume. - * @param userResume - */ - public apiUserUResumeUpdate(userResume: models.UserResume, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserResume; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/resume/'; - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'userResume' is not null or undefined - if (userResume === null || userResume === undefined) { - throw new Error('Required parameter userResume was null or undefined when calling apiUserUResumeUpdate.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - 'application/json', - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - headerParams['Content-Type'] = 'application/json'; - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'PUT', - headers: headerParams, - processData: false - }; - - requestOptions.data = JSON.stringify(userResume); - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserResume; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserResume, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * A viewset for retrieving and updating all user info. - * @param id A unique integer value identifying this user. - */ - public apiUserURetrieve(id: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.UserPublic; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/{id}/'.replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiUserURetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.UserPublic; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.UserPublic, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - - /** - * Retrieve all teams associated with a user. - * @param id A unique integer value identifying this user. - */ - public apiUserUTeamsRetrieve(id: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: models.TeamPublic; }, - { response: JQueryXHR; errorThrown: string } - > { - let localVarPath = this.basePath + '/api/user/u/{id}/teams/'.replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - let queryParameters: any = {}; - let headerParams: any = {}; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling apiUserUTeamsRetrieve.'); - } - - - localVarPath = localVarPath + "?" + $.param(queryParameters); - // to determine the Content-Type header - let consumes: string[] = [ - ]; - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - // authentication (jwtAuth) required - // http basic authentication required - if (this.configuration.username || this.configuration.password) { - headerParams['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); - } - - - let requestOptions: JQueryAjaxSettings = { - url: localVarPath, - type: 'GET', - headers: headerParams, - processData: false - }; - - if (headerParams['Content-Type']) { - requestOptions.contentType = headerParams['Content-Type']; - } - - if (extraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); - } - - if (this.defaultExtraJQueryAjaxSettings) { - requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); - } - - let dfd = $.Deferred< - { response: JQueryXHR; body: models.TeamPublic; }, - { response: JQueryXHR; errorThrown: string } - >(); - $.ajax(requestOptions).then( - (data: models.TeamPublic, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve({response: jqXHR, body: data}), - (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject({response: xhr, errorThrown: errorThrown}) - ); - return dfd.promise(); - } - -} diff --git a/frontend2/src/utils/types/api/api.ts b/frontend2/src/utils/types/api/api.ts deleted file mode 100644 index 9adbafe17..000000000 --- a/frontend2/src/utils/types/api/api.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ApiApi'; -import { ApiApi } from './ApiApi'; -export const APIS = [ApiApi]; diff --git a/frontend2/src/utils/types/apis/ApiApi.ts b/frontend2/src/utils/types/apis/ApiApi.ts new file mode 100644 index 000000000..9de6dc018 --- /dev/null +++ b/frontend2/src/utils/types/apis/ApiApi.ts @@ -0,0 +1,3043 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + Autoscrim, + ClassRequirement, + Email, + Episode, + HistoricalRating, + Match, + MatchReport, + PaginatedClassRequirementList, + PaginatedEpisodeList, + PaginatedMatchList, + PaginatedScrimmageRequestList, + PaginatedSubmissionList, + PaginatedTeamPublicList, + PaginatedTournamentList, + PaginatedTournamentRoundList, + PasswordToken, + PatchedTeamPrivate, + PatchedUserPrivate, + ResetToken, + ScrimmageRequest, + Submission, + SubmissionDownload, + SubmissionReport, + TeamAvatar, + TeamCreate, + TeamJoin, + TeamPrivate, + TeamPublic, + TeamReport, + TokenObtainPair, + TokenRefresh, + TokenVerify, + Tournament, + TournamentRound, + TournamentSubmission, + UserAvatar, + UserCreate, + UserPassed, + UserPrivate, + UserPublic, + UserResume, +} from '../models'; +import { + AutoscrimFromJSON, + AutoscrimToJSON, + ClassRequirementFromJSON, + ClassRequirementToJSON, + EmailFromJSON, + EmailToJSON, + EpisodeFromJSON, + EpisodeToJSON, + HistoricalRatingFromJSON, + HistoricalRatingToJSON, + MatchFromJSON, + MatchToJSON, + MatchReportFromJSON, + MatchReportToJSON, + PaginatedClassRequirementListFromJSON, + PaginatedClassRequirementListToJSON, + PaginatedEpisodeListFromJSON, + PaginatedEpisodeListToJSON, + PaginatedMatchListFromJSON, + PaginatedMatchListToJSON, + PaginatedScrimmageRequestListFromJSON, + PaginatedScrimmageRequestListToJSON, + PaginatedSubmissionListFromJSON, + PaginatedSubmissionListToJSON, + PaginatedTeamPublicListFromJSON, + PaginatedTeamPublicListToJSON, + PaginatedTournamentListFromJSON, + PaginatedTournamentListToJSON, + PaginatedTournamentRoundListFromJSON, + PaginatedTournamentRoundListToJSON, + PasswordTokenFromJSON, + PasswordTokenToJSON, + PatchedTeamPrivateFromJSON, + PatchedTeamPrivateToJSON, + PatchedUserPrivateFromJSON, + PatchedUserPrivateToJSON, + ResetTokenFromJSON, + ResetTokenToJSON, + ScrimmageRequestFromJSON, + ScrimmageRequestToJSON, + SubmissionFromJSON, + SubmissionToJSON, + SubmissionDownloadFromJSON, + SubmissionDownloadToJSON, + SubmissionReportFromJSON, + SubmissionReportToJSON, + TeamAvatarFromJSON, + TeamAvatarToJSON, + TeamCreateFromJSON, + TeamCreateToJSON, + TeamJoinFromJSON, + TeamJoinToJSON, + TeamPrivateFromJSON, + TeamPrivateToJSON, + TeamPublicFromJSON, + TeamPublicToJSON, + TeamReportFromJSON, + TeamReportToJSON, + TokenObtainPairFromJSON, + TokenObtainPairToJSON, + TokenRefreshFromJSON, + TokenRefreshToJSON, + TokenVerifyFromJSON, + TokenVerifyToJSON, + TournamentFromJSON, + TournamentToJSON, + TournamentRoundFromJSON, + TournamentRoundToJSON, + TournamentSubmissionFromJSON, + TournamentSubmissionToJSON, + UserAvatarFromJSON, + UserAvatarToJSON, + UserCreateFromJSON, + UserCreateToJSON, + UserPassedFromJSON, + UserPassedToJSON, + UserPrivateFromJSON, + UserPrivateToJSON, + UserPublicFromJSON, + UserPublicToJSON, + UserResumeFromJSON, + UserResumeToJSON, +} from '../models'; + +export interface ApiCompeteMatchHistoricalRatingRetrieveRequest { + episodeId: string; + teamId?: number; +} + +export interface ApiCompeteMatchListRequest { + episodeId: string; + page?: number; +} + +export interface ApiCompeteMatchPublishPublicBracketCreateRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteMatchRatingUpdateCreateRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteMatchReportCreateRequest { + episodeId: string; + id: string; + matchReport: MatchReport; +} + +export interface ApiCompeteMatchRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteMatchScrimmageListRequest { + episodeId: string; + page?: number; + teamId?: number; +} + +export interface ApiCompeteMatchTournamentListRequest { + episodeId: string; + page?: number; + roundId?: number; + teamId?: number; + tournamentId?: string; +} + +export interface ApiCompeteRequestAcceptCreateRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteRequestCreateRequest { + episodeId: string; + scrimmageRequest: ScrimmageRequest; +} + +export interface ApiCompeteRequestDestroyRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteRequestInboxListRequest { + episodeId: string; + page?: number; +} + +export interface ApiCompeteRequestOutboxListRequest { + episodeId: string; + page?: number; +} + +export interface ApiCompeteRequestRejectCreateRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteSubmissionCreateRequest { + episodeId: string; + submission: Submission; +} + +export interface ApiCompeteSubmissionDownloadRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteSubmissionListRequest { + episodeId: string; + page?: number; +} + +export interface ApiCompeteSubmissionReportCreateRequest { + episodeId: string; + id: string; + submissionReport: SubmissionReport; +} + +export interface ApiCompeteSubmissionRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiCompeteSubmissionTournamentRetrieveRequest { + episodeId: string; +} + +export interface ApiEpisodeEAutoscrimCreateRequest { + id: string; + autoscrim: Autoscrim; +} + +export interface ApiEpisodeEListRequest { + page?: number; +} + +export interface ApiEpisodeERetrieveRequest { + id: string; +} + +export interface ApiEpisodeMapListRequest { + episodeId: string; +} + +export interface ApiEpisodeMapRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiEpisodeTournamentListRequest { + episodeId: string; + page?: number; +} + +export interface ApiEpisodeTournamentNextRetrieveRequest { + episodeId: string; +} + +export interface ApiEpisodeTournamentRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiEpisodeTournamentRoundListRequest { + episodeId: string; + tournament: string; + page?: number; +} + +export interface ApiEpisodeTournamentRoundRetrieveRequest { + episodeId: string; + id: string; + tournament: string; +} + +export interface ApiSpecsRetrieveRequest { + format?: ApiSpecsRetrieveFormatEnum; + lang?: ApiSpecsRetrieveLangEnum; +} + +export interface ApiTeamRequirementCheckRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiTeamRequirementComputeRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiTeamRequirementListRequest { + episodeId: string; + page?: number; +} + +export interface ApiTeamRequirementReportRetrieveRequest { + episodeId: string; +} + +export interface ApiTeamRequirementReportUpdateRequest { + episodeId: string; + teamReport: TeamReport; +} + +export interface ApiTeamRequirementRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiTeamTAvatarCreateRequest { + episodeId: string; + teamAvatar: TeamAvatar; +} + +export interface ApiTeamTCreateRequest { + episodeId: string; + teamCreate: TeamCreate; +} + +export interface ApiTeamTJoinCreateRequest { + episodeId: string; + teamJoin: TeamJoin; +} + +export interface ApiTeamTLeaveCreateRequest { + episodeId: string; +} + +export interface ApiTeamTListRequest { + episodeId: string; + ordering?: string; + page?: number; + search?: string; +} + +export interface ApiTeamTMePartialUpdateRequest { + episodeId: string; + patchedTeamPrivate?: PatchedTeamPrivate; +} + +export interface ApiTeamTMeRetrieveRequest { + episodeId: string; +} + +export interface ApiTeamTMeUpdateRequest { + episodeId: string; + teamPrivate?: TeamPrivate; +} + +export interface ApiTeamTRetrieveRequest { + episodeId: string; + id: string; +} + +export interface ApiTokenCreateRequest { + tokenObtainPair: TokenObtainPair; +} + +export interface ApiTokenRefreshCreateRequest { + tokenRefresh: TokenRefresh; +} + +export interface ApiTokenVerifyCreateRequest { + tokenVerify: TokenVerify; +} + +export interface ApiUserPasswordResetConfirmCreateRequest { + passwordToken: PasswordToken; +} + +export interface ApiUserPasswordResetCreateRequest { + email: Email; +} + +export interface ApiUserPasswordResetValidateTokenCreateRequest { + resetToken: ResetToken; +} + +export interface ApiUserUAvatarCreateRequest { + userAvatar: UserAvatar; +} + +export interface ApiUserUCreateRequest { + userCreate: UserCreate; +} + +export interface ApiUserUMePartialUpdateRequest { + patchedUserPrivate?: PatchedUserPrivate; +} + +export interface ApiUserUMeUpdateRequest { + userPrivate: UserPrivate; +} + +export interface ApiUserUResumeUpdateRequest { + userResume: UserResume; +} + +export interface ApiUserURetrieveRequest { + id: number; +} + +export interface ApiUserUTeamsRetrieveRequest { + id: number; +} + +/** + * + */ +export class ApiApi extends runtime.BaseAPI { + + /** + * List the historical rating of a team. + */ + async apiCompeteMatchHistoricalRatingRetrieveRaw(requestParameters: ApiCompeteMatchHistoricalRatingRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchHistoricalRatingRetrieve.'); + } + + const queryParameters: any = {}; + + if (requestParameters.teamId !== undefined) { + queryParameters['team_id'] = requestParameters.teamId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/historical_rating/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => HistoricalRatingFromJSON(jsonValue)); + } + + /** + * List the historical rating of a team. + */ + async apiCompeteMatchHistoricalRatingRetrieve(requestParameters: ApiCompeteMatchHistoricalRatingRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteMatchHistoricalRatingRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async apiCompeteMatchListRaw(requestParameters: ApiCompeteMatchListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedMatchListFromJSON(jsonValue)); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async apiCompeteMatchList(requestParameters: ApiCompeteMatchListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteMatchListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Publish the result of a tournament match to the public bracket. + */ + async apiCompeteMatchPublishPublicBracketCreateRaw(requestParameters: ApiCompeteMatchPublishPublicBracketCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchPublishPublicBracketCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteMatchPublishPublicBracketCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/{id}/publish_public_bracket/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Publish the result of a tournament match to the public bracket. + */ + async apiCompeteMatchPublishPublicBracketCreate(requestParameters: ApiCompeteMatchPublishPublicBracketCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteMatchPublishPublicBracketCreateRaw(requestParameters, initOverrides); + } + + /** + * Try to finalize the rating of this match. + */ + async apiCompeteMatchRatingUpdateCreateRaw(requestParameters: ApiCompeteMatchRatingUpdateCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchRatingUpdateCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteMatchRatingUpdateCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/{id}/rating_update/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Try to finalize the rating of this match. + */ + async apiCompeteMatchRatingUpdateCreate(requestParameters: ApiCompeteMatchRatingUpdateCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteMatchRatingUpdateCreateRaw(requestParameters, initOverrides); + } + + /** + * Report the outcome of this match on Saturn. + */ + async apiCompeteMatchReportCreateRaw(requestParameters: ApiCompeteMatchReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchReportCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteMatchReportCreate.'); + } + + if (requestParameters.matchReport === null || requestParameters.matchReport === undefined) { + throw new runtime.RequiredError('matchReport','Required parameter requestParameters.matchReport was null or undefined when calling apiCompeteMatchReportCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/{id}/report/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: MatchReportToJSON(requestParameters.matchReport), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Report the outcome of this match on Saturn. + */ + async apiCompeteMatchReportCreate(requestParameters: ApiCompeteMatchReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteMatchReportCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async apiCompeteMatchRetrieveRaw(requestParameters: ApiCompeteMatchRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteMatchRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => MatchFromJSON(jsonValue)); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async apiCompeteMatchRetrieve(requestParameters: ApiCompeteMatchRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteMatchRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all scrimmages that a particular team participated in. + */ + async apiCompeteMatchScrimmageListRaw(requestParameters: ApiCompeteMatchScrimmageListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchScrimmageList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.teamId !== undefined) { + queryParameters['team_id'] = requestParameters.teamId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/scrimmage/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedMatchListFromJSON(jsonValue)); + } + + /** + * List all scrimmages that a particular team participated in. + */ + async apiCompeteMatchScrimmageList(requestParameters: ApiCompeteMatchScrimmageListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteMatchScrimmageListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List matches played in a tournament. + */ + async apiCompeteMatchTournamentListRaw(requestParameters: ApiCompeteMatchTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteMatchTournamentList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.roundId !== undefined) { + queryParameters['round_id'] = requestParameters.roundId; + } + + if (requestParameters.teamId !== undefined) { + queryParameters['team_id'] = requestParameters.teamId; + } + + if (requestParameters.tournamentId !== undefined) { + queryParameters['tournament_id'] = requestParameters.tournamentId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/match/tournament/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedMatchListFromJSON(jsonValue)); + } + + /** + * List matches played in a tournament. + */ + async apiCompeteMatchTournamentList(requestParameters: ApiCompeteMatchTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteMatchTournamentListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Accept a scrimmage request. + */ + async apiCompeteRequestAcceptCreateRaw(requestParameters: ApiCompeteRequestAcceptCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestAcceptCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteRequestAcceptCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/{id}/accept/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Accept a scrimmage request. + */ + async apiCompeteRequestAcceptCreate(requestParameters: ApiCompeteRequestAcceptCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteRequestAcceptCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for creating and responding to Scrimmage Requests. + */ + async apiCompeteRequestCreateRaw(requestParameters: ApiCompeteRequestCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestCreate.'); + } + + if (requestParameters.scrimmageRequest === null || requestParameters.scrimmageRequest === undefined) { + throw new runtime.RequiredError('scrimmageRequest','Required parameter requestParameters.scrimmageRequest was null or undefined when calling apiCompeteRequestCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ScrimmageRequestToJSON(requestParameters.scrimmageRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ScrimmageRequestFromJSON(jsonValue)); + } + + /** + * A viewset for creating and responding to Scrimmage Requests. + */ + async apiCompeteRequestCreate(requestParameters: ApiCompeteRequestCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteRequestCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Cancel a scrimmage request. + */ + async apiCompeteRequestDestroyRaw(requestParameters: ApiCompeteRequestDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestDestroy.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteRequestDestroy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Cancel a scrimmage request. + */ + async apiCompeteRequestDestroy(requestParameters: ApiCompeteRequestDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteRequestDestroyRaw(requestParameters, initOverrides); + } + + /** + * Get all pending scrimmage requests received. + */ + async apiCompeteRequestInboxListRaw(requestParameters: ApiCompeteRequestInboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestInboxList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/inbox/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedScrimmageRequestListFromJSON(jsonValue)); + } + + /** + * Get all pending scrimmage requests received. + */ + async apiCompeteRequestInboxList(requestParameters: ApiCompeteRequestInboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteRequestInboxListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get all pending scrimmage requests sent. + */ + async apiCompeteRequestOutboxListRaw(requestParameters: ApiCompeteRequestOutboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestOutboxList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/outbox/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedScrimmageRequestListFromJSON(jsonValue)); + } + + /** + * Get all pending scrimmage requests sent. + */ + async apiCompeteRequestOutboxList(requestParameters: ApiCompeteRequestOutboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteRequestOutboxListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Reject a scrimmage request. + */ + async apiCompeteRequestRejectCreateRaw(requestParameters: ApiCompeteRequestRejectCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteRequestRejectCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteRequestRejectCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/request/{id}/reject/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Reject a scrimmage request. + */ + async apiCompeteRequestRejectCreate(requestParameters: ApiCompeteRequestRejectCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteRequestRejectCreateRaw(requestParameters, initOverrides); + } + + /** + * Create a new submission. This operation creates a submission record in the database, saves the source code to the storage bucket on Google cloud, and enqueues the submission for compilation on Saturn. + */ + async apiCompeteSubmissionCreateRaw(requestParameters: ApiCompeteSubmissionCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionCreate.'); + } + + if (requestParameters.submission === null || requestParameters.submission === undefined) { + throw new runtime.RequiredError('submission','Required parameter requestParameters.submission was null or undefined when calling apiCompeteSubmissionCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SubmissionToJSON(requestParameters.submission), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); + } + + /** + * Create a new submission. This operation creates a submission record in the database, saves the source code to the storage bucket on Google cloud, and enqueues the submission for compilation on Saturn. + */ + async apiCompeteSubmissionCreate(requestParameters: ApiCompeteSubmissionCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteSubmissionCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Download the source code associated with a submission. + */ + async apiCompeteSubmissionDownloadRetrieveRaw(requestParameters: ApiCompeteSubmissionDownloadRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionDownloadRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteSubmissionDownloadRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/{id}/download/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionDownloadFromJSON(jsonValue)); + } + + /** + * Download the source code associated with a submission. + */ + async apiCompeteSubmissionDownloadRetrieve(requestParameters: ApiCompeteSubmissionDownloadRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteSubmissionDownloadRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async apiCompeteSubmissionListRaw(requestParameters: ApiCompeteSubmissionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedSubmissionListFromJSON(jsonValue)); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async apiCompeteSubmissionList(requestParameters: ApiCompeteSubmissionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteSubmissionListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Report the outcome of this submission on Saturn. + */ + async apiCompeteSubmissionReportCreateRaw(requestParameters: ApiCompeteSubmissionReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionReportCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteSubmissionReportCreate.'); + } + + if (requestParameters.submissionReport === null || requestParameters.submissionReport === undefined) { + throw new runtime.RequiredError('submissionReport','Required parameter requestParameters.submissionReport was null or undefined when calling apiCompeteSubmissionReportCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/{id}/report/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SubmissionReportToJSON(requestParameters.submissionReport), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Report the outcome of this submission on Saturn. + */ + async apiCompeteSubmissionReportCreate(requestParameters: ApiCompeteSubmissionReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiCompeteSubmissionReportCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async apiCompeteSubmissionRetrieveRaw(requestParameters: ApiCompeteSubmissionRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiCompeteSubmissionRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async apiCompeteSubmissionRetrieve(requestParameters: ApiCompeteSubmissionRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteSubmissionRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve the submissions used in tournaments by the current team.. + */ + async apiCompeteSubmissionTournamentRetrieveRaw(requestParameters: ApiCompeteSubmissionTournamentRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiCompeteSubmissionTournamentRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/compete/{episode_id}/submission/tournament/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TournamentSubmissionFromJSON(jsonValue)); + } + + /** + * Retrieve the submissions used in tournaments by the current team.. + */ + async apiCompeteSubmissionTournamentRetrieve(requestParameters: ApiCompeteSubmissionTournamentRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiCompeteSubmissionTournamentRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Trigger a round of autoscrimmages. + */ + async apiEpisodeEAutoscrimCreateRaw(requestParameters: ApiEpisodeEAutoscrimCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiEpisodeEAutoscrimCreate.'); + } + + if (requestParameters.autoscrim === null || requestParameters.autoscrim === undefined) { + throw new runtime.RequiredError('autoscrim','Required parameter requestParameters.autoscrim was null or undefined when calling apiEpisodeEAutoscrimCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/e/{id}/autoscrim/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AutoscrimToJSON(requestParameters.autoscrim), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Trigger a round of autoscrimmages. + */ + async apiEpisodeEAutoscrimCreate(requestParameters: ApiEpisodeEAutoscrimCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiEpisodeEAutoscrimCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving Episodes. + */ + async apiEpisodeEListRaw(requestParameters: ApiEpisodeEListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/e/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedEpisodeListFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving Episodes. + */ + async apiEpisodeEList(requestParameters: ApiEpisodeEListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeEListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Episodes. + */ + async apiEpisodeERetrieveRaw(requestParameters: ApiEpisodeERetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiEpisodeERetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/e/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EpisodeFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving Episodes. + */ + async apiEpisodeERetrieve(requestParameters: ApiEpisodeERetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeERetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Maps. + */ + async apiEpisodeMapListRaw(requestParameters: ApiEpisodeMapListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeMapList.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/map/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * A viewset for retrieving Maps. + */ + async apiEpisodeMapList(requestParameters: ApiEpisodeMapListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.apiEpisodeMapListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Maps. + */ + async apiEpisodeMapRetrieveRaw(requestParameters: ApiEpisodeMapRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeMapRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiEpisodeMapRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/map/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * A viewset for retrieving Maps. + */ + async apiEpisodeMapRetrieve(requestParameters: ApiEpisodeMapRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeMapRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Tournaments. + */ + async apiEpisodeTournamentListRaw(requestParameters: ApiEpisodeTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeTournamentList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/tournament/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTournamentListFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving Tournaments. + */ + async apiEpisodeTournamentList(requestParameters: ApiEpisodeTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeTournamentListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve the next upcoming tournament, as ordered by submission freeze time. + */ + async apiEpisodeTournamentNextRetrieveRaw(requestParameters: ApiEpisodeTournamentNextRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeTournamentNextRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/tournament/next/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TournamentFromJSON(jsonValue)); + } + + /** + * Retrieve the next upcoming tournament, as ordered by submission freeze time. + */ + async apiEpisodeTournamentNextRetrieve(requestParameters: ApiEpisodeTournamentNextRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeTournamentNextRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Tournaments. + */ + async apiEpisodeTournamentRetrieveRaw(requestParameters: ApiEpisodeTournamentRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeTournamentRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiEpisodeTournamentRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/tournament/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TournamentFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving Tournaments. + */ + async apiEpisodeTournamentRetrieve(requestParameters: ApiEpisodeTournamentRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeTournamentRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async apiEpisodeTournamentRoundListRaw(requestParameters: ApiEpisodeTournamentRoundListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeTournamentRoundList.'); + } + + if (requestParameters.tournament === null || requestParameters.tournament === undefined) { + throw new runtime.RequiredError('tournament','Required parameter requestParameters.tournament was null or undefined when calling apiEpisodeTournamentRoundList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/tournament/{tournament}/round/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"tournament"}}`, encodeURIComponent(String(requestParameters.tournament))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTournamentRoundListFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async apiEpisodeTournamentRoundList(requestParameters: ApiEpisodeTournamentRoundListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeTournamentRoundListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async apiEpisodeTournamentRoundRetrieveRaw(requestParameters: ApiEpisodeTournamentRoundRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); + } + + if (requestParameters.tournament === null || requestParameters.tournament === undefined) { + throw new runtime.RequiredError('tournament','Required parameter requestParameters.tournament was null or undefined when calling apiEpisodeTournamentRoundRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/episode/{episode_id}/tournament/{tournament}/round/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"tournament"}}`, encodeURIComponent(String(requestParameters.tournament))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TournamentRoundFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async apiEpisodeTournamentRoundRetrieve(requestParameters: ApiEpisodeTournamentRoundRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiEpisodeTournamentRoundRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json + */ + async apiSpecsRetrieveRaw(requestParameters: ApiSpecsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.format !== undefined) { + queryParameters['format'] = requestParameters.format; + } + + if (requestParameters.lang !== undefined) { + queryParameters['lang'] = requestParameters.lang; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/specs/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json + */ + async apiSpecsRetrieve(requestParameters: ApiSpecsRetrieveRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> { + const response = await this.apiSpecsRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementCheckRetrieveRaw(requestParameters: ApiTeamRequirementCheckRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementCheckRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiTeamRequirementCheckRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/{id}/check/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPassedFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementCheckRetrieve(requestParameters: ApiTeamRequirementCheckRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamRequirementCheckRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementComputeRetrieveRaw(requestParameters: ApiTeamRequirementComputeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementComputeRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiTeamRequirementComputeRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/{id}/compute/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPassedFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementComputeRetrieve(requestParameters: ApiTeamRequirementComputeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamRequirementComputeRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementListRaw(requestParameters: ApiTeamRequirementListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedClassRequirementListFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementList(requestParameters: ApiTeamRequirementListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamRequirementListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update team strategy report + */ + async apiTeamRequirementReportRetrieveRaw(requestParameters: ApiTeamRequirementReportRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementReportRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/report/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Retrieve or update team strategy report + */ + async apiTeamRequirementReportRetrieve(requestParameters: ApiTeamRequirementReportRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiTeamRequirementReportRetrieveRaw(requestParameters, initOverrides); + } + + /** + * Retrieve or update team strategy report + */ + async apiTeamRequirementReportUpdateRaw(requestParameters: ApiTeamRequirementReportUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementReportUpdate.'); + } + + if (requestParameters.teamReport === null || requestParameters.teamReport === undefined) { + throw new runtime.RequiredError('teamReport','Required parameter requestParameters.teamReport was null or undefined when calling apiTeamRequirementReportUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/report/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TeamReportToJSON(requestParameters.teamReport), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Retrieve or update team strategy report + */ + async apiTeamRequirementReportUpdate(requestParameters: ApiTeamRequirementReportUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiTeamRequirementReportUpdateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementRetrieveRaw(requestParameters: ApiTeamRequirementRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamRequirementRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiTeamRequirementRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/requirement/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ClassRequirementFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async apiTeamRequirementRetrieve(requestParameters: ApiTeamRequirementRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamRequirementRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update uploaded avatar. + */ + async apiTeamTAvatarCreateRaw(requestParameters: ApiTeamTAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTAvatarCreate.'); + } + + if (requestParameters.teamAvatar === null || requestParameters.teamAvatar === undefined) { + throw new runtime.RequiredError('teamAvatar','Required parameter requestParameters.teamAvatar was null or undefined when calling apiTeamTAvatarCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/avatar/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TeamAvatarToJSON(requestParameters.teamAvatar), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update uploaded avatar. + */ + async apiTeamTAvatarCreate(requestParameters: ApiTeamTAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiTeamTAvatarCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTCreateRaw(requestParameters: ApiTeamTCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTCreate.'); + } + + if (requestParameters.teamCreate === null || requestParameters.teamCreate === undefined) { + throw new runtime.RequiredError('teamCreate','Required parameter requestParameters.teamCreate was null or undefined when calling apiTeamTCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TeamCreateToJSON(requestParameters.teamCreate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamCreateFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTCreate(requestParameters: ApiTeamTCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTJoinCreateRaw(requestParameters: ApiTeamTJoinCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTJoinCreate.'); + } + + if (requestParameters.teamJoin === null || requestParameters.teamJoin === undefined) { + throw new runtime.RequiredError('teamJoin','Required parameter requestParameters.teamJoin was null or undefined when calling apiTeamTJoinCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/join/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TeamJoinToJSON(requestParameters.teamJoin), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTJoinCreate(requestParameters: ApiTeamTJoinCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiTeamTJoinCreateRaw(requestParameters, initOverrides); + } + + /** + * Leave a team. + */ + async apiTeamTLeaveCreateRaw(requestParameters: ApiTeamTLeaveCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTLeaveCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/leave/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Leave a team. + */ + async apiTeamTLeaveCreate(requestParameters: ApiTeamTLeaveCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiTeamTLeaveCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTListRaw(requestParameters: ApiTeamTListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTList.'); + } + + const queryParameters: any = {}; + + if (requestParameters.ordering !== undefined) { + queryParameters['ordering'] = requestParameters.ordering; + } + + if (requestParameters.page !== undefined) { + queryParameters['page'] = requestParameters.page; + } + + if (requestParameters.search !== undefined) { + queryParameters['search'] = requestParameters.search; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTeamPublicListFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTList(requestParameters: ApiTeamTListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMePartialUpdateRaw(requestParameters: ApiTeamTMePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTMePartialUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/me/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: PatchedTeamPrivateToJSON(requestParameters.patchedTeamPrivate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMePartialUpdate(requestParameters: ApiTeamTMePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTMePartialUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMeRetrieveRaw(requestParameters: ApiTeamTMeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTMeRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/me/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMeRetrieve(requestParameters: ApiTeamTMeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTMeRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMeUpdateRaw(requestParameters: ApiTeamTMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTMeUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/me/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: TeamPrivateToJSON(requestParameters.teamPrivate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the current team. + */ + async apiTeamTMeUpdate(requestParameters: ApiTeamTMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTMeUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTRetrieveRaw(requestParameters: ApiTeamTRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { + throw new runtime.RequiredError('episodeId','Required parameter requestParameters.episodeId was null or undefined when calling apiTeamTRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiTeamTRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/team/{episode_id}/t/{id}/`.replace(`{${"episode_id"}}`, encodeURIComponent(String(requestParameters.episodeId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPublicFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all team/team profile info. When creating a team, add the logged in user as the sole member. + */ + async apiTeamTRetrieve(requestParameters: ApiTeamTRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTeamTRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. + */ + async apiTokenCreateRaw(requestParameters: ApiTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenObtainPair === null || requestParameters.tokenObtainPair === undefined) { + throw new runtime.RequiredError('tokenObtainPair','Required parameter requestParameters.tokenObtainPair was null or undefined when calling apiTokenCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/token/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TokenObtainPairToJSON(requestParameters.tokenObtainPair), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenObtainPairFromJSON(jsonValue)); + } + + /** + * Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. + */ + async apiTokenCreate(requestParameters: ApiTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTokenCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid. + */ + async apiTokenRefreshCreateRaw(requestParameters: ApiTokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenRefresh === null || requestParameters.tokenRefresh === undefined) { + throw new runtime.RequiredError('tokenRefresh','Required parameter requestParameters.tokenRefresh was null or undefined when calling apiTokenRefreshCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/token/refresh/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TokenRefreshToJSON(requestParameters.tokenRefresh), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenRefreshFromJSON(jsonValue)); + } + + /** + * Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid. + */ + async apiTokenRefreshCreate(requestParameters: ApiTokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTokenRefreshCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Takes a token and indicates if it is valid. This view provides no information about a token\'s fitness for a particular use. + */ + async apiTokenVerifyCreateRaw(requestParameters: ApiTokenVerifyCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenVerify === null || requestParameters.tokenVerify === undefined) { + throw new runtime.RequiredError('tokenVerify','Required parameter requestParameters.tokenVerify was null or undefined when calling apiTokenVerifyCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/token/verify/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TokenVerifyToJSON(requestParameters.tokenVerify), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TokenVerifyFromJSON(jsonValue)); + } + + /** + * Takes a token and indicates if it is valid. This view provides no information about a token\'s fitness for a particular use. + */ + async apiTokenVerifyCreate(requestParameters: ApiTokenVerifyCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiTokenVerifyCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * An Api View which provides a method to reset a password based on a unique token + */ + async apiUserPasswordResetConfirmCreateRaw(requestParameters: ApiUserPasswordResetConfirmCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.passwordToken === null || requestParameters.passwordToken === undefined) { + throw new runtime.RequiredError('passwordToken','Required parameter requestParameters.passwordToken was null or undefined when calling apiUserPasswordResetConfirmCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/user/password_reset/confirm/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PasswordTokenToJSON(requestParameters.passwordToken), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PasswordTokenFromJSON(jsonValue)); + } + + /** + * An Api View which provides a method to reset a password based on a unique token + */ + async apiUserPasswordResetConfirmCreate(requestParameters: ApiUserPasswordResetConfirmCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserPasswordResetConfirmCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * An Api View which provides a method to request a password reset token based on an e-mail address Sends a signal reset_password_token_created when a reset token was created + */ + async apiUserPasswordResetCreateRaw(requestParameters: ApiUserPasswordResetCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.email === null || requestParameters.email === undefined) { + throw new runtime.RequiredError('email','Required parameter requestParameters.email was null or undefined when calling apiUserPasswordResetCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/user/password_reset/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EmailToJSON(requestParameters.email), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EmailFromJSON(jsonValue)); + } + + /** + * An Api View which provides a method to request a password reset token based on an e-mail address Sends a signal reset_password_token_created when a reset token was created + */ + async apiUserPasswordResetCreate(requestParameters: ApiUserPasswordResetCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserPasswordResetCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * An Api View which provides a method to verify that a token is valid + */ + async apiUserPasswordResetValidateTokenCreateRaw(requestParameters: ApiUserPasswordResetValidateTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.resetToken === null || requestParameters.resetToken === undefined) { + throw new runtime.RequiredError('resetToken','Required parameter requestParameters.resetToken was null or undefined when calling apiUserPasswordResetValidateTokenCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/api/user/password_reset/validate_token/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ResetTokenToJSON(requestParameters.resetToken), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ResetTokenFromJSON(jsonValue)); + } + + /** + * An Api View which provides a method to verify that a token is valid + */ + async apiUserPasswordResetValidateTokenCreate(requestParameters: ApiUserPasswordResetValidateTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserPasswordResetValidateTokenCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update uploaded avatar. + */ + async apiUserUAvatarCreateRaw(requestParameters: ApiUserUAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userAvatar === null || requestParameters.userAvatar === undefined) { + throw new runtime.RequiredError('userAvatar','Required parameter requestParameters.userAvatar was null or undefined when calling apiUserUAvatarCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/avatar/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserAvatarToJSON(requestParameters.userAvatar), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update uploaded avatar. + */ + async apiUserUAvatarCreate(requestParameters: ApiUserUAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.apiUserUAvatarCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async apiUserUCreateRaw(requestParameters: ApiUserUCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userCreate === null || requestParameters.userCreate === undefined) { + throw new runtime.RequiredError('userCreate','Required parameter requestParameters.userCreate was null or undefined when calling apiUserUCreate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserCreateToJSON(requestParameters.userCreate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserCreateFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async apiUserUCreate(requestParameters: ApiUserUCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMePartialUpdateRaw(requestParameters: ApiUserUMePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/me/`, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: PatchedUserPrivateToJSON(requestParameters.patchedUserPrivate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMePartialUpdate(requestParameters: ApiUserUMePartialUpdateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUMePartialUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMeRetrieveRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/me/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMeRetrieve(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUMeRetrieveRaw(initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMeUpdateRaw(requestParameters: ApiUserUMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userPrivate === null || requestParameters.userPrivate === undefined) { + throw new runtime.RequiredError('userPrivate','Required parameter requestParameters.userPrivate was null or undefined when calling apiUserUMeUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/me/`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserPrivateToJSON(requestParameters.userPrivate), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async apiUserUMeUpdate(requestParameters: ApiUserUMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUMeUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update the uploaded resume. + */ + async apiUserUResumeRetrieveRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/resume/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserResumeFromJSON(jsonValue)); + } + + /** + * Retrieve or update the uploaded resume. + */ + async apiUserUResumeRetrieve(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUResumeRetrieveRaw(initOverrides); + return await response.value(); + } + + /** + * Retrieve or update the uploaded resume. + */ + async apiUserUResumeUpdateRaw(requestParameters: ApiUserUResumeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userResume === null || requestParameters.userResume === undefined) { + throw new runtime.RequiredError('userResume','Required parameter requestParameters.userResume was null or undefined when calling apiUserUResumeUpdate.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/resume/`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserResumeToJSON(requestParameters.userResume), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserResumeFromJSON(jsonValue)); + } + + /** + * Retrieve or update the uploaded resume. + */ + async apiUserUResumeUpdate(requestParameters: ApiUserUResumeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUResumeUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async apiUserURetrieveRaw(requestParameters: ApiUserURetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiUserURetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPublicFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async apiUserURetrieve(requestParameters: ApiUserURetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserURetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve all teams associated with a user. + */ + async apiUserUTeamsRetrieveRaw(requestParameters: ApiUserUTeamsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling apiUserUTeamsRetrieve.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("jwtAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/api/user/u/{id}/teams/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPublicFromJSON(jsonValue)); + } + + /** + * Retrieve all teams associated with a user. + */ + async apiUserUTeamsRetrieve(requestParameters: ApiUserUTeamsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiUserUTeamsRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + * @enum {string} + */ +export enum ApiSpecsRetrieveFormatEnum { + Json = 'json', + Yaml = 'yaml' +} +/** + * @export + * @enum {string} + */ +export enum ApiSpecsRetrieveLangEnum { + Af = 'af', + Ar = 'ar', + ArDz = 'ar-dz', + Ast = 'ast', + Az = 'az', + Be = 'be', + Bg = 'bg', + Bn = 'bn', + Br = 'br', + Bs = 'bs', + Ca = 'ca', + Cs = 'cs', + Cy = 'cy', + Da = 'da', + De = 'de', + Dsb = 'dsb', + El = 'el', + En = 'en', + EnAu = 'en-au', + EnGb = 'en-gb', + Eo = 'eo', + Es = 'es', + EsAr = 'es-ar', + EsCo = 'es-co', + EsMx = 'es-mx', + EsNi = 'es-ni', + EsVe = 'es-ve', + Et = 'et', + Eu = 'eu', + Fa = 'fa', + Fi = 'fi', + Fr = 'fr', + Fy = 'fy', + Ga = 'ga', + Gd = 'gd', + Gl = 'gl', + He = 'he', + Hi = 'hi', + Hr = 'hr', + Hsb = 'hsb', + Hu = 'hu', + Hy = 'hy', + Ia = 'ia', + Id = 'id', + Ig = 'ig', + Io = 'io', + Is = 'is', + It = 'it', + Ja = 'ja', + Ka = 'ka', + Kab = 'kab', + Kk = 'kk', + Km = 'km', + Kn = 'kn', + Ko = 'ko', + Ky = 'ky', + Lb = 'lb', + Lt = 'lt', + Lv = 'lv', + Mk = 'mk', + Ml = 'ml', + Mn = 'mn', + Mr = 'mr', + My = 'my', + Nb = 'nb', + Ne = 'ne', + Nl = 'nl', + Nn = 'nn', + Os = 'os', + Pa = 'pa', + Pl = 'pl', + Pt = 'pt', + PtBr = 'pt-br', + Ro = 'ro', + Ru = 'ru', + Sk = 'sk', + Sl = 'sl', + Sq = 'sq', + Sr = 'sr', + SrLatn = 'sr-latn', + Sv = 'sv', + Sw = 'sw', + Ta = 'ta', + Te = 'te', + Tg = 'tg', + Th = 'th', + Tk = 'tk', + Tr = 'tr', + Tt = 'tt', + Udm = 'udm', + Uk = 'uk', + Ur = 'ur', + Uz = 'uz', + Vi = 'vi', + ZhHans = 'zh-hans', + ZhHant = 'zh-hant' +} diff --git a/frontend2/src/utils/types/apis/index.ts b/frontend2/src/utils/types/apis/index.ts new file mode 100644 index 000000000..105789d6d --- /dev/null +++ b/frontend2/src/utils/types/apis/index.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ApiApi'; diff --git a/frontend2/src/utils/types/configuration.ts b/frontend2/src/utils/types/configuration.ts deleted file mode 100644 index 2d46dcf69..000000000 --- a/frontend2/src/utils/types/configuration.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class Configuration { - apiKey: string | undefined; - username: string | undefined; - password: string | undefined; - accessToken: string | (() => string) | undefined; -} diff --git a/frontend2/src/utils/types/git_push.sh b/frontend2/src/utils/types/git_push.sh deleted file mode 100644 index f53a75d4f..000000000 --- a/frontend2/src/utils/types/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend2/src/utils/types/index.ts b/frontend2/src/utils/types/index.ts index 72558f282..be9d1edee 100644 --- a/frontend2/src/utils/types/index.ts +++ b/frontend2/src/utils/types/index.ts @@ -1,4 +1,5 @@ -export * from './api/api'; -export * from './model/models'; -export * from './variables'; -export * from './configuration'; +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis'; +export * from './models'; diff --git a/frontend2/src/utils/types/model/Autoscrim.ts b/frontend2/src/utils/types/model/Autoscrim.ts deleted file mode 100644 index e3eba6644..000000000 --- a/frontend2/src/utils/types/model/Autoscrim.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Autoscrim { - bestOf: number; - -} diff --git a/frontend2/src/utils/types/model/ClassRequirement.ts b/frontend2/src/utils/types/model/ClassRequirement.ts deleted file mode 100644 index 3c37c9c57..000000000 --- a/frontend2/src/utils/types/model/ClassRequirement.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface ClassRequirement { - episode: string; - - referencePlayer: number; - - maps: Array; - - minScore: number; - -} diff --git a/frontend2/src/utils/types/model/CountryEnum.ts b/frontend2/src/utils/types/model/CountryEnum.ts deleted file mode 100644 index 9b19a2735..000000000 --- a/frontend2/src/utils/types/model/CountryEnum.ts +++ /dev/null @@ -1,265 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum CountryEnum { - Af = 'AF', - Ax = 'AX', - Al = 'AL', - Dz = 'DZ', - As = 'AS', - Ad = 'AD', - Ao = 'AO', - Ai = 'AI', - Aq = 'AQ', - Ag = 'AG', - Ar = 'AR', - Am = 'AM', - Aw = 'AW', - Au = 'AU', - At = 'AT', - Az = 'AZ', - Bs = 'BS', - Bh = 'BH', - Bd = 'BD', - Bb = 'BB', - By = 'BY', - Be = 'BE', - Bz = 'BZ', - Bj = 'BJ', - Bm = 'BM', - Bt = 'BT', - Bo = 'BO', - Bq = 'BQ', - Ba = 'BA', - Bw = 'BW', - Bv = 'BV', - Br = 'BR', - Io = 'IO', - Bn = 'BN', - Bg = 'BG', - Bf = 'BF', - Bi = 'BI', - Cv = 'CV', - Kh = 'KH', - Cm = 'CM', - Ca = 'CA', - Ky = 'KY', - Cf = 'CF', - Td = 'TD', - Cl = 'CL', - Cn = 'CN', - Cx = 'CX', - Cc = 'CC', - Co = 'CO', - Km = 'KM', - Cg = 'CG', - Cd = 'CD', - Ck = 'CK', - Cr = 'CR', - Ci = 'CI', - Hr = 'HR', - Cu = 'CU', - Cw = 'CW', - Cy = 'CY', - Cz = 'CZ', - Dk = 'DK', - Dj = 'DJ', - Dm = 'DM', - Do = 'DO', - Ec = 'EC', - Eg = 'EG', - Sv = 'SV', - Gq = 'GQ', - Er = 'ER', - Ee = 'EE', - Sz = 'SZ', - Et = 'ET', - Fk = 'FK', - Fo = 'FO', - Fj = 'FJ', - Fi = 'FI', - Fr = 'FR', - Gf = 'GF', - Pf = 'PF', - Tf = 'TF', - Ga = 'GA', - Gm = 'GM', - Ge = 'GE', - De = 'DE', - Gh = 'GH', - Gi = 'GI', - Gr = 'GR', - Gl = 'GL', - Gd = 'GD', - Gp = 'GP', - Gu = 'GU', - Gt = 'GT', - Gg = 'GG', - Gn = 'GN', - Gw = 'GW', - Gy = 'GY', - Ht = 'HT', - Hm = 'HM', - Va = 'VA', - Hn = 'HN', - Hk = 'HK', - Hu = 'HU', - Is = 'IS', - In = 'IN', - Id = 'ID', - Ir = 'IR', - Iq = 'IQ', - Ie = 'IE', - Im = 'IM', - Il = 'IL', - It = 'IT', - Jm = 'JM', - Jp = 'JP', - Je = 'JE', - Jo = 'JO', - Kz = 'KZ', - Ke = 'KE', - Ki = 'KI', - Kw = 'KW', - Kg = 'KG', - La = 'LA', - Lv = 'LV', - Lb = 'LB', - Ls = 'LS', - Lr = 'LR', - Ly = 'LY', - Li = 'LI', - Lt = 'LT', - Lu = 'LU', - Mo = 'MO', - Mg = 'MG', - Mw = 'MW', - My = 'MY', - Mv = 'MV', - Ml = 'ML', - Mt = 'MT', - Mh = 'MH', - Mq = 'MQ', - Mr = 'MR', - Mu = 'MU', - Yt = 'YT', - Mx = 'MX', - Fm = 'FM', - Md = 'MD', - Mc = 'MC', - Mn = 'MN', - Me = 'ME', - Ms = 'MS', - Ma = 'MA', - Mz = 'MZ', - Mm = 'MM', - Na = 'NA', - Nr = 'NR', - Np = 'NP', - Nl = 'NL', - Nc = 'NC', - Nz = 'NZ', - Ni = 'NI', - Ne = 'NE', - Ng = 'NG', - Nu = 'NU', - Nf = 'NF', - Kp = 'KP', - Mk = 'MK', - Mp = 'MP', - No = 'NO', - Om = 'OM', - Pk = 'PK', - Pw = 'PW', - Ps = 'PS', - Pa = 'PA', - Pg = 'PG', - Py = 'PY', - Pe = 'PE', - Ph = 'PH', - Pn = 'PN', - Pl = 'PL', - Pt = 'PT', - Pr = 'PR', - Qa = 'QA', - Re = 'RE', - Ro = 'RO', - Ru = 'RU', - Rw = 'RW', - Bl = 'BL', - Sh = 'SH', - Kn = 'KN', - Lc = 'LC', - Mf = 'MF', - Pm = 'PM', - Vc = 'VC', - Ws = 'WS', - Sm = 'SM', - St = 'ST', - Sa = 'SA', - Sn = 'SN', - Rs = 'RS', - Sc = 'SC', - Sl = 'SL', - Sg = 'SG', - Sx = 'SX', - Sk = 'SK', - Si = 'SI', - Sb = 'SB', - So = 'SO', - Za = 'ZA', - Gs = 'GS', - Kr = 'KR', - Ss = 'SS', - Es = 'ES', - Lk = 'LK', - Sd = 'SD', - Sr = 'SR', - Sj = 'SJ', - Se = 'SE', - Ch = 'CH', - Sy = 'SY', - Tw = 'TW', - Tj = 'TJ', - Tz = 'TZ', - Th = 'TH', - Tl = 'TL', - Tg = 'TG', - Tk = 'TK', - To = 'TO', - Tt = 'TT', - Tn = 'TN', - Tr = 'TR', - Tm = 'TM', - Tc = 'TC', - Tv = 'TV', - Ug = 'UG', - Ua = 'UA', - Ae = 'AE', - Gb = 'GB', - Um = 'UM', - Us = 'US', - Uy = 'UY', - Uz = 'UZ', - Vu = 'VU', - Ve = 'VE', - Vn = 'VN', - Vg = 'VG', - Vi = 'VI', - Wf = 'WF', - Eh = 'EH', - Ye = 'YE', - Zm = 'ZM', - Zw = 'ZW' -} diff --git a/frontend2/src/utils/types/model/EligibilityCriterion.ts b/frontend2/src/utils/types/model/EligibilityCriterion.ts deleted file mode 100644 index d3187d5c4..000000000 --- a/frontend2/src/utils/types/model/EligibilityCriterion.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface EligibilityCriterion { - id: number; - - title: string; - - description: string; - - icon: string; - -} diff --git a/frontend2/src/utils/types/model/Email.ts b/frontend2/src/utils/types/model/Email.ts deleted file mode 100644 index 5556bb3bb..000000000 --- a/frontend2/src/utils/types/model/Email.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Email { - email: string; - -} diff --git a/frontend2/src/utils/types/model/Episode.ts b/frontend2/src/utils/types/model/Episode.ts deleted file mode 100644 index 59032eaf1..000000000 --- a/frontend2/src/utils/types/model/Episode.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Episode { - nameShort: string; - - nameLong: string; - - blurb?: string; - - gameRelease: string; - - language: models.LanguageEnum; - - scaffold?: string; - - artifactName?: string; - - releaseVersionPublic?: string; - - releaseVersionSaturn?: string; - - eligibilityCriteria: Array; - - frozen: boolean; - -} -export namespace Episode { -} diff --git a/frontend2/src/utils/types/model/GenderEnum.ts b/frontend2/src/utils/types/model/GenderEnum.ts deleted file mode 100644 index d19ce4722..000000000 --- a/frontend2/src/utils/types/model/GenderEnum.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum GenderEnum { - F = 'F', - M = 'M', - N = 'N', - Star = '*', - QuestionMark = '?' -} diff --git a/frontend2/src/utils/types/model/HistoricalRating.ts b/frontend2/src/utils/types/model/HistoricalRating.ts deleted file mode 100644 index 8b762aabb..000000000 --- a/frontend2/src/utils/types/model/HistoricalRating.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface HistoricalRating { - rating: number; - - timestamp: string; - -} diff --git a/frontend2/src/utils/types/model/LanguageEnum.ts b/frontend2/src/utils/types/model/LanguageEnum.ts deleted file mode 100644 index 8d8c93b64..000000000 --- a/frontend2/src/utils/types/model/LanguageEnum.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum LanguageEnum { - Java8 = 'java8', - Py3 = 'py3' -} diff --git a/frontend2/src/utils/types/model/Match.ts b/frontend2/src/utils/types/model/Match.ts deleted file mode 100644 index 8b5d50d91..000000000 --- a/frontend2/src/utils/types/model/Match.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Match { - id: number; - - status: models.StatusBccEnum; - - episode: string; - - tournamentRound: number; - - participants: Array; - - maps: Array; - - alternateOrder: boolean; - - created: string; - - isRanked: boolean; - - replayUrl: string; - -} -export namespace Match { -} diff --git a/frontend2/src/utils/types/model/MatchParticipant.ts b/frontend2/src/utils/types/model/MatchParticipant.ts deleted file mode 100644 index 8d2a3cb68..000000000 --- a/frontend2/src/utils/types/model/MatchParticipant.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface MatchParticipant { - team: number; - - teamname: string; - - submission: number; - - match: number; - - playerIndex: number; - - score: number; - - rating: number; - - oldRating: number; - -} diff --git a/frontend2/src/utils/types/model/MatchReport.ts b/frontend2/src/utils/types/model/MatchReport.ts deleted file mode 100644 index f04f3327d..000000000 --- a/frontend2/src/utils/types/model/MatchReport.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface MatchReport { - invocation: models.SaturnInvocation; - - scores?: Array; - -} diff --git a/frontend2/src/utils/types/model/ModelMap.ts b/frontend2/src/utils/types/model/ModelMap.ts deleted file mode 100644 index 6825f7e3b..000000000 --- a/frontend2/src/utils/types/model/ModelMap.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface ModelMap { - id: number; - - episode: string; - - name: string; - - isPublic: boolean; - -} diff --git a/frontend2/src/utils/types/model/PaginatedClassRequirementList.ts b/frontend2/src/utils/types/model/PaginatedClassRequirementList.ts deleted file mode 100644 index 73f0d45b2..000000000 --- a/frontend2/src/utils/types/model/PaginatedClassRequirementList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedClassRequirementList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedEpisodeList.ts b/frontend2/src/utils/types/model/PaginatedEpisodeList.ts deleted file mode 100644 index 082c42568..000000000 --- a/frontend2/src/utils/types/model/PaginatedEpisodeList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedEpisodeList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedMatchList.ts b/frontend2/src/utils/types/model/PaginatedMatchList.ts deleted file mode 100644 index ec2e70dd1..000000000 --- a/frontend2/src/utils/types/model/PaginatedMatchList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedMatchList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedScrimmageRequestList.ts b/frontend2/src/utils/types/model/PaginatedScrimmageRequestList.ts deleted file mode 100644 index 165fbb273..000000000 --- a/frontend2/src/utils/types/model/PaginatedScrimmageRequestList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedScrimmageRequestList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedSubmissionList.ts b/frontend2/src/utils/types/model/PaginatedSubmissionList.ts deleted file mode 100644 index dac76ca19..000000000 --- a/frontend2/src/utils/types/model/PaginatedSubmissionList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedSubmissionList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedTeamPublicList.ts b/frontend2/src/utils/types/model/PaginatedTeamPublicList.ts deleted file mode 100644 index 23846d493..000000000 --- a/frontend2/src/utils/types/model/PaginatedTeamPublicList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedTeamPublicList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedTournamentList.ts b/frontend2/src/utils/types/model/PaginatedTournamentList.ts deleted file mode 100644 index ced9e6bc5..000000000 --- a/frontend2/src/utils/types/model/PaginatedTournamentList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedTournamentList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PaginatedTournamentRoundList.ts b/frontend2/src/utils/types/model/PaginatedTournamentRoundList.ts deleted file mode 100644 index 1a9cda415..000000000 --- a/frontend2/src/utils/types/model/PaginatedTournamentRoundList.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PaginatedTournamentRoundList { - count?: number; - - next?: string; - - previous?: string; - - results?: Array; - -} diff --git a/frontend2/src/utils/types/model/PasswordToken.ts b/frontend2/src/utils/types/model/PasswordToken.ts deleted file mode 100644 index e84538c35..000000000 --- a/frontend2/src/utils/types/model/PasswordToken.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PasswordToken { - password: string; - - token: string; - -} diff --git a/frontend2/src/utils/types/model/PatchedTeamPrivate.ts b/frontend2/src/utils/types/model/PatchedTeamPrivate.ts deleted file mode 100644 index 09303d076..000000000 --- a/frontend2/src/utils/types/model/PatchedTeamPrivate.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PatchedTeamPrivate { - id?: number; - - profile?: models.TeamProfilePrivate; - - episode?: string; - - name?: string; - - members?: Array; - - joinKey?: string; - - status?: models.Status526Enum; - -} -export namespace PatchedTeamPrivate { -} diff --git a/frontend2/src/utils/types/model/PatchedUserPrivate.ts b/frontend2/src/utils/types/model/PatchedUserPrivate.ts deleted file mode 100644 index 27702920a..000000000 --- a/frontend2/src/utils/types/model/PatchedUserPrivate.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface PatchedUserPrivate { - id?: number; - - profile?: models.UserProfilePrivate; - - /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - */ - username?: string; - - email?: string; - - firstName?: string; - - lastName?: string; - - /** - * Designates whether the user can log into this admin site. - */ - isStaff?: boolean; - -} diff --git a/frontend2/src/utils/types/model/PlayerOrderEnum.ts b/frontend2/src/utils/types/model/PlayerOrderEnum.ts deleted file mode 100644 index 966150b93..000000000 --- a/frontend2/src/utils/types/model/PlayerOrderEnum.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum PlayerOrderEnum { - Plus = '+', - Minus = '-', - QuestionMark = '?' -} diff --git a/frontend2/src/utils/types/model/ReleaseStatusEnum.ts b/frontend2/src/utils/types/model/ReleaseStatusEnum.ts deleted file mode 100644 index 5179c41eb..000000000 --- a/frontend2/src/utils/types/model/ReleaseStatusEnum.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum ReleaseStatusEnum { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} diff --git a/frontend2/src/utils/types/model/ResetToken.ts b/frontend2/src/utils/types/model/ResetToken.ts deleted file mode 100644 index 088c77d03..000000000 --- a/frontend2/src/utils/types/model/ResetToken.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface ResetToken { - token: string; - -} diff --git a/frontend2/src/utils/types/model/SaturnInvocation.ts b/frontend2/src/utils/types/model/SaturnInvocation.ts deleted file mode 100644 index 4aec52b37..000000000 --- a/frontend2/src/utils/types/model/SaturnInvocation.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface SaturnInvocation { - status: models.StatusBccEnum; - - logs?: string; - - interrupted?: boolean; - -} -export namespace SaturnInvocation { -} diff --git a/frontend2/src/utils/types/model/ScrimmageRequest.ts b/frontend2/src/utils/types/model/ScrimmageRequest.ts deleted file mode 100644 index 469ca2cbc..000000000 --- a/frontend2/src/utils/types/model/ScrimmageRequest.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface ScrimmageRequest { - id: number; - - episode: string; - - created: string; - - status: models.ScrimmageRequestStatusEnum; - - isRanked: boolean; - - requestedBy: number; - - requestedByName: string; - - requestedByRating: number; - - requestedTo: number; - - requestedToName: string; - - requestedToRating: number; - - playerOrder: models.PlayerOrderEnum; - - maps: Array; - - mapNames: Array; - -} -export namespace ScrimmageRequest { -} diff --git a/frontend2/src/utils/types/model/ScrimmageRequestStatusEnum.ts b/frontend2/src/utils/types/model/ScrimmageRequestStatusEnum.ts deleted file mode 100644 index 7a68a8633..000000000 --- a/frontend2/src/utils/types/model/ScrimmageRequestStatusEnum.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum ScrimmageRequestStatusEnum { - P = 'P', - Y = 'Y', - N = 'N' -} diff --git a/frontend2/src/utils/types/model/Status526Enum.ts b/frontend2/src/utils/types/model/Status526Enum.ts deleted file mode 100644 index 7b64f78fd..000000000 --- a/frontend2/src/utils/types/model/Status526Enum.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum Status526Enum { - R = 'R', - X = 'X', - S = 'S', - O = 'O' -} diff --git a/frontend2/src/utils/types/model/StatusBccEnum.ts b/frontend2/src/utils/types/model/StatusBccEnum.ts deleted file mode 100644 index ee9bbd219..000000000 --- a/frontend2/src/utils/types/model/StatusBccEnum.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum StatusBccEnum { - New = 'NEW', - Que = 'QUE', - Run = 'RUN', - Try = 'TRY', - Ok = 'OK!', - Err = 'ERR', - Can = 'CAN' -} diff --git a/frontend2/src/utils/types/model/StyleEnum.ts b/frontend2/src/utils/types/model/StyleEnum.ts deleted file mode 100644 index 2aa75ee19..000000000 --- a/frontend2/src/utils/types/model/StyleEnum.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export enum StyleEnum { - Se = 'SE', - De = 'DE' -} diff --git a/frontend2/src/utils/types/model/Submission.ts b/frontend2/src/utils/types/model/Submission.ts deleted file mode 100644 index 8874e82ef..000000000 --- a/frontend2/src/utils/types/model/Submission.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Submission { - id: number; - - status: models.StatusBccEnum; - - logs: string; - - episode: string; - - team: number; - - teamname: string; - - user: number; - - username: string; - - created: string; - - accepted: boolean; - - _package?: string; - - description?: string; - - sourceCode: string; - -} -export namespace Submission { -} diff --git a/frontend2/src/utils/types/model/SubmissionDownload.ts b/frontend2/src/utils/types/model/SubmissionDownload.ts deleted file mode 100644 index 263cd6273..000000000 --- a/frontend2/src/utils/types/model/SubmissionDownload.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface SubmissionDownload { - ready: boolean; - - url: string; - - reason: string; - -} diff --git a/frontend2/src/utils/types/model/SubmissionReport.ts b/frontend2/src/utils/types/model/SubmissionReport.ts deleted file mode 100644 index 7e994183d..000000000 --- a/frontend2/src/utils/types/model/SubmissionReport.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface SubmissionReport { - invocation: models.SaturnInvocation; - - accepted?: boolean; - -} diff --git a/frontend2/src/utils/types/model/TeamAvatar.ts b/frontend2/src/utils/types/model/TeamAvatar.ts deleted file mode 100644 index 508493f7e..000000000 --- a/frontend2/src/utils/types/model/TeamAvatar.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamAvatar { - avatar: string; - -} diff --git a/frontend2/src/utils/types/model/TeamCreate.ts b/frontend2/src/utils/types/model/TeamCreate.ts deleted file mode 100644 index ce7d8ab22..000000000 --- a/frontend2/src/utils/types/model/TeamCreate.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamCreate { - id: number; - - profile?: models.TeamProfilePrivate; - - episode?: string; - - name: string; - - members: Array; - - joinKey: string; - - status: models.Status526Enum; - -} -export namespace TeamCreate { -} diff --git a/frontend2/src/utils/types/model/TeamJoin.ts b/frontend2/src/utils/types/model/TeamJoin.ts deleted file mode 100644 index c9dc4dd6b..000000000 --- a/frontend2/src/utils/types/model/TeamJoin.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamJoin { - joinKey: string; - - name: string; - -} diff --git a/frontend2/src/utils/types/model/TeamPrivate.ts b/frontend2/src/utils/types/model/TeamPrivate.ts deleted file mode 100644 index 10eb24edb..000000000 --- a/frontend2/src/utils/types/model/TeamPrivate.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamPrivate { - id: number; - - profile?: models.TeamProfilePrivate; - - episode?: string; - - name: string; - - members: Array; - - joinKey: string; - - status: models.Status526Enum; - -} -export namespace TeamPrivate { -} diff --git a/frontend2/src/utils/types/model/TeamProfilePrivate.ts b/frontend2/src/utils/types/model/TeamProfilePrivate.ts deleted file mode 100644 index de3c1c20f..000000000 --- a/frontend2/src/utils/types/model/TeamProfilePrivate.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamProfilePrivate { - quote?: string; - - biography?: string; - - hasAvatar: boolean; - - hasReport?: boolean; - - avatarUrl: string; - - rating: number; - - autoAcceptRanked?: boolean; - - autoAcceptUnranked?: boolean; - - eligibleFor?: Array; - -} diff --git a/frontend2/src/utils/types/model/TeamProfilePublic.ts b/frontend2/src/utils/types/model/TeamProfilePublic.ts deleted file mode 100644 index e428cc7c5..000000000 --- a/frontend2/src/utils/types/model/TeamProfilePublic.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamProfilePublic { - quote?: string; - - biography?: string; - - hasAvatar: boolean; - - avatarUrl: string; - - rating: number; - - autoAcceptRanked?: boolean; - - autoAcceptUnranked?: boolean; - - eligibleFor?: Array; - -} diff --git a/frontend2/src/utils/types/model/TeamPublic.ts b/frontend2/src/utils/types/model/TeamPublic.ts deleted file mode 100644 index 2e102017c..000000000 --- a/frontend2/src/utils/types/model/TeamPublic.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamPublic { - id: number; - - profile?: models.TeamProfilePublic; - - episode: string; - - name: string; - - members: Array; - - status: models.Status526Enum; - - hasActiveSubmission: string; - -} -export namespace TeamPublic { -} diff --git a/frontend2/src/utils/types/model/TeamReport.ts b/frontend2/src/utils/types/model/TeamReport.ts deleted file mode 100644 index 7a32ca8d3..000000000 --- a/frontend2/src/utils/types/model/TeamReport.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TeamReport { - report: string; - -} diff --git a/frontend2/src/utils/types/model/TokenObtainPair.ts b/frontend2/src/utils/types/model/TokenObtainPair.ts deleted file mode 100644 index cd699aa9c..000000000 --- a/frontend2/src/utils/types/model/TokenObtainPair.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TokenObtainPair { - username: string; - - password: string; - - access: string; - - refresh: string; - -} diff --git a/frontend2/src/utils/types/model/TokenRefresh.ts b/frontend2/src/utils/types/model/TokenRefresh.ts deleted file mode 100644 index 9f8539417..000000000 --- a/frontend2/src/utils/types/model/TokenRefresh.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TokenRefresh { - access: string; - - refresh: string; - -} diff --git a/frontend2/src/utils/types/model/TokenVerify.ts b/frontend2/src/utils/types/model/TokenVerify.ts deleted file mode 100644 index bf7273fe3..000000000 --- a/frontend2/src/utils/types/model/TokenVerify.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TokenVerify { - token: string; - -} diff --git a/frontend2/src/utils/types/model/Tournament.ts b/frontend2/src/utils/types/model/Tournament.ts deleted file mode 100644 index 4b2e9c1b1..000000000 --- a/frontend2/src/utils/types/model/Tournament.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface Tournament { - nameShort: string; - - nameLong: string; - - blurb?: string; - - episode: string; - - style: models.StyleEnum; - - displayDate: string; - - eligibilityIncludes?: Array; - - eligibilityExcludes?: Array; - - requireResume: boolean; - - isPublic: boolean; - - submissionFreeze: string; - - submissionUnfreeze: string; - - isEligible: boolean; - -} -export namespace Tournament { -} diff --git a/frontend2/src/utils/types/model/TournamentRound.ts b/frontend2/src/utils/types/model/TournamentRound.ts deleted file mode 100644 index 43f0d80ac..000000000 --- a/frontend2/src/utils/types/model/TournamentRound.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TournamentRound { - id: number; - - tournament: string; - - externalId?: number; - - name: string; - - maps?: Array; - - releaseStatus?: models.ReleaseStatusEnum; - -} -export namespace TournamentRound { -} diff --git a/frontend2/src/utils/types/model/TournamentSubmission.ts b/frontend2/src/utils/types/model/TournamentSubmission.ts deleted file mode 100644 index 4d8c6f5dc..000000000 --- a/frontend2/src/utils/types/model/TournamentSubmission.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface TournamentSubmission { - id: number; - - status: models.StatusBccEnum; - - logs: string; - - episode: string; - - team: number; - - teamname: string; - - user: number; - - username: string; - - created: string; - - accepted: boolean; - - _package: string; - - description: string; - - sourceCode: string; - - tournament: string; - -} -export namespace TournamentSubmission { -} diff --git a/frontend2/src/utils/types/model/UserAvatar.ts b/frontend2/src/utils/types/model/UserAvatar.ts deleted file mode 100644 index d8efdc720..000000000 --- a/frontend2/src/utils/types/model/UserAvatar.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserAvatar { - avatar: string; - -} diff --git a/frontend2/src/utils/types/model/UserCreate.ts b/frontend2/src/utils/types/model/UserCreate.ts deleted file mode 100644 index fe6738e0a..000000000 --- a/frontend2/src/utils/types/model/UserCreate.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserCreate { - id: number; - - profile?: models.UserProfilePrivate; - - /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - */ - username: string; - - password: string; - - email: string; - - firstName: string; - - lastName: string; - - /** - * Designates whether the user can log into this admin site. - */ - isStaff: boolean; - -} diff --git a/frontend2/src/utils/types/model/UserPassed.ts b/frontend2/src/utils/types/model/UserPassed.ts deleted file mode 100644 index 4e0acce94..000000000 --- a/frontend2/src/utils/types/model/UserPassed.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserPassed { - id: number; - - username: string; - - email: string; - - passed: boolean; - -} diff --git a/frontend2/src/utils/types/model/UserPrivate.ts b/frontend2/src/utils/types/model/UserPrivate.ts deleted file mode 100644 index 0c890aeb2..000000000 --- a/frontend2/src/utils/types/model/UserPrivate.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserPrivate { - id: number; - - profile?: models.UserProfilePrivate; - - /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - */ - username: string; - - email: string; - - firstName: string; - - lastName: string; - - /** - * Designates whether the user can log into this admin site. - */ - isStaff: boolean; - -} diff --git a/frontend2/src/utils/types/model/UserProfilePrivate.ts b/frontend2/src/utils/types/model/UserProfilePrivate.ts deleted file mode 100644 index 496c9133f..000000000 --- a/frontend2/src/utils/types/model/UserProfilePrivate.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserProfilePrivate { - gender: models.GenderEnum; - - genderDetails?: string; - - school?: string; - - biography?: string; - - kerberos?: string; - - avatarUrl: string; - - hasAvatar: boolean; - - hasResume: boolean; - - country: models.CountryEnum; - -} -export namespace UserProfilePrivate { -} diff --git a/frontend2/src/utils/types/model/UserProfilePublic.ts b/frontend2/src/utils/types/model/UserProfilePublic.ts deleted file mode 100644 index 59d3f2de7..000000000 --- a/frontend2/src/utils/types/model/UserProfilePublic.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserProfilePublic { - school?: string; - - biography?: string; - - avatarUrl: string; - - hasAvatar: boolean; - -} diff --git a/frontend2/src/utils/types/model/UserPublic.ts b/frontend2/src/utils/types/model/UserPublic.ts deleted file mode 100644 index 79da6787c..000000000 --- a/frontend2/src/utils/types/model/UserPublic.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserPublic { - id: number; - - profile?: models.UserProfilePublic; - - /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - */ - username: string; - - /** - * Designates whether the user can log into this admin site. - */ - isStaff: boolean; - -} diff --git a/frontend2/src/utils/types/model/UserResume.ts b/frontend2/src/utils/types/model/UserResume.ts deleted file mode 100644 index 44c4cd7f0..000000000 --- a/frontend2/src/utils/types/model/UserResume.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import * as models from './models'; - -export interface UserResume { - resume: string; - - ready: boolean; - - url: string; - - reason: string; - -} diff --git a/frontend2/src/utils/types/models/Autoscrim.ts b/frontend2/src/utils/types/models/Autoscrim.ts new file mode 100644 index 000000000..59b071bde --- /dev/null +++ b/frontend2/src/utils/types/models/Autoscrim.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Autoscrim + */ +export interface Autoscrim { + /** + * + * @type {number} + * @memberof Autoscrim + */ + best_of: number; +} + +/** + * Check if a given object implements the Autoscrim interface. + */ +export function instanceOfAutoscrim(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "best_of" in value; + + return isInstance; +} + +export function AutoscrimFromJSON(json: any): Autoscrim { + return AutoscrimFromJSONTyped(json, false); +} + +export function AutoscrimFromJSONTyped(json: any, ignoreDiscriminator: boolean): Autoscrim { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'best_of': json['best_of'], + }; +} + +export function AutoscrimToJSON(value?: Autoscrim | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'best_of': value.best_of, + }; +} + diff --git a/frontend2/src/utils/types/models/ClassRequirement.ts b/frontend2/src/utils/types/models/ClassRequirement.ts new file mode 100644 index 000000000..505769c50 --- /dev/null +++ b/frontend2/src/utils/types/models/ClassRequirement.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ClassRequirement + */ +export interface ClassRequirement { + /** + * + * @type {string} + * @memberof ClassRequirement + */ + episode: string; + /** + * + * @type {number} + * @memberof ClassRequirement + */ + reference_player: number; + /** + * + * @type {Array} + * @memberof ClassRequirement + */ + maps: Array; + /** + * + * @type {number} + * @memberof ClassRequirement + */ + min_score: number; +} + +/** + * Check if a given object implements the ClassRequirement interface. + */ +export function instanceOfClassRequirement(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "reference_player" in value; + isInstance = isInstance && "maps" in value; + isInstance = isInstance && "min_score" in value; + + return isInstance; +} + +export function ClassRequirementFromJSON(json: any): ClassRequirement { + return ClassRequirementFromJSONTyped(json, false); +} + +export function ClassRequirementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassRequirement { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'episode': json['episode'], + 'reference_player': json['reference_player'], + 'maps': json['maps'], + 'min_score': json['min_score'], + }; +} + +export function ClassRequirementToJSON(value?: ClassRequirement | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'episode': value.episode, + 'reference_player': value.reference_player, + 'maps': value.maps, + 'min_score': value.min_score, + }; +} + diff --git a/frontend2/src/utils/types/models/CountryEnum.ts b/frontend2/src/utils/types/models/CountryEnum.ts new file mode 100644 index 000000000..1050652a2 --- /dev/null +++ b/frontend2/src/utils/types/models/CountryEnum.ts @@ -0,0 +1,284 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum CountryEnum { + Af = 'AF', + Ax = 'AX', + Al = 'AL', + Dz = 'DZ', + As = 'AS', + Ad = 'AD', + Ao = 'AO', + Ai = 'AI', + Aq = 'AQ', + Ag = 'AG', + Ar = 'AR', + Am = 'AM', + Aw = 'AW', + Au = 'AU', + At = 'AT', + Az = 'AZ', + Bs = 'BS', + Bh = 'BH', + Bd = 'BD', + Bb = 'BB', + By = 'BY', + Be = 'BE', + Bz = 'BZ', + Bj = 'BJ', + Bm = 'BM', + Bt = 'BT', + Bo = 'BO', + Bq = 'BQ', + Ba = 'BA', + Bw = 'BW', + Bv = 'BV', + Br = 'BR', + Io = 'IO', + Bn = 'BN', + Bg = 'BG', + Bf = 'BF', + Bi = 'BI', + Cv = 'CV', + Kh = 'KH', + Cm = 'CM', + Ca = 'CA', + Ky = 'KY', + Cf = 'CF', + Td = 'TD', + Cl = 'CL', + Cn = 'CN', + Cx = 'CX', + Cc = 'CC', + Co = 'CO', + Km = 'KM', + Cg = 'CG', + Cd = 'CD', + Ck = 'CK', + Cr = 'CR', + Ci = 'CI', + Hr = 'HR', + Cu = 'CU', + Cw = 'CW', + Cy = 'CY', + Cz = 'CZ', + Dk = 'DK', + Dj = 'DJ', + Dm = 'DM', + Do = 'DO', + Ec = 'EC', + Eg = 'EG', + Sv = 'SV', + Gq = 'GQ', + Er = 'ER', + Ee = 'EE', + Sz = 'SZ', + Et = 'ET', + Fk = 'FK', + Fo = 'FO', + Fj = 'FJ', + Fi = 'FI', + Fr = 'FR', + Gf = 'GF', + Pf = 'PF', + Tf = 'TF', + Ga = 'GA', + Gm = 'GM', + Ge = 'GE', + De = 'DE', + Gh = 'GH', + Gi = 'GI', + Gr = 'GR', + Gl = 'GL', + Gd = 'GD', + Gp = 'GP', + Gu = 'GU', + Gt = 'GT', + Gg = 'GG', + Gn = 'GN', + Gw = 'GW', + Gy = 'GY', + Ht = 'HT', + Hm = 'HM', + Va = 'VA', + Hn = 'HN', + Hk = 'HK', + Hu = 'HU', + Is = 'IS', + In = 'IN', + Id = 'ID', + Ir = 'IR', + Iq = 'IQ', + Ie = 'IE', + Im = 'IM', + Il = 'IL', + It = 'IT', + Jm = 'JM', + Jp = 'JP', + Je = 'JE', + Jo = 'JO', + Kz = 'KZ', + Ke = 'KE', + Ki = 'KI', + Kw = 'KW', + Kg = 'KG', + La = 'LA', + Lv = 'LV', + Lb = 'LB', + Ls = 'LS', + Lr = 'LR', + Ly = 'LY', + Li = 'LI', + Lt = 'LT', + Lu = 'LU', + Mo = 'MO', + Mg = 'MG', + Mw = 'MW', + My = 'MY', + Mv = 'MV', + Ml = 'ML', + Mt = 'MT', + Mh = 'MH', + Mq = 'MQ', + Mr = 'MR', + Mu = 'MU', + Yt = 'YT', + Mx = 'MX', + Fm = 'FM', + Md = 'MD', + Mc = 'MC', + Mn = 'MN', + Me = 'ME', + Ms = 'MS', + Ma = 'MA', + Mz = 'MZ', + Mm = 'MM', + Na = 'NA', + Nr = 'NR', + Np = 'NP', + Nl = 'NL', + Nc = 'NC', + Nz = 'NZ', + Ni = 'NI', + Ne = 'NE', + Ng = 'NG', + Nu = 'NU', + Nf = 'NF', + Kp = 'KP', + Mk = 'MK', + Mp = 'MP', + No = 'NO', + Om = 'OM', + Pk = 'PK', + Pw = 'PW', + Ps = 'PS', + Pa = 'PA', + Pg = 'PG', + Py = 'PY', + Pe = 'PE', + Ph = 'PH', + Pn = 'PN', + Pl = 'PL', + Pt = 'PT', + Pr = 'PR', + Qa = 'QA', + Re = 'RE', + Ro = 'RO', + Ru = 'RU', + Rw = 'RW', + Bl = 'BL', + Sh = 'SH', + Kn = 'KN', + Lc = 'LC', + Mf = 'MF', + Pm = 'PM', + Vc = 'VC', + Ws = 'WS', + Sm = 'SM', + St = 'ST', + Sa = 'SA', + Sn = 'SN', + Rs = 'RS', + Sc = 'SC', + Sl = 'SL', + Sg = 'SG', + Sx = 'SX', + Sk = 'SK', + Si = 'SI', + Sb = 'SB', + So = 'SO', + Za = 'ZA', + Gs = 'GS', + Kr = 'KR', + Ss = 'SS', + Es = 'ES', + Lk = 'LK', + Sd = 'SD', + Sr = 'SR', + Sj = 'SJ', + Se = 'SE', + Ch = 'CH', + Sy = 'SY', + Tw = 'TW', + Tj = 'TJ', + Tz = 'TZ', + Th = 'TH', + Tl = 'TL', + Tg = 'TG', + Tk = 'TK', + To = 'TO', + Tt = 'TT', + Tn = 'TN', + Tr = 'TR', + Tm = 'TM', + Tc = 'TC', + Tv = 'TV', + Ug = 'UG', + Ua = 'UA', + Ae = 'AE', + Gb = 'GB', + Um = 'UM', + Us = 'US', + Uy = 'UY', + Uz = 'UZ', + Vu = 'VU', + Ve = 'VE', + Vn = 'VN', + Vg = 'VG', + Vi = 'VI', + Wf = 'WF', + Eh = 'EH', + Ye = 'YE', + Zm = 'ZM', + Zw = 'ZW' +} + + +export function CountryEnumFromJSON(json: any): CountryEnum { + return CountryEnumFromJSONTyped(json, false); +} + +export function CountryEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): CountryEnum { + return json as CountryEnum; +} + +export function CountryEnumToJSON(value?: CountryEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/EligibilityCriterion.ts b/frontend2/src/utils/types/models/EligibilityCriterion.ts new file mode 100644 index 000000000..479cdc383 --- /dev/null +++ b/frontend2/src/utils/types/models/EligibilityCriterion.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface EligibilityCriterion + */ +export interface EligibilityCriterion { + /** + * + * @type {number} + * @memberof EligibilityCriterion + */ + readonly id: number; + /** + * + * @type {string} + * @memberof EligibilityCriterion + */ + readonly title: string; + /** + * + * @type {string} + * @memberof EligibilityCriterion + */ + readonly description: string; + /** + * + * @type {string} + * @memberof EligibilityCriterion + */ + readonly icon: string; +} + +/** + * Check if a given object implements the EligibilityCriterion interface. + */ +export function instanceOfEligibilityCriterion(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "title" in value; + isInstance = isInstance && "description" in value; + isInstance = isInstance && "icon" in value; + + return isInstance; +} + +export function EligibilityCriterionFromJSON(json: any): EligibilityCriterion { + return EligibilityCriterionFromJSONTyped(json, false); +} + +export function EligibilityCriterionFromJSONTyped(json: any, ignoreDiscriminator: boolean): EligibilityCriterion { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'], + 'description': json['description'], + 'icon': json['icon'], + }; +} + +export function EligibilityCriterionToJSON(value?: EligibilityCriterion | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/Email.ts b/frontend2/src/utils/types/models/Email.ts new file mode 100644 index 000000000..7f767d4bd --- /dev/null +++ b/frontend2/src/utils/types/models/Email.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Email + */ +export interface Email { + /** + * + * @type {string} + * @memberof Email + */ + email: string; +} + +/** + * Check if a given object implements the Email interface. + */ +export function instanceOfEmail(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "email" in value; + + return isInstance; +} + +export function EmailFromJSON(json: any): Email { + return EmailFromJSONTyped(json, false); +} + +export function EmailFromJSONTyped(json: any, ignoreDiscriminator: boolean): Email { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'email': json['email'], + }; +} + +export function EmailToJSON(value?: Email | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'email': value.email, + }; +} + diff --git a/frontend2/src/utils/types/models/Episode.ts b/frontend2/src/utils/types/models/Episode.ts new file mode 100644 index 000000000..fdef961bc --- /dev/null +++ b/frontend2/src/utils/types/models/Episode.ts @@ -0,0 +1,163 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { EligibilityCriterion } from './EligibilityCriterion'; +import { + EligibilityCriterionFromJSON, + EligibilityCriterionFromJSONTyped, + EligibilityCriterionToJSON, +} from './EligibilityCriterion'; +import type { LanguageEnum } from './LanguageEnum'; +import { + LanguageEnumFromJSON, + LanguageEnumFromJSONTyped, + LanguageEnumToJSON, +} from './LanguageEnum'; + +/** + * + * @export + * @interface Episode + */ +export interface Episode { + /** + * + * @type {string} + * @memberof Episode + */ + name_short: string; + /** + * + * @type {string} + * @memberof Episode + */ + name_long: string; + /** + * + * @type {string} + * @memberof Episode + */ + blurb?: string; + /** + * + * @type {Date} + * @memberof Episode + */ + game_release: Date; + /** + * + * @type {LanguageEnum} + * @memberof Episode + */ + language: LanguageEnum; + /** + * + * @type {string} + * @memberof Episode + */ + scaffold?: string; + /** + * + * @type {string} + * @memberof Episode + */ + artifact_name?: string; + /** + * + * @type {string} + * @memberof Episode + */ + release_version_public?: string; + /** + * + * @type {string} + * @memberof Episode + */ + release_version_saturn?: string; + /** + * + * @type {Array} + * @memberof Episode + */ + eligibility_criteria: Array; + /** + * + * @type {boolean} + * @memberof Episode + */ + readonly frozen: boolean; +} + +/** + * Check if a given object implements the Episode interface. + */ +export function instanceOfEpisode(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name_short" in value; + isInstance = isInstance && "name_long" in value; + isInstance = isInstance && "game_release" in value; + isInstance = isInstance && "language" in value; + isInstance = isInstance && "eligibility_criteria" in value; + isInstance = isInstance && "frozen" in value; + + return isInstance; +} + +export function EpisodeFromJSON(json: any): Episode { + return EpisodeFromJSONTyped(json, false); +} + +export function EpisodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Episode { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name_short': json['name_short'], + 'name_long': json['name_long'], + 'blurb': !exists(json, 'blurb') ? undefined : json['blurb'], + 'game_release': (new Date(json['game_release'])), + 'language': LanguageEnumFromJSON(json['language']), + 'scaffold': !exists(json, 'scaffold') ? undefined : json['scaffold'], + 'artifact_name': !exists(json, 'artifact_name') ? undefined : json['artifact_name'], + 'release_version_public': !exists(json, 'release_version_public') ? undefined : json['release_version_public'], + 'release_version_saturn': !exists(json, 'release_version_saturn') ? undefined : json['release_version_saturn'], + 'eligibility_criteria': ((json['eligibility_criteria'] as Array).map(EligibilityCriterionFromJSON)), + 'frozen': json['frozen'], + }; +} + +export function EpisodeToJSON(value?: Episode | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name_short': value.name_short, + 'name_long': value.name_long, + 'blurb': value.blurb, + 'game_release': (value.game_release.toISOString()), + 'language': LanguageEnumToJSON(value.language), + 'scaffold': value.scaffold, + 'artifact_name': value.artifact_name, + 'release_version_public': value.release_version_public, + 'release_version_saturn': value.release_version_saturn, + 'eligibility_criteria': ((value.eligibility_criteria as Array).map(EligibilityCriterionToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/GenderEnum.ts b/frontend2/src/utils/types/models/GenderEnum.ts new file mode 100644 index 000000000..a6be0865e --- /dev/null +++ b/frontend2/src/utils/types/models/GenderEnum.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum GenderEnum { + F = 'F', + M = 'M', + N = 'N', + Star = '*', + QuestionMark = '?' +} + + +export function GenderEnumFromJSON(json: any): GenderEnum { + return GenderEnumFromJSONTyped(json, false); +} + +export function GenderEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenderEnum { + return json as GenderEnum; +} + +export function GenderEnumToJSON(value?: GenderEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/HistoricalRating.ts b/frontend2/src/utils/types/models/HistoricalRating.ts new file mode 100644 index 000000000..c2c661b62 --- /dev/null +++ b/frontend2/src/utils/types/models/HistoricalRating.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface HistoricalRating + */ +export interface HistoricalRating { + /** + * + * @type {number} + * @memberof HistoricalRating + */ + rating: number; + /** + * + * @type {Date} + * @memberof HistoricalRating + */ + timestamp: Date; +} + +/** + * Check if a given object implements the HistoricalRating interface. + */ +export function instanceOfHistoricalRating(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "rating" in value; + isInstance = isInstance && "timestamp" in value; + + return isInstance; +} + +export function HistoricalRatingFromJSON(json: any): HistoricalRating { + return HistoricalRatingFromJSONTyped(json, false); +} + +export function HistoricalRatingFromJSONTyped(json: any, ignoreDiscriminator: boolean): HistoricalRating { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'rating': json['rating'], + 'timestamp': (new Date(json['timestamp'])), + }; +} + +export function HistoricalRatingToJSON(value?: HistoricalRating | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'rating': value.rating, + 'timestamp': (value.timestamp.toISOString()), + }; +} + diff --git a/frontend2/src/utils/types/models/LanguageEnum.ts b/frontend2/src/utils/types/models/LanguageEnum.ts new file mode 100644 index 000000000..352b481ee --- /dev/null +++ b/frontend2/src/utils/types/models/LanguageEnum.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum LanguageEnum { + Java8 = 'java8', + Py3 = 'py3' +} + + +export function LanguageEnumFromJSON(json: any): LanguageEnum { + return LanguageEnumFromJSONTyped(json, false); +} + +export function LanguageEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): LanguageEnum { + return json as LanguageEnum; +} + +export function LanguageEnumToJSON(value?: LanguageEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/Match.ts b/frontend2/src/utils/types/models/Match.ts new file mode 100644 index 000000000..595eb688c --- /dev/null +++ b/frontend2/src/utils/types/models/Match.ts @@ -0,0 +1,151 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { MatchParticipant } from './MatchParticipant'; +import { + MatchParticipantFromJSON, + MatchParticipantFromJSONTyped, + MatchParticipantToJSON, +} from './MatchParticipant'; +import type { StatusBccEnum } from './StatusBccEnum'; +import { + StatusBccEnumFromJSON, + StatusBccEnumFromJSONTyped, + StatusBccEnumToJSON, +} from './StatusBccEnum'; + +/** + * + * @export + * @interface Match + */ +export interface Match { + /** + * + * @type {number} + * @memberof Match + */ + readonly id: number; + /** + * + * @type {StatusBccEnum} + * @memberof Match + */ + readonly status: StatusBccEnum; + /** + * + * @type {string} + * @memberof Match + */ + readonly episode: string; + /** + * + * @type {number} + * @memberof Match + */ + readonly tournament_round: number | null; + /** + * + * @type {Array} + * @memberof Match + */ + participants: Array; + /** + * + * @type {Array} + * @memberof Match + */ + readonly maps: Array; + /** + * + * @type {boolean} + * @memberof Match + */ + readonly alternate_order: boolean; + /** + * + * @type {Date} + * @memberof Match + */ + readonly created: Date; + /** + * + * @type {boolean} + * @memberof Match + */ + readonly is_ranked: boolean; + /** + * + * @type {string} + * @memberof Match + */ + readonly replay_url: string; +} + +/** + * Check if a given object implements the Match interface. + */ +export function instanceOfMatch(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "status" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "tournament_round" in value; + isInstance = isInstance && "participants" in value; + isInstance = isInstance && "maps" in value; + isInstance = isInstance && "alternate_order" in value; + isInstance = isInstance && "created" in value; + isInstance = isInstance && "is_ranked" in value; + isInstance = isInstance && "replay_url" in value; + + return isInstance; +} + +export function MatchFromJSON(json: any): Match { + return MatchFromJSONTyped(json, false); +} + +export function MatchFromJSONTyped(json: any, ignoreDiscriminator: boolean): Match { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'status': StatusBccEnumFromJSON(json['status']), + 'episode': json['episode'], + 'tournament_round': json['tournament_round'], + 'participants': ((json['participants'] as Array).map(MatchParticipantFromJSON)), + 'maps': json['maps'], + 'alternate_order': json['alternate_order'], + 'created': (new Date(json['created'])), + 'is_ranked': json['is_ranked'], + 'replay_url': json['replay_url'], + }; +} + +export function MatchToJSON(value?: Match | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'participants': ((value.participants as Array).map(MatchParticipantToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/MatchParticipant.ts b/frontend2/src/utils/types/models/MatchParticipant.ts new file mode 100644 index 000000000..f2f33acb5 --- /dev/null +++ b/frontend2/src/utils/types/models/MatchParticipant.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface MatchParticipant + */ +export interface MatchParticipant { + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly team: number; + /** + * + * @type {string} + * @memberof MatchParticipant + */ + readonly teamname: string; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly submission: number; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly match: number; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly player_index: number; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly score: number | null; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly rating: number; + /** + * + * @type {number} + * @memberof MatchParticipant + */ + readonly old_rating: number; +} + +/** + * Check if a given object implements the MatchParticipant interface. + */ +export function instanceOfMatchParticipant(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "team" in value; + isInstance = isInstance && "teamname" in value; + isInstance = isInstance && "submission" in value; + isInstance = isInstance && "match" in value; + isInstance = isInstance && "player_index" in value; + isInstance = isInstance && "score" in value; + isInstance = isInstance && "rating" in value; + isInstance = isInstance && "old_rating" in value; + + return isInstance; +} + +export function MatchParticipantFromJSON(json: any): MatchParticipant { + return MatchParticipantFromJSONTyped(json, false); +} + +export function MatchParticipantFromJSONTyped(json: any, ignoreDiscriminator: boolean): MatchParticipant { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'team': json['team'], + 'teamname': json['teamname'], + 'submission': json['submission'], + 'match': json['match'], + 'player_index': json['player_index'], + 'score': json['score'], + 'rating': json['rating'], + 'old_rating': json['old_rating'], + }; +} + +export function MatchParticipantToJSON(value?: MatchParticipant | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/MatchReport.ts b/frontend2/src/utils/types/models/MatchReport.ts new file mode 100644 index 000000000..ec0597b41 --- /dev/null +++ b/frontend2/src/utils/types/models/MatchReport.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { SaturnInvocation } from './SaturnInvocation'; +import { + SaturnInvocationFromJSON, + SaturnInvocationFromJSONTyped, + SaturnInvocationToJSON, +} from './SaturnInvocation'; + +/** + * + * @export + * @interface MatchReport + */ +export interface MatchReport { + /** + * + * @type {SaturnInvocation} + * @memberof MatchReport + */ + invocation: SaturnInvocation; + /** + * + * @type {Array} + * @memberof MatchReport + */ + scores?: Array; +} + +/** + * Check if a given object implements the MatchReport interface. + */ +export function instanceOfMatchReport(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "invocation" in value; + + return isInstance; +} + +export function MatchReportFromJSON(json: any): MatchReport { + return MatchReportFromJSONTyped(json, false); +} + +export function MatchReportFromJSONTyped(json: any, ignoreDiscriminator: boolean): MatchReport { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'invocation': SaturnInvocationFromJSON(json['invocation']), + 'scores': !exists(json, 'scores') ? undefined : json['scores'], + }; +} + +export function MatchReportToJSON(value?: MatchReport | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'invocation': SaturnInvocationToJSON(value.invocation), + 'scores': value.scores, + }; +} + diff --git a/frontend2/src/utils/types/models/ModelMap.ts b/frontend2/src/utils/types/models/ModelMap.ts new file mode 100644 index 000000000..90a30ca9a --- /dev/null +++ b/frontend2/src/utils/types/models/ModelMap.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ModelMap + */ +export interface ModelMap { + /** + * + * @type {number} + * @memberof ModelMap + */ + readonly id: number; + /** + * + * @type {string} + * @memberof ModelMap + */ + readonly episode: string; + /** + * + * @type {string} + * @memberof ModelMap + */ + readonly name: string; + /** + * + * @type {boolean} + * @memberof ModelMap + */ + readonly is_public: boolean; +} + +/** + * Check if a given object implements the ModelMap interface. + */ +export function instanceOfModelMap(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "is_public" in value; + + return isInstance; +} + +export function ModelMapFromJSON(json: any): ModelMap { + return ModelMapFromJSONTyped(json, false); +} + +export function ModelMapFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelMap { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'episode': json['episode'], + 'name': json['name'], + 'is_public': json['is_public'], + }; +} + +export function ModelMapToJSON(value?: ModelMap | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedClassRequirementList.ts b/frontend2/src/utils/types/models/PaginatedClassRequirementList.ts new file mode 100644 index 000000000..3d31c3796 --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedClassRequirementList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { ClassRequirement } from './ClassRequirement'; +import { + ClassRequirementFromJSON, + ClassRequirementFromJSONTyped, + ClassRequirementToJSON, +} from './ClassRequirement'; + +/** + * + * @export + * @interface PaginatedClassRequirementList + */ +export interface PaginatedClassRequirementList { + /** + * + * @type {number} + * @memberof PaginatedClassRequirementList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedClassRequirementList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedClassRequirementList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedClassRequirementList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedClassRequirementList interface. + */ +export function instanceOfPaginatedClassRequirementList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedClassRequirementListFromJSON(json: any): PaginatedClassRequirementList { + return PaginatedClassRequirementListFromJSONTyped(json, false); +} + +export function PaginatedClassRequirementListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedClassRequirementList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(ClassRequirementFromJSON)), + }; +} + +export function PaginatedClassRequirementListToJSON(value?: PaginatedClassRequirementList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(ClassRequirementToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedEpisodeList.ts b/frontend2/src/utils/types/models/PaginatedEpisodeList.ts new file mode 100644 index 000000000..cda29c105 --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedEpisodeList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Episode } from './Episode'; +import { + EpisodeFromJSON, + EpisodeFromJSONTyped, + EpisodeToJSON, +} from './Episode'; + +/** + * + * @export + * @interface PaginatedEpisodeList + */ +export interface PaginatedEpisodeList { + /** + * + * @type {number} + * @memberof PaginatedEpisodeList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedEpisodeList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedEpisodeList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedEpisodeList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedEpisodeList interface. + */ +export function instanceOfPaginatedEpisodeList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedEpisodeListFromJSON(json: any): PaginatedEpisodeList { + return PaginatedEpisodeListFromJSONTyped(json, false); +} + +export function PaginatedEpisodeListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedEpisodeList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(EpisodeFromJSON)), + }; +} + +export function PaginatedEpisodeListToJSON(value?: PaginatedEpisodeList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(EpisodeToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedMatchList.ts b/frontend2/src/utils/types/models/PaginatedMatchList.ts new file mode 100644 index 000000000..10abaff07 --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedMatchList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Match } from './Match'; +import { + MatchFromJSON, + MatchFromJSONTyped, + MatchToJSON, +} from './Match'; + +/** + * + * @export + * @interface PaginatedMatchList + */ +export interface PaginatedMatchList { + /** + * + * @type {number} + * @memberof PaginatedMatchList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedMatchList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedMatchList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedMatchList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedMatchList interface. + */ +export function instanceOfPaginatedMatchList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedMatchListFromJSON(json: any): PaginatedMatchList { + return PaginatedMatchListFromJSONTyped(json, false); +} + +export function PaginatedMatchListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedMatchList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(MatchFromJSON)), + }; +} + +export function PaginatedMatchListToJSON(value?: PaginatedMatchList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(MatchToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedScrimmageRequestList.ts b/frontend2/src/utils/types/models/PaginatedScrimmageRequestList.ts new file mode 100644 index 000000000..d15746e02 --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedScrimmageRequestList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { ScrimmageRequest } from './ScrimmageRequest'; +import { + ScrimmageRequestFromJSON, + ScrimmageRequestFromJSONTyped, + ScrimmageRequestToJSON, +} from './ScrimmageRequest'; + +/** + * + * @export + * @interface PaginatedScrimmageRequestList + */ +export interface PaginatedScrimmageRequestList { + /** + * + * @type {number} + * @memberof PaginatedScrimmageRequestList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedScrimmageRequestList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedScrimmageRequestList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedScrimmageRequestList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedScrimmageRequestList interface. + */ +export function instanceOfPaginatedScrimmageRequestList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedScrimmageRequestListFromJSON(json: any): PaginatedScrimmageRequestList { + return PaginatedScrimmageRequestListFromJSONTyped(json, false); +} + +export function PaginatedScrimmageRequestListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedScrimmageRequestList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(ScrimmageRequestFromJSON)), + }; +} + +export function PaginatedScrimmageRequestListToJSON(value?: PaginatedScrimmageRequestList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(ScrimmageRequestToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedSubmissionList.ts b/frontend2/src/utils/types/models/PaginatedSubmissionList.ts new file mode 100644 index 000000000..8ddd795ba --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedSubmissionList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Submission } from './Submission'; +import { + SubmissionFromJSON, + SubmissionFromJSONTyped, + SubmissionToJSON, +} from './Submission'; + +/** + * + * @export + * @interface PaginatedSubmissionList + */ +export interface PaginatedSubmissionList { + /** + * + * @type {number} + * @memberof PaginatedSubmissionList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedSubmissionList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedSubmissionList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedSubmissionList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedSubmissionList interface. + */ +export function instanceOfPaginatedSubmissionList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedSubmissionListFromJSON(json: any): PaginatedSubmissionList { + return PaginatedSubmissionListFromJSONTyped(json, false); +} + +export function PaginatedSubmissionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedSubmissionList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(SubmissionFromJSON)), + }; +} + +export function PaginatedSubmissionListToJSON(value?: PaginatedSubmissionList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(SubmissionToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedTeamPublicList.ts b/frontend2/src/utils/types/models/PaginatedTeamPublicList.ts new file mode 100644 index 000000000..0cfc5a24d --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedTeamPublicList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { TeamPublic } from './TeamPublic'; +import { + TeamPublicFromJSON, + TeamPublicFromJSONTyped, + TeamPublicToJSON, +} from './TeamPublic'; + +/** + * + * @export + * @interface PaginatedTeamPublicList + */ +export interface PaginatedTeamPublicList { + /** + * + * @type {number} + * @memberof PaginatedTeamPublicList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedTeamPublicList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedTeamPublicList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedTeamPublicList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedTeamPublicList interface. + */ +export function instanceOfPaginatedTeamPublicList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedTeamPublicListFromJSON(json: any): PaginatedTeamPublicList { + return PaginatedTeamPublicListFromJSONTyped(json, false); +} + +export function PaginatedTeamPublicListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedTeamPublicList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(TeamPublicFromJSON)), + }; +} + +export function PaginatedTeamPublicListToJSON(value?: PaginatedTeamPublicList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(TeamPublicToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedTournamentList.ts b/frontend2/src/utils/types/models/PaginatedTournamentList.ts new file mode 100644 index 000000000..9a8ab2cc6 --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedTournamentList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Tournament } from './Tournament'; +import { + TournamentFromJSON, + TournamentFromJSONTyped, + TournamentToJSON, +} from './Tournament'; + +/** + * + * @export + * @interface PaginatedTournamentList + */ +export interface PaginatedTournamentList { + /** + * + * @type {number} + * @memberof PaginatedTournamentList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedTournamentList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedTournamentList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedTournamentList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedTournamentList interface. + */ +export function instanceOfPaginatedTournamentList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedTournamentListFromJSON(json: any): PaginatedTournamentList { + return PaginatedTournamentListFromJSONTyped(json, false); +} + +export function PaginatedTournamentListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedTournamentList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(TournamentFromJSON)), + }; +} + +export function PaginatedTournamentListToJSON(value?: PaginatedTournamentList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(TournamentToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PaginatedTournamentRoundList.ts b/frontend2/src/utils/types/models/PaginatedTournamentRoundList.ts new file mode 100644 index 000000000..34920c46b --- /dev/null +++ b/frontend2/src/utils/types/models/PaginatedTournamentRoundList.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { TournamentRound } from './TournamentRound'; +import { + TournamentRoundFromJSON, + TournamentRoundFromJSONTyped, + TournamentRoundToJSON, +} from './TournamentRound'; + +/** + * + * @export + * @interface PaginatedTournamentRoundList + */ +export interface PaginatedTournamentRoundList { + /** + * + * @type {number} + * @memberof PaginatedTournamentRoundList + */ + count?: number; + /** + * + * @type {string} + * @memberof PaginatedTournamentRoundList + */ + next?: string | null; + /** + * + * @type {string} + * @memberof PaginatedTournamentRoundList + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedTournamentRoundList + */ + results?: Array; +} + +/** + * Check if a given object implements the PaginatedTournamentRoundList interface. + */ +export function instanceOfPaginatedTournamentRoundList(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PaginatedTournamentRoundListFromJSON(json: any): PaginatedTournamentRoundList { + return PaginatedTournamentRoundListFromJSONTyped(json, false); +} + +export function PaginatedTournamentRoundListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedTournamentRoundList { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'count': !exists(json, 'count') ? undefined : json['count'], + 'next': !exists(json, 'next') ? undefined : json['next'], + 'previous': !exists(json, 'previous') ? undefined : json['previous'], + 'results': !exists(json, 'results') ? undefined : ((json['results'] as Array).map(TournamentRoundFromJSON)), + }; +} + +export function PaginatedTournamentRoundListToJSON(value?: PaginatedTournamentRoundList | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'count': value.count, + 'next': value.next, + 'previous': value.previous, + 'results': value.results === undefined ? undefined : ((value.results as Array).map(TournamentRoundToJSON)), + }; +} + diff --git a/frontend2/src/utils/types/models/PasswordToken.ts b/frontend2/src/utils/types/models/PasswordToken.ts new file mode 100644 index 000000000..eb0694171 --- /dev/null +++ b/frontend2/src/utils/types/models/PasswordToken.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface PasswordToken + */ +export interface PasswordToken { + /** + * + * @type {string} + * @memberof PasswordToken + */ + password: string; + /** + * + * @type {string} + * @memberof PasswordToken + */ + token: string; +} + +/** + * Check if a given object implements the PasswordToken interface. + */ +export function instanceOfPasswordToken(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "password" in value; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function PasswordTokenFromJSON(json: any): PasswordToken { + return PasswordTokenFromJSONTyped(json, false); +} + +export function PasswordTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordToken { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'password': json['password'], + 'token': json['token'], + }; +} + +export function PasswordTokenToJSON(value?: PasswordToken | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'password': value.password, + 'token': value.token, + }; +} + diff --git a/frontend2/src/utils/types/models/PatchedTeamPrivate.ts b/frontend2/src/utils/types/models/PatchedTeamPrivate.ts new file mode 100644 index 000000000..f5c6d16db --- /dev/null +++ b/frontend2/src/utils/types/models/PatchedTeamPrivate.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Status526Enum } from './Status526Enum'; +import { + Status526EnumFromJSON, + Status526EnumFromJSONTyped, + Status526EnumToJSON, +} from './Status526Enum'; +import type { TeamProfilePrivate } from './TeamProfilePrivate'; +import { + TeamProfilePrivateFromJSON, + TeamProfilePrivateFromJSONTyped, + TeamProfilePrivateToJSON, +} from './TeamProfilePrivate'; +import type { UserPublic } from './UserPublic'; +import { + UserPublicFromJSON, + UserPublicFromJSONTyped, + UserPublicToJSON, +} from './UserPublic'; + +/** + * + * @export + * @interface PatchedTeamPrivate + */ +export interface PatchedTeamPrivate { + /** + * + * @type {number} + * @memberof PatchedTeamPrivate + */ + readonly id?: number; + /** + * + * @type {TeamProfilePrivate} + * @memberof PatchedTeamPrivate + */ + profile?: TeamProfilePrivate; + /** + * + * @type {string} + * @memberof PatchedTeamPrivate + */ + episode?: string; + /** + * + * @type {string} + * @memberof PatchedTeamPrivate + */ + readonly name?: string; + /** + * + * @type {Array} + * @memberof PatchedTeamPrivate + */ + readonly members?: Array; + /** + * + * @type {string} + * @memberof PatchedTeamPrivate + */ + readonly join_key?: string; + /** + * + * @type {Status526Enum} + * @memberof PatchedTeamPrivate + */ + readonly status?: Status526Enum; +} + +/** + * Check if a given object implements the PatchedTeamPrivate interface. + */ +export function instanceOfPatchedTeamPrivate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PatchedTeamPrivateFromJSON(json: any): PatchedTeamPrivate { + return PatchedTeamPrivateFromJSONTyped(json, false); +} + +export function PatchedTeamPrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedTeamPrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'members': !exists(json, 'members') ? undefined : ((json['members'] as Array).map(UserPublicFromJSON)), + 'join_key': !exists(json, 'join_key') ? undefined : json['join_key'], + 'status': !exists(json, 'status') ? undefined : Status526EnumFromJSON(json['status']), + }; +} + +export function PatchedTeamPrivateToJSON(value?: PatchedTeamPrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateToJSON(value.profile), + 'episode': value.episode, + }; +} + diff --git a/frontend2/src/utils/types/models/PatchedUserPrivate.ts b/frontend2/src/utils/types/models/PatchedUserPrivate.ts new file mode 100644 index 000000000..be59831d7 --- /dev/null +++ b/frontend2/src/utils/types/models/PatchedUserPrivate.ts @@ -0,0 +1,117 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { UserProfilePrivate } from './UserProfilePrivate'; +import { + UserProfilePrivateFromJSON, + UserProfilePrivateFromJSONTyped, + UserProfilePrivateToJSON, +} from './UserProfilePrivate'; + +/** + * + * @export + * @interface PatchedUserPrivate + */ +export interface PatchedUserPrivate { + /** + * + * @type {number} + * @memberof PatchedUserPrivate + */ + readonly id?: number; + /** + * + * @type {UserProfilePrivate} + * @memberof PatchedUserPrivate + */ + profile?: UserProfilePrivate; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof PatchedUserPrivate + */ + readonly username?: string; + /** + * + * @type {string} + * @memberof PatchedUserPrivate + */ + email?: string; + /** + * + * @type {string} + * @memberof PatchedUserPrivate + */ + first_name?: string; + /** + * + * @type {string} + * @memberof PatchedUserPrivate + */ + last_name?: string; + /** + * Designates whether the user can log into this admin site. + * @type {boolean} + * @memberof PatchedUserPrivate + */ + readonly is_staff?: boolean; +} + +/** + * Check if a given object implements the PatchedUserPrivate interface. + */ +export function instanceOfPatchedUserPrivate(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PatchedUserPrivateFromJSON(json: any): PatchedUserPrivate { + return PatchedUserPrivateFromJSONTyped(json, false); +} + +export function PatchedUserPrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedUserPrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateFromJSON(json['profile']), + 'username': !exists(json, 'username') ? undefined : json['username'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'first_name': !exists(json, 'first_name') ? undefined : json['first_name'], + 'last_name': !exists(json, 'last_name') ? undefined : json['last_name'], + 'is_staff': !exists(json, 'is_staff') ? undefined : json['is_staff'], + }; +} + +export function PatchedUserPrivateToJSON(value?: PatchedUserPrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateToJSON(value.profile), + 'email': value.email, + 'first_name': value.first_name, + 'last_name': value.last_name, + }; +} + diff --git a/frontend2/src/utils/types/models/PlayerOrderEnum.ts b/frontend2/src/utils/types/models/PlayerOrderEnum.ts new file mode 100644 index 000000000..3e732e91e --- /dev/null +++ b/frontend2/src/utils/types/models/PlayerOrderEnum.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum PlayerOrderEnum { + Plus = '+', + Minus = '-', + QuestionMark = '?' +} + + +export function PlayerOrderEnumFromJSON(json: any): PlayerOrderEnum { + return PlayerOrderEnumFromJSONTyped(json, false); +} + +export function PlayerOrderEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlayerOrderEnum { + return json as PlayerOrderEnum; +} + +export function PlayerOrderEnumToJSON(value?: PlayerOrderEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/ReleaseStatusEnum.ts b/frontend2/src/utils/types/models/ReleaseStatusEnum.ts new file mode 100644 index 000000000..6c6ab342e --- /dev/null +++ b/frontend2/src/utils/types/models/ReleaseStatusEnum.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum ReleaseStatusEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2 +} + + +export function ReleaseStatusEnumFromJSON(json: any): ReleaseStatusEnum { + return ReleaseStatusEnumFromJSONTyped(json, false); +} + +export function ReleaseStatusEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReleaseStatusEnum { + return json as ReleaseStatusEnum; +} + +export function ReleaseStatusEnumToJSON(value?: ReleaseStatusEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/ResetToken.ts b/frontend2/src/utils/types/models/ResetToken.ts new file mode 100644 index 000000000..378f3eae3 --- /dev/null +++ b/frontend2/src/utils/types/models/ResetToken.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ResetToken + */ +export interface ResetToken { + /** + * + * @type {string} + * @memberof ResetToken + */ + token: string; +} + +/** + * Check if a given object implements the ResetToken interface. + */ +export function instanceOfResetToken(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function ResetTokenFromJSON(json: any): ResetToken { + return ResetTokenFromJSONTyped(json, false); +} + +export function ResetTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResetToken { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'token': json['token'], + }; +} + +export function ResetTokenToJSON(value?: ResetToken | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'token': value.token, + }; +} + diff --git a/frontend2/src/utils/types/models/SaturnInvocation.ts b/frontend2/src/utils/types/models/SaturnInvocation.ts new file mode 100644 index 000000000..bf3323e6f --- /dev/null +++ b/frontend2/src/utils/types/models/SaturnInvocation.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StatusBccEnum } from './StatusBccEnum'; +import { + StatusBccEnumFromJSON, + StatusBccEnumFromJSONTyped, + StatusBccEnumToJSON, +} from './StatusBccEnum'; + +/** + * + * @export + * @interface SaturnInvocation + */ +export interface SaturnInvocation { + /** + * + * @type {StatusBccEnum} + * @memberof SaturnInvocation + */ + status: StatusBccEnum; + /** + * + * @type {string} + * @memberof SaturnInvocation + */ + logs?: string; + /** + * + * @type {boolean} + * @memberof SaturnInvocation + */ + interrupted?: boolean; +} + +/** + * Check if a given object implements the SaturnInvocation interface. + */ +export function instanceOfSaturnInvocation(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "status" in value; + + return isInstance; +} + +export function SaturnInvocationFromJSON(json: any): SaturnInvocation { + return SaturnInvocationFromJSONTyped(json, false); +} + +export function SaturnInvocationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaturnInvocation { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'status': StatusBccEnumFromJSON(json['status']), + 'logs': !exists(json, 'logs') ? undefined : json['logs'], + 'interrupted': !exists(json, 'interrupted') ? undefined : json['interrupted'], + }; +} + +export function SaturnInvocationToJSON(value?: SaturnInvocation | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'status': StatusBccEnumToJSON(value.status), + 'logs': value.logs, + 'interrupted': value.interrupted, + }; +} + diff --git a/frontend2/src/utils/types/models/ScrimmageRequest.ts b/frontend2/src/utils/types/models/ScrimmageRequest.ts new file mode 100644 index 000000000..459e5a1a1 --- /dev/null +++ b/frontend2/src/utils/types/models/ScrimmageRequest.ts @@ -0,0 +1,186 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { PlayerOrderEnum } from './PlayerOrderEnum'; +import { + PlayerOrderEnumFromJSON, + PlayerOrderEnumFromJSONTyped, + PlayerOrderEnumToJSON, +} from './PlayerOrderEnum'; +import type { ScrimmageRequestStatusEnum } from './ScrimmageRequestStatusEnum'; +import { + ScrimmageRequestStatusEnumFromJSON, + ScrimmageRequestStatusEnumFromJSONTyped, + ScrimmageRequestStatusEnumToJSON, +} from './ScrimmageRequestStatusEnum'; + +/** + * + * @export + * @interface ScrimmageRequest + */ +export interface ScrimmageRequest { + /** + * + * @type {number} + * @memberof ScrimmageRequest + */ + readonly id: number; + /** + * + * @type {string} + * @memberof ScrimmageRequest + */ + readonly episode: string; + /** + * + * @type {Date} + * @memberof ScrimmageRequest + */ + readonly created: Date; + /** + * + * @type {ScrimmageRequestStatusEnum} + * @memberof ScrimmageRequest + */ + readonly status: ScrimmageRequestStatusEnum; + /** + * + * @type {boolean} + * @memberof ScrimmageRequest + */ + is_ranked: boolean; + /** + * + * @type {number} + * @memberof ScrimmageRequest + */ + readonly requested_by: number; + /** + * + * @type {string} + * @memberof ScrimmageRequest + */ + readonly requested_by_name: string; + /** + * + * @type {number} + * @memberof ScrimmageRequest + */ + readonly requested_by_rating: number; + /** + * + * @type {number} + * @memberof ScrimmageRequest + */ + requested_to: number; + /** + * + * @type {string} + * @memberof ScrimmageRequest + */ + readonly requested_to_name: string; + /** + * + * @type {number} + * @memberof ScrimmageRequest + */ + readonly requested_to_rating: number; + /** + * + * @type {PlayerOrderEnum} + * @memberof ScrimmageRequest + */ + player_order: PlayerOrderEnum; + /** + * + * @type {Array} + * @memberof ScrimmageRequest + */ + readonly maps: Array; + /** + * + * @type {Array} + * @memberof ScrimmageRequest + */ + map_names: Array; +} + +/** + * Check if a given object implements the ScrimmageRequest interface. + */ +export function instanceOfScrimmageRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "created" in value; + isInstance = isInstance && "status" in value; + isInstance = isInstance && "is_ranked" in value; + isInstance = isInstance && "requested_by" in value; + isInstance = isInstance && "requested_by_name" in value; + isInstance = isInstance && "requested_by_rating" in value; + isInstance = isInstance && "requested_to" in value; + isInstance = isInstance && "requested_to_name" in value; + isInstance = isInstance && "requested_to_rating" in value; + isInstance = isInstance && "player_order" in value; + isInstance = isInstance && "maps" in value; + isInstance = isInstance && "map_names" in value; + + return isInstance; +} + +export function ScrimmageRequestFromJSON(json: any): ScrimmageRequest { + return ScrimmageRequestFromJSONTyped(json, false); +} + +export function ScrimmageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScrimmageRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'episode': json['episode'], + 'created': (new Date(json['created'])), + 'status': ScrimmageRequestStatusEnumFromJSON(json['status']), + 'is_ranked': json['is_ranked'], + 'requested_by': json['requested_by'], + 'requested_by_name': json['requested_by_name'], + 'requested_by_rating': json['requested_by_rating'], + 'requested_to': json['requested_to'], + 'requested_to_name': json['requested_to_name'], + 'requested_to_rating': json['requested_to_rating'], + 'player_order': PlayerOrderEnumFromJSON(json['player_order']), + 'maps': json['maps'], + 'map_names': json['map_names'], + }; +} + +export function ScrimmageRequestToJSON(value?: ScrimmageRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'is_ranked': value.is_ranked, + 'requested_to': value.requested_to, + 'player_order': PlayerOrderEnumToJSON(value.player_order), + 'map_names': value.map_names, + }; +} + diff --git a/frontend2/src/utils/types/models/ScrimmageRequestStatusEnum.ts b/frontend2/src/utils/types/models/ScrimmageRequestStatusEnum.ts new file mode 100644 index 000000000..a3b4acd82 --- /dev/null +++ b/frontend2/src/utils/types/models/ScrimmageRequestStatusEnum.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum ScrimmageRequestStatusEnum { + P = 'P', + Y = 'Y', + N = 'N' +} + + +export function ScrimmageRequestStatusEnumFromJSON(json: any): ScrimmageRequestStatusEnum { + return ScrimmageRequestStatusEnumFromJSONTyped(json, false); +} + +export function ScrimmageRequestStatusEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScrimmageRequestStatusEnum { + return json as ScrimmageRequestStatusEnum; +} + +export function ScrimmageRequestStatusEnumToJSON(value?: ScrimmageRequestStatusEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/Status526Enum.ts b/frontend2/src/utils/types/models/Status526Enum.ts new file mode 100644 index 000000000..243c4e075 --- /dev/null +++ b/frontend2/src/utils/types/models/Status526Enum.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum Status526Enum { + R = 'R', + X = 'X', + S = 'S', + O = 'O' +} + + +export function Status526EnumFromJSON(json: any): Status526Enum { + return Status526EnumFromJSONTyped(json, false); +} + +export function Status526EnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status526Enum { + return json as Status526Enum; +} + +export function Status526EnumToJSON(value?: Status526Enum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/StatusBccEnum.ts b/frontend2/src/utils/types/models/StatusBccEnum.ts new file mode 100644 index 000000000..3778772fe --- /dev/null +++ b/frontend2/src/utils/types/models/StatusBccEnum.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum StatusBccEnum { + New = 'NEW', + Que = 'QUE', + Run = 'RUN', + Try = 'TRY', + Ok = 'OK!', + Err = 'ERR', + Can = 'CAN' +} + + +export function StatusBccEnumFromJSON(json: any): StatusBccEnum { + return StatusBccEnumFromJSONTyped(json, false); +} + +export function StatusBccEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): StatusBccEnum { + return json as StatusBccEnum; +} + +export function StatusBccEnumToJSON(value?: StatusBccEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/StyleEnum.ts b/frontend2/src/utils/types/models/StyleEnum.ts new file mode 100644 index 000000000..c9186f55c --- /dev/null +++ b/frontend2/src/utils/types/models/StyleEnum.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @enum {string} + */ +export enum StyleEnum { + Se = 'SE', + De = 'DE' +} + + +export function StyleEnumFromJSON(json: any): StyleEnum { + return StyleEnumFromJSONTyped(json, false); +} + +export function StyleEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): StyleEnum { + return json as StyleEnum; +} + +export function StyleEnumToJSON(value?: StyleEnum | null): any { + return value as any; +} + diff --git a/frontend2/src/utils/types/models/Submission.ts b/frontend2/src/utils/types/models/Submission.ts new file mode 100644 index 000000000..04c541a31 --- /dev/null +++ b/frontend2/src/utils/types/models/Submission.ts @@ -0,0 +1,169 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StatusBccEnum } from './StatusBccEnum'; +import { + StatusBccEnumFromJSON, + StatusBccEnumFromJSONTyped, + StatusBccEnumToJSON, +} from './StatusBccEnum'; + +/** + * + * @export + * @interface Submission + */ +export interface Submission { + /** + * + * @type {number} + * @memberof Submission + */ + readonly id: number; + /** + * + * @type {StatusBccEnum} + * @memberof Submission + */ + readonly status: StatusBccEnum; + /** + * + * @type {string} + * @memberof Submission + */ + readonly logs: string; + /** + * + * @type {string} + * @memberof Submission + */ + readonly episode: string; + /** + * + * @type {number} + * @memberof Submission + */ + readonly team: number; + /** + * + * @type {string} + * @memberof Submission + */ + readonly teamname: string; + /** + * + * @type {number} + * @memberof Submission + */ + readonly user: number; + /** + * + * @type {string} + * @memberof Submission + */ + readonly username: string; + /** + * + * @type {Date} + * @memberof Submission + */ + readonly created: Date; + /** + * + * @type {boolean} + * @memberof Submission + */ + readonly accepted: boolean; + /** + * + * @type {string} + * @memberof Submission + */ + _package?: string; + /** + * + * @type {string} + * @memberof Submission + */ + description?: string; + /** + * + * @type {string} + * @memberof Submission + */ + source_code: string; +} + +/** + * Check if a given object implements the Submission interface. + */ +export function instanceOfSubmission(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "status" in value; + isInstance = isInstance && "logs" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "team" in value; + isInstance = isInstance && "teamname" in value; + isInstance = isInstance && "user" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "created" in value; + isInstance = isInstance && "accepted" in value; + isInstance = isInstance && "source_code" in value; + + return isInstance; +} + +export function SubmissionFromJSON(json: any): Submission { + return SubmissionFromJSONTyped(json, false); +} + +export function SubmissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Submission { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'status': StatusBccEnumFromJSON(json['status']), + 'logs': json['logs'], + 'episode': json['episode'], + 'team': json['team'], + 'teamname': json['teamname'], + 'user': json['user'], + 'username': json['username'], + 'created': (new Date(json['created'])), + 'accepted': json['accepted'], + '_package': !exists(json, 'package') ? undefined : json['package'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'source_code': json['source_code'], + }; +} + +export function SubmissionToJSON(value?: Submission | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'package': value._package, + 'description': value.description, + 'source_code': value.source_code, + }; +} + diff --git a/frontend2/src/utils/types/models/SubmissionDownload.ts b/frontend2/src/utils/types/models/SubmissionDownload.ts new file mode 100644 index 000000000..3364931ed --- /dev/null +++ b/frontend2/src/utils/types/models/SubmissionDownload.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SubmissionDownload + */ +export interface SubmissionDownload { + /** + * + * @type {boolean} + * @memberof SubmissionDownload + */ + readonly ready: boolean; + /** + * + * @type {string} + * @memberof SubmissionDownload + */ + readonly url: string; + /** + * + * @type {string} + * @memberof SubmissionDownload + */ + readonly reason: string; +} + +/** + * Check if a given object implements the SubmissionDownload interface. + */ +export function instanceOfSubmissionDownload(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "ready" in value; + isInstance = isInstance && "url" in value; + isInstance = isInstance && "reason" in value; + + return isInstance; +} + +export function SubmissionDownloadFromJSON(json: any): SubmissionDownload { + return SubmissionDownloadFromJSONTyped(json, false); +} + +export function SubmissionDownloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionDownload { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'ready': json['ready'], + 'url': json['url'], + 'reason': json['reason'], + }; +} + +export function SubmissionDownloadToJSON(value?: SubmissionDownload | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/SubmissionReport.ts b/frontend2/src/utils/types/models/SubmissionReport.ts new file mode 100644 index 000000000..407ce6cac --- /dev/null +++ b/frontend2/src/utils/types/models/SubmissionReport.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { SaturnInvocation } from './SaturnInvocation'; +import { + SaturnInvocationFromJSON, + SaturnInvocationFromJSONTyped, + SaturnInvocationToJSON, +} from './SaturnInvocation'; + +/** + * + * @export + * @interface SubmissionReport + */ +export interface SubmissionReport { + /** + * + * @type {SaturnInvocation} + * @memberof SubmissionReport + */ + invocation: SaturnInvocation; + /** + * + * @type {boolean} + * @memberof SubmissionReport + */ + accepted?: boolean; +} + +/** + * Check if a given object implements the SubmissionReport interface. + */ +export function instanceOfSubmissionReport(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "invocation" in value; + + return isInstance; +} + +export function SubmissionReportFromJSON(json: any): SubmissionReport { + return SubmissionReportFromJSONTyped(json, false); +} + +export function SubmissionReportFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionReport { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'invocation': SaturnInvocationFromJSON(json['invocation']), + 'accepted': !exists(json, 'accepted') ? undefined : json['accepted'], + }; +} + +export function SubmissionReportToJSON(value?: SubmissionReport | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'invocation': SaturnInvocationToJSON(value.invocation), + 'accepted': value.accepted, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamAvatar.ts b/frontend2/src/utils/types/models/TeamAvatar.ts new file mode 100644 index 000000000..7fccad389 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamAvatar.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TeamAvatar + */ +export interface TeamAvatar { + /** + * + * @type {string} + * @memberof TeamAvatar + */ + avatar: string; +} + +/** + * Check if a given object implements the TeamAvatar interface. + */ +export function instanceOfTeamAvatar(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "avatar" in value; + + return isInstance; +} + +export function TeamAvatarFromJSON(json: any): TeamAvatar { + return TeamAvatarFromJSONTyped(json, false); +} + +export function TeamAvatarFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamAvatar { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'avatar': json['avatar'], + }; +} + +export function TeamAvatarToJSON(value?: TeamAvatar | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'avatar': value.avatar, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamCreate.ts b/frontend2/src/utils/types/models/TeamCreate.ts new file mode 100644 index 000000000..ff7853c7f --- /dev/null +++ b/frontend2/src/utils/types/models/TeamCreate.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Status526Enum } from './Status526Enum'; +import { + Status526EnumFromJSON, + Status526EnumFromJSONTyped, + Status526EnumToJSON, +} from './Status526Enum'; +import type { TeamProfilePrivate } from './TeamProfilePrivate'; +import { + TeamProfilePrivateFromJSON, + TeamProfilePrivateFromJSONTyped, + TeamProfilePrivateToJSON, +} from './TeamProfilePrivate'; +import type { UserPublic } from './UserPublic'; +import { + UserPublicFromJSON, + UserPublicFromJSONTyped, + UserPublicToJSON, +} from './UserPublic'; + +/** + * + * @export + * @interface TeamCreate + */ +export interface TeamCreate { + /** + * + * @type {number} + * @memberof TeamCreate + */ + readonly id: number; + /** + * + * @type {TeamProfilePrivate} + * @memberof TeamCreate + */ + profile?: TeamProfilePrivate; + /** + * + * @type {string} + * @memberof TeamCreate + */ + episode?: string; + /** + * + * @type {string} + * @memberof TeamCreate + */ + name: string; + /** + * + * @type {Array} + * @memberof TeamCreate + */ + readonly members: Array; + /** + * + * @type {string} + * @memberof TeamCreate + */ + readonly join_key: string; + /** + * + * @type {Status526Enum} + * @memberof TeamCreate + */ + readonly status: Status526Enum; +} + +/** + * Check if a given object implements the TeamCreate interface. + */ +export function instanceOfTeamCreate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "members" in value; + isInstance = isInstance && "join_key" in value; + isInstance = isInstance && "status" in value; + + return isInstance; +} + +export function TeamCreateFromJSON(json: any): TeamCreate { + return TeamCreateFromJSONTyped(json, false); +} + +export function TeamCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamCreate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + 'name': json['name'], + 'members': ((json['members'] as Array).map(UserPublicFromJSON)), + 'join_key': json['join_key'], + 'status': Status526EnumFromJSON(json['status']), + }; +} + +export function TeamCreateToJSON(value?: TeamCreate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateToJSON(value.profile), + 'episode': value.episode, + 'name': value.name, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamJoin.ts b/frontend2/src/utils/types/models/TeamJoin.ts new file mode 100644 index 000000000..b42e2b12b --- /dev/null +++ b/frontend2/src/utils/types/models/TeamJoin.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TeamJoin + */ +export interface TeamJoin { + /** + * + * @type {string} + * @memberof TeamJoin + */ + join_key: string; + /** + * + * @type {string} + * @memberof TeamJoin + */ + name: string; +} + +/** + * Check if a given object implements the TeamJoin interface. + */ +export function instanceOfTeamJoin(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "join_key" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function TeamJoinFromJSON(json: any): TeamJoin { + return TeamJoinFromJSONTyped(json, false); +} + +export function TeamJoinFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamJoin { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'join_key': json['join_key'], + 'name': json['name'], + }; +} + +export function TeamJoinToJSON(value?: TeamJoin | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'join_key': value.join_key, + 'name': value.name, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamPrivate.ts b/frontend2/src/utils/types/models/TeamPrivate.ts new file mode 100644 index 000000000..ed3e6fb54 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamPrivate.ts @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Status526Enum } from './Status526Enum'; +import { + Status526EnumFromJSON, + Status526EnumFromJSONTyped, + Status526EnumToJSON, +} from './Status526Enum'; +import type { TeamProfilePrivate } from './TeamProfilePrivate'; +import { + TeamProfilePrivateFromJSON, + TeamProfilePrivateFromJSONTyped, + TeamProfilePrivateToJSON, +} from './TeamProfilePrivate'; +import type { UserPublic } from './UserPublic'; +import { + UserPublicFromJSON, + UserPublicFromJSONTyped, + UserPublicToJSON, +} from './UserPublic'; + +/** + * + * @export + * @interface TeamPrivate + */ +export interface TeamPrivate { + /** + * + * @type {number} + * @memberof TeamPrivate + */ + readonly id: number; + /** + * + * @type {TeamProfilePrivate} + * @memberof TeamPrivate + */ + profile?: TeamProfilePrivate; + /** + * + * @type {string} + * @memberof TeamPrivate + */ + episode?: string; + /** + * + * @type {string} + * @memberof TeamPrivate + */ + readonly name: string; + /** + * + * @type {Array} + * @memberof TeamPrivate + */ + readonly members: Array; + /** + * + * @type {string} + * @memberof TeamPrivate + */ + readonly join_key: string; + /** + * + * @type {Status526Enum} + * @memberof TeamPrivate + */ + readonly status: Status526Enum; +} + +/** + * Check if a given object implements the TeamPrivate interface. + */ +export function instanceOfTeamPrivate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "members" in value; + isInstance = isInstance && "join_key" in value; + isInstance = isInstance && "status" in value; + + return isInstance; +} + +export function TeamPrivateFromJSON(json: any): TeamPrivate { + return TeamPrivateFromJSONTyped(json, false); +} + +export function TeamPrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamPrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + 'name': json['name'], + 'members': ((json['members'] as Array).map(UserPublicFromJSON)), + 'join_key': json['join_key'], + 'status': Status526EnumFromJSON(json['status']), + }; +} + +export function TeamPrivateToJSON(value?: TeamPrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateToJSON(value.profile), + 'episode': value.episode, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamProfilePrivate.ts b/frontend2/src/utils/types/models/TeamProfilePrivate.ts new file mode 100644 index 000000000..7e6430a9b --- /dev/null +++ b/frontend2/src/utils/types/models/TeamProfilePrivate.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TeamProfilePrivate + */ +export interface TeamProfilePrivate { + /** + * + * @type {string} + * @memberof TeamProfilePrivate + */ + quote?: string; + /** + * + * @type {string} + * @memberof TeamProfilePrivate + */ + biography?: string; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivate + */ + readonly has_avatar: boolean; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivate + */ + has_report?: boolean; + /** + * + * @type {string} + * @memberof TeamProfilePrivate + */ + readonly avatar_url: string; + /** + * + * @type {number} + * @memberof TeamProfilePrivate + */ + readonly rating: number; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivate + */ + auto_accept_ranked?: boolean; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivate + */ + auto_accept_unranked?: boolean; + /** + * + * @type {Array} + * @memberof TeamProfilePrivate + */ + eligible_for?: Array; +} + +/** + * Check if a given object implements the TeamProfilePrivate interface. + */ +export function instanceOfTeamProfilePrivate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "has_avatar" in value; + isInstance = isInstance && "avatar_url" in value; + isInstance = isInstance && "rating" in value; + + return isInstance; +} + +export function TeamProfilePrivateFromJSON(json: any): TeamProfilePrivate { + return TeamProfilePrivateFromJSONTyped(json, false); +} + +export function TeamProfilePrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamProfilePrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'quote': !exists(json, 'quote') ? undefined : json['quote'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + 'has_avatar': json['has_avatar'], + 'has_report': !exists(json, 'has_report') ? undefined : json['has_report'], + 'avatar_url': json['avatar_url'], + 'rating': json['rating'], + 'auto_accept_ranked': !exists(json, 'auto_accept_ranked') ? undefined : json['auto_accept_ranked'], + 'auto_accept_unranked': !exists(json, 'auto_accept_unranked') ? undefined : json['auto_accept_unranked'], + 'eligible_for': !exists(json, 'eligible_for') ? undefined : json['eligible_for'], + }; +} + +export function TeamProfilePrivateToJSON(value?: TeamProfilePrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'quote': value.quote, + 'biography': value.biography, + 'has_report': value.has_report, + 'auto_accept_ranked': value.auto_accept_ranked, + 'auto_accept_unranked': value.auto_accept_unranked, + 'eligible_for': value.eligible_for, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamProfilePublic.ts b/frontend2/src/utils/types/models/TeamProfilePublic.ts new file mode 100644 index 000000000..495b32552 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamProfilePublic.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TeamProfilePublic + */ +export interface TeamProfilePublic { + /** + * + * @type {string} + * @memberof TeamProfilePublic + */ + quote?: string; + /** + * + * @type {string} + * @memberof TeamProfilePublic + */ + biography?: string; + /** + * + * @type {boolean} + * @memberof TeamProfilePublic + */ + readonly has_avatar: boolean; + /** + * + * @type {string} + * @memberof TeamProfilePublic + */ + readonly avatar_url: string; + /** + * + * @type {number} + * @memberof TeamProfilePublic + */ + readonly rating: number; + /** + * + * @type {boolean} + * @memberof TeamProfilePublic + */ + auto_accept_ranked?: boolean; + /** + * + * @type {boolean} + * @memberof TeamProfilePublic + */ + auto_accept_unranked?: boolean; + /** + * + * @type {Array} + * @memberof TeamProfilePublic + */ + eligible_for?: Array; +} + +/** + * Check if a given object implements the TeamProfilePublic interface. + */ +export function instanceOfTeamProfilePublic(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "has_avatar" in value; + isInstance = isInstance && "avatar_url" in value; + isInstance = isInstance && "rating" in value; + + return isInstance; +} + +export function TeamProfilePublicFromJSON(json: any): TeamProfilePublic { + return TeamProfilePublicFromJSONTyped(json, false); +} + +export function TeamProfilePublicFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamProfilePublic { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'quote': !exists(json, 'quote') ? undefined : json['quote'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + 'has_avatar': json['has_avatar'], + 'avatar_url': json['avatar_url'], + 'rating': json['rating'], + 'auto_accept_ranked': !exists(json, 'auto_accept_ranked') ? undefined : json['auto_accept_ranked'], + 'auto_accept_unranked': !exists(json, 'auto_accept_unranked') ? undefined : json['auto_accept_unranked'], + 'eligible_for': !exists(json, 'eligible_for') ? undefined : json['eligible_for'], + }; +} + +export function TeamProfilePublicToJSON(value?: TeamProfilePublic | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'quote': value.quote, + 'biography': value.biography, + 'auto_accept_ranked': value.auto_accept_ranked, + 'auto_accept_unranked': value.auto_accept_unranked, + 'eligible_for': value.eligible_for, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamPublic.ts b/frontend2/src/utils/types/models/TeamPublic.ts new file mode 100644 index 000000000..d4597813e --- /dev/null +++ b/frontend2/src/utils/types/models/TeamPublic.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Status526Enum } from './Status526Enum'; +import { + Status526EnumFromJSON, + Status526EnumFromJSONTyped, + Status526EnumToJSON, +} from './Status526Enum'; +import type { TeamProfilePublic } from './TeamProfilePublic'; +import { + TeamProfilePublicFromJSON, + TeamProfilePublicFromJSONTyped, + TeamProfilePublicToJSON, +} from './TeamProfilePublic'; +import type { UserPublic } from './UserPublic'; +import { + UserPublicFromJSON, + UserPublicFromJSONTyped, + UserPublicToJSON, +} from './UserPublic'; + +/** + * + * @export + * @interface TeamPublic + */ +export interface TeamPublic { + /** + * + * @type {number} + * @memberof TeamPublic + */ + readonly id: number; + /** + * + * @type {TeamProfilePublic} + * @memberof TeamPublic + */ + profile?: TeamProfilePublic; + /** + * + * @type {string} + * @memberof TeamPublic + */ + readonly episode: string; + /** + * + * @type {string} + * @memberof TeamPublic + */ + name: string; + /** + * + * @type {Array} + * @memberof TeamPublic + */ + readonly members: Array; + /** + * + * @type {Status526Enum} + * @memberof TeamPublic + */ + readonly status: Status526Enum; + /** + * + * @type {string} + * @memberof TeamPublic + */ + readonly has_active_submission: string; +} + +/** + * Check if a given object implements the TeamPublic interface. + */ +export function instanceOfTeamPublic(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "name" in value; + isInstance = isInstance && "members" in value; + isInstance = isInstance && "status" in value; + isInstance = isInstance && "has_active_submission" in value; + + return isInstance; +} + +export function TeamPublicFromJSON(json: any): TeamPublic { + return TeamPublicFromJSONTyped(json, false); +} + +export function TeamPublicFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamPublic { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePublicFromJSON(json['profile']), + 'episode': json['episode'], + 'name': json['name'], + 'members': ((json['members'] as Array).map(UserPublicFromJSON)), + 'status': Status526EnumFromJSON(json['status']), + 'has_active_submission': json['has_active_submission'], + }; +} + +export function TeamPublicToJSON(value?: TeamPublic | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePublicToJSON(value.profile), + 'name': value.name, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamReport.ts b/frontend2/src/utils/types/models/TeamReport.ts new file mode 100644 index 000000000..1fafa8731 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamReport.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TeamReport + */ +export interface TeamReport { + /** + * + * @type {string} + * @memberof TeamReport + */ + report: string; +} + +/** + * Check if a given object implements the TeamReport interface. + */ +export function instanceOfTeamReport(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "report" in value; + + return isInstance; +} + +export function TeamReportFromJSON(json: any): TeamReport { + return TeamReportFromJSONTyped(json, false); +} + +export function TeamReportFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamReport { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'report': json['report'], + }; +} + +export function TeamReportToJSON(value?: TeamReport | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'report': value.report, + }; +} + diff --git a/frontend2/src/utils/types/models/TokenObtainPair.ts b/frontend2/src/utils/types/models/TokenObtainPair.ts new file mode 100644 index 000000000..32c0342d2 --- /dev/null +++ b/frontend2/src/utils/types/models/TokenObtainPair.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TokenObtainPair + */ +export interface TokenObtainPair { + /** + * + * @type {string} + * @memberof TokenObtainPair + */ + username: string; + /** + * + * @type {string} + * @memberof TokenObtainPair + */ + password: string; + /** + * + * @type {string} + * @memberof TokenObtainPair + */ + readonly access: string; + /** + * + * @type {string} + * @memberof TokenObtainPair + */ + readonly refresh: string; +} + +/** + * Check if a given object implements the TokenObtainPair interface. + */ +export function instanceOfTokenObtainPair(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "password" in value; + isInstance = isInstance && "access" in value; + isInstance = isInstance && "refresh" in value; + + return isInstance; +} + +export function TokenObtainPairFromJSON(json: any): TokenObtainPair { + return TokenObtainPairFromJSONTyped(json, false); +} + +export function TokenObtainPairFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenObtainPair { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'username': json['username'], + 'password': json['password'], + 'access': json['access'], + 'refresh': json['refresh'], + }; +} + +export function TokenObtainPairToJSON(value?: TokenObtainPair | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'username': value.username, + 'password': value.password, + }; +} + diff --git a/frontend2/src/utils/types/models/TokenRefresh.ts b/frontend2/src/utils/types/models/TokenRefresh.ts new file mode 100644 index 000000000..a4d96c3a4 --- /dev/null +++ b/frontend2/src/utils/types/models/TokenRefresh.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TokenRefresh + */ +export interface TokenRefresh { + /** + * + * @type {string} + * @memberof TokenRefresh + */ + readonly access: string; + /** + * + * @type {string} + * @memberof TokenRefresh + */ + refresh: string; +} + +/** + * Check if a given object implements the TokenRefresh interface. + */ +export function instanceOfTokenRefresh(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "access" in value; + isInstance = isInstance && "refresh" in value; + + return isInstance; +} + +export function TokenRefreshFromJSON(json: any): TokenRefresh { + return TokenRefreshFromJSONTyped(json, false); +} + +export function TokenRefreshFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenRefresh { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'access': json['access'], + 'refresh': json['refresh'], + }; +} + +export function TokenRefreshToJSON(value?: TokenRefresh | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'refresh': value.refresh, + }; +} + diff --git a/frontend2/src/utils/types/models/TokenVerify.ts b/frontend2/src/utils/types/models/TokenVerify.ts new file mode 100644 index 000000000..65e16d0cf --- /dev/null +++ b/frontend2/src/utils/types/models/TokenVerify.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TokenVerify + */ +export interface TokenVerify { + /** + * + * @type {string} + * @memberof TokenVerify + */ + token: string; +} + +/** + * Check if a given object implements the TokenVerify interface. + */ +export function instanceOfTokenVerify(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function TokenVerifyFromJSON(json: any): TokenVerify { + return TokenVerifyFromJSONTyped(json, false); +} + +export function TokenVerifyFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenVerify { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'token': json['token'], + }; +} + +export function TokenVerifyToJSON(value?: TokenVerify | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'token': value.token, + }; +} + diff --git a/frontend2/src/utils/types/models/Tournament.ts b/frontend2/src/utils/types/models/Tournament.ts new file mode 100644 index 000000000..ab6a97ba5 --- /dev/null +++ b/frontend2/src/utils/types/models/Tournament.ts @@ -0,0 +1,177 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StyleEnum } from './StyleEnum'; +import { + StyleEnumFromJSON, + StyleEnumFromJSONTyped, + StyleEnumToJSON, +} from './StyleEnum'; + +/** + * + * @export + * @interface Tournament + */ +export interface Tournament { + /** + * + * @type {string} + * @memberof Tournament + */ + name_short: string; + /** + * + * @type {string} + * @memberof Tournament + */ + name_long: string; + /** + * + * @type {string} + * @memberof Tournament + */ + blurb?: string; + /** + * + * @type {string} + * @memberof Tournament + */ + episode: string; + /** + * + * @type {StyleEnum} + * @memberof Tournament + */ + style: StyleEnum; + /** + * + * @type {Date} + * @memberof Tournament + */ + display_date: Date; + /** + * + * @type {Array} + * @memberof Tournament + */ + eligibility_includes?: Array; + /** + * + * @type {Array} + * @memberof Tournament + */ + eligibility_excludes?: Array; + /** + * + * @type {boolean} + * @memberof Tournament + */ + require_resume: boolean; + /** + * + * @type {boolean} + * @memberof Tournament + */ + is_public: boolean; + /** + * + * @type {Date} + * @memberof Tournament + */ + submission_freeze: Date; + /** + * + * @type {Date} + * @memberof Tournament + */ + submission_unfreeze: Date; + /** + * + * @type {boolean} + * @memberof Tournament + */ + readonly is_eligible: boolean; +} + +/** + * Check if a given object implements the Tournament interface. + */ +export function instanceOfTournament(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name_short" in value; + isInstance = isInstance && "name_long" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "style" in value; + isInstance = isInstance && "display_date" in value; + isInstance = isInstance && "require_resume" in value; + isInstance = isInstance && "is_public" in value; + isInstance = isInstance && "submission_freeze" in value; + isInstance = isInstance && "submission_unfreeze" in value; + isInstance = isInstance && "is_eligible" in value; + + return isInstance; +} + +export function TournamentFromJSON(json: any): Tournament { + return TournamentFromJSONTyped(json, false); +} + +export function TournamentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tournament { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'name_short': json['name_short'], + 'name_long': json['name_long'], + 'blurb': !exists(json, 'blurb') ? undefined : json['blurb'], + 'episode': json['episode'], + 'style': StyleEnumFromJSON(json['style']), + 'display_date': (new Date(json['display_date'])), + 'eligibility_includes': !exists(json, 'eligibility_includes') ? undefined : json['eligibility_includes'], + 'eligibility_excludes': !exists(json, 'eligibility_excludes') ? undefined : json['eligibility_excludes'], + 'require_resume': json['require_resume'], + 'is_public': json['is_public'], + 'submission_freeze': (new Date(json['submission_freeze'])), + 'submission_unfreeze': (new Date(json['submission_unfreeze'])), + 'is_eligible': json['is_eligible'], + }; +} + +export function TournamentToJSON(value?: Tournament | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name_short': value.name_short, + 'name_long': value.name_long, + 'blurb': value.blurb, + 'episode': value.episode, + 'style': StyleEnumToJSON(value.style), + 'display_date': (value.display_date.toISOString().substr(0,10)), + 'eligibility_includes': value.eligibility_includes, + 'eligibility_excludes': value.eligibility_excludes, + 'require_resume': value.require_resume, + 'is_public': value.is_public, + 'submission_freeze': (value.submission_freeze.toISOString()), + 'submission_unfreeze': (value.submission_unfreeze.toISOString()), + }; +} + diff --git a/frontend2/src/utils/types/models/TournamentRound.ts b/frontend2/src/utils/types/models/TournamentRound.ts new file mode 100644 index 000000000..90ad8d19d --- /dev/null +++ b/frontend2/src/utils/types/models/TournamentRound.ts @@ -0,0 +1,114 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { ReleaseStatusEnum } from './ReleaseStatusEnum'; +import { + ReleaseStatusEnumFromJSON, + ReleaseStatusEnumFromJSONTyped, + ReleaseStatusEnumToJSON, +} from './ReleaseStatusEnum'; + +/** + * + * @export + * @interface TournamentRound + */ +export interface TournamentRound { + /** + * + * @type {number} + * @memberof TournamentRound + */ + readonly id: number; + /** + * + * @type {string} + * @memberof TournamentRound + */ + tournament: string; + /** + * + * @type {number} + * @memberof TournamentRound + */ + external_id?: number | null; + /** + * + * @type {string} + * @memberof TournamentRound + */ + name: string; + /** + * + * @type {Array} + * @memberof TournamentRound + */ + maps?: Array; + /** + * + * @type {ReleaseStatusEnum} + * @memberof TournamentRound + */ + release_status?: ReleaseStatusEnum; +} + +/** + * Check if a given object implements the TournamentRound interface. + */ +export function instanceOfTournamentRound(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "tournament" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function TournamentRoundFromJSON(json: any): TournamentRound { + return TournamentRoundFromJSONTyped(json, false); +} + +export function TournamentRoundFromJSONTyped(json: any, ignoreDiscriminator: boolean): TournamentRound { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'tournament': json['tournament'], + 'external_id': !exists(json, 'external_id') ? undefined : json['external_id'], + 'name': json['name'], + 'maps': !exists(json, 'maps') ? undefined : json['maps'], + 'release_status': !exists(json, 'release_status') ? undefined : ReleaseStatusEnumFromJSON(json['release_status']), + }; +} + +export function TournamentRoundToJSON(value?: TournamentRound | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'tournament': value.tournament, + 'external_id': value.external_id, + 'name': value.name, + 'maps': value.maps, + 'release_status': ReleaseStatusEnumToJSON(value.release_status), + }; +} + diff --git a/frontend2/src/utils/types/models/TournamentSubmission.ts b/frontend2/src/utils/types/models/TournamentSubmission.ts new file mode 100644 index 000000000..f3093f670 --- /dev/null +++ b/frontend2/src/utils/types/models/TournamentSubmission.ts @@ -0,0 +1,177 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { StatusBccEnum } from './StatusBccEnum'; +import { + StatusBccEnumFromJSON, + StatusBccEnumFromJSONTyped, + StatusBccEnumToJSON, +} from './StatusBccEnum'; + +/** + * + * @export + * @interface TournamentSubmission + */ +export interface TournamentSubmission { + /** + * + * @type {number} + * @memberof TournamentSubmission + */ + readonly id: number; + /** + * + * @type {StatusBccEnum} + * @memberof TournamentSubmission + */ + readonly status: StatusBccEnum; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly logs: string; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly episode: string; + /** + * + * @type {number} + * @memberof TournamentSubmission + */ + readonly team: number; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly teamname: string; + /** + * + * @type {number} + * @memberof TournamentSubmission + */ + readonly user: number; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly username: string; + /** + * + * @type {Date} + * @memberof TournamentSubmission + */ + readonly created: Date; + /** + * + * @type {boolean} + * @memberof TournamentSubmission + */ + readonly accepted: boolean; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly _package: string; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly description: string; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + source_code: string; + /** + * + * @type {string} + * @memberof TournamentSubmission + */ + readonly tournament: string; +} + +/** + * Check if a given object implements the TournamentSubmission interface. + */ +export function instanceOfTournamentSubmission(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "status" in value; + isInstance = isInstance && "logs" in value; + isInstance = isInstance && "episode" in value; + isInstance = isInstance && "team" in value; + isInstance = isInstance && "teamname" in value; + isInstance = isInstance && "user" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "created" in value; + isInstance = isInstance && "accepted" in value; + isInstance = isInstance && "_package" in value; + isInstance = isInstance && "description" in value; + isInstance = isInstance && "source_code" in value; + isInstance = isInstance && "tournament" in value; + + return isInstance; +} + +export function TournamentSubmissionFromJSON(json: any): TournamentSubmission { + return TournamentSubmissionFromJSONTyped(json, false); +} + +export function TournamentSubmissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TournamentSubmission { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'status': StatusBccEnumFromJSON(json['status']), + 'logs': json['logs'], + 'episode': json['episode'], + 'team': json['team'], + 'teamname': json['teamname'], + 'user': json['user'], + 'username': json['username'], + 'created': (new Date(json['created'])), + 'accepted': json['accepted'], + '_package': json['package'], + 'description': json['description'], + 'source_code': json['source_code'], + 'tournament': json['tournament'], + }; +} + +export function TournamentSubmissionToJSON(value?: TournamentSubmission | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'source_code': value.source_code, + }; +} + diff --git a/frontend2/src/utils/types/models/UserAvatar.ts b/frontend2/src/utils/types/models/UserAvatar.ts new file mode 100644 index 000000000..dabb69766 --- /dev/null +++ b/frontend2/src/utils/types/models/UserAvatar.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface UserAvatar + */ +export interface UserAvatar { + /** + * + * @type {string} + * @memberof UserAvatar + */ + avatar: string; +} + +/** + * Check if a given object implements the UserAvatar interface. + */ +export function instanceOfUserAvatar(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "avatar" in value; + + return isInstance; +} + +export function UserAvatarFromJSON(json: any): UserAvatar { + return UserAvatarFromJSONTyped(json, false); +} + +export function UserAvatarFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserAvatar { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'avatar': json['avatar'], + }; +} + +export function UserAvatarToJSON(value?: UserAvatar | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'avatar': value.avatar, + }; +} + diff --git a/frontend2/src/utils/types/models/UserCreate.ts b/frontend2/src/utils/types/models/UserCreate.ts new file mode 100644 index 000000000..2ad385421 --- /dev/null +++ b/frontend2/src/utils/types/models/UserCreate.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { UserProfilePrivate } from './UserProfilePrivate'; +import { + UserProfilePrivateFromJSON, + UserProfilePrivateFromJSONTyped, + UserProfilePrivateToJSON, +} from './UserProfilePrivate'; + +/** + * + * @export + * @interface UserCreate + */ +export interface UserCreate { + /** + * + * @type {number} + * @memberof UserCreate + */ + readonly id: number; + /** + * + * @type {UserProfilePrivate} + * @memberof UserCreate + */ + profile?: UserProfilePrivate; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof UserCreate + */ + username: string; + /** + * + * @type {string} + * @memberof UserCreate + */ + password: string; + /** + * + * @type {string} + * @memberof UserCreate + */ + email: string; + /** + * + * @type {string} + * @memberof UserCreate + */ + first_name: string; + /** + * + * @type {string} + * @memberof UserCreate + */ + last_name: string; + /** + * Designates whether the user can log into this admin site. + * @type {boolean} + * @memberof UserCreate + */ + readonly is_staff: boolean; +} + +/** + * Check if a given object implements the UserCreate interface. + */ +export function instanceOfUserCreate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "password" in value; + isInstance = isInstance && "email" in value; + isInstance = isInstance && "first_name" in value; + isInstance = isInstance && "last_name" in value; + isInstance = isInstance && "is_staff" in value; + + return isInstance; +} + +export function UserCreateFromJSON(json: any): UserCreate { + return UserCreateFromJSONTyped(json, false); +} + +export function UserCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCreate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateFromJSON(json['profile']), + 'username': json['username'], + 'password': json['password'], + 'email': json['email'], + 'first_name': json['first_name'], + 'last_name': json['last_name'], + 'is_staff': json['is_staff'], + }; +} + +export function UserCreateToJSON(value?: UserCreate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateToJSON(value.profile), + 'username': value.username, + 'password': value.password, + 'email': value.email, + 'first_name': value.first_name, + 'last_name': value.last_name, + }; +} + diff --git a/frontend2/src/utils/types/models/UserPassed.ts b/frontend2/src/utils/types/models/UserPassed.ts new file mode 100644 index 000000000..8c4826e70 --- /dev/null +++ b/frontend2/src/utils/types/models/UserPassed.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface UserPassed + */ +export interface UserPassed { + /** + * + * @type {number} + * @memberof UserPassed + */ + id: number; + /** + * + * @type {string} + * @memberof UserPassed + */ + username: string; + /** + * + * @type {string} + * @memberof UserPassed + */ + email: string; + /** + * + * @type {boolean} + * @memberof UserPassed + */ + passed: boolean; +} + +/** + * Check if a given object implements the UserPassed interface. + */ +export function instanceOfUserPassed(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "email" in value; + isInstance = isInstance && "passed" in value; + + return isInstance; +} + +export function UserPassedFromJSON(json: any): UserPassed { + return UserPassedFromJSONTyped(json, false); +} + +export function UserPassedFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPassed { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'username': json['username'], + 'email': json['email'], + 'passed': json['passed'], + }; +} + +export function UserPassedToJSON(value?: UserPassed | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'username': value.username, + 'email': value.email, + 'passed': value.passed, + }; +} + diff --git a/frontend2/src/utils/types/models/UserPrivate.ts b/frontend2/src/utils/types/models/UserPrivate.ts new file mode 100644 index 000000000..c30308a95 --- /dev/null +++ b/frontend2/src/utils/types/models/UserPrivate.ts @@ -0,0 +1,123 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { UserProfilePrivate } from './UserProfilePrivate'; +import { + UserProfilePrivateFromJSON, + UserProfilePrivateFromJSONTyped, + UserProfilePrivateToJSON, +} from './UserProfilePrivate'; + +/** + * + * @export + * @interface UserPrivate + */ +export interface UserPrivate { + /** + * + * @type {number} + * @memberof UserPrivate + */ + readonly id: number; + /** + * + * @type {UserProfilePrivate} + * @memberof UserPrivate + */ + profile?: UserProfilePrivate; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof UserPrivate + */ + readonly username: string; + /** + * + * @type {string} + * @memberof UserPrivate + */ + email: string; + /** + * + * @type {string} + * @memberof UserPrivate + */ + first_name: string; + /** + * + * @type {string} + * @memberof UserPrivate + */ + last_name: string; + /** + * Designates whether the user can log into this admin site. + * @type {boolean} + * @memberof UserPrivate + */ + readonly is_staff: boolean; +} + +/** + * Check if a given object implements the UserPrivate interface. + */ +export function instanceOfUserPrivate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "email" in value; + isInstance = isInstance && "first_name" in value; + isInstance = isInstance && "last_name" in value; + isInstance = isInstance && "is_staff" in value; + + return isInstance; +} + +export function UserPrivateFromJSON(json: any): UserPrivate { + return UserPrivateFromJSONTyped(json, false); +} + +export function UserPrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateFromJSON(json['profile']), + 'username': json['username'], + 'email': json['email'], + 'first_name': json['first_name'], + 'last_name': json['last_name'], + 'is_staff': json['is_staff'], + }; +} + +export function UserPrivateToJSON(value?: UserPrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateToJSON(value.profile), + 'email': value.email, + 'first_name': value.first_name, + 'last_name': value.last_name, + }; +} + diff --git a/frontend2/src/utils/types/models/UserProfilePrivate.ts b/frontend2/src/utils/types/models/UserProfilePrivate.ts new file mode 100644 index 000000000..9871c4553 --- /dev/null +++ b/frontend2/src/utils/types/models/UserProfilePrivate.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { CountryEnum } from './CountryEnum'; +import { + CountryEnumFromJSON, + CountryEnumFromJSONTyped, + CountryEnumToJSON, +} from './CountryEnum'; +import type { GenderEnum } from './GenderEnum'; +import { + GenderEnumFromJSON, + GenderEnumFromJSONTyped, + GenderEnumToJSON, +} from './GenderEnum'; + +/** + * + * @export + * @interface UserProfilePrivate + */ +export interface UserProfilePrivate { + /** + * + * @type {GenderEnum} + * @memberof UserProfilePrivate + */ + gender: GenderEnum; + /** + * + * @type {string} + * @memberof UserProfilePrivate + */ + gender_details?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivate + */ + school?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivate + */ + biography?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivate + */ + kerberos?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivate + */ + readonly avatar_url: string; + /** + * + * @type {boolean} + * @memberof UserProfilePrivate + */ + readonly has_avatar: boolean; + /** + * + * @type {boolean} + * @memberof UserProfilePrivate + */ + readonly has_resume: boolean; + /** + * + * @type {CountryEnum} + * @memberof UserProfilePrivate + */ + country: CountryEnum; +} + +/** + * Check if a given object implements the UserProfilePrivate interface. + */ +export function instanceOfUserProfilePrivate(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "gender" in value; + isInstance = isInstance && "avatar_url" in value; + isInstance = isInstance && "has_avatar" in value; + isInstance = isInstance && "has_resume" in value; + isInstance = isInstance && "country" in value; + + return isInstance; +} + +export function UserProfilePrivateFromJSON(json: any): UserProfilePrivate { + return UserProfilePrivateFromJSONTyped(json, false); +} + +export function UserProfilePrivateFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserProfilePrivate { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'gender': GenderEnumFromJSON(json['gender']), + 'gender_details': !exists(json, 'gender_details') ? undefined : json['gender_details'], + 'school': !exists(json, 'school') ? undefined : json['school'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + 'kerberos': !exists(json, 'kerberos') ? undefined : json['kerberos'], + 'avatar_url': json['avatar_url'], + 'has_avatar': json['has_avatar'], + 'has_resume': json['has_resume'], + 'country': CountryEnumFromJSON(json['country']), + }; +} + +export function UserProfilePrivateToJSON(value?: UserProfilePrivate | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'gender': GenderEnumToJSON(value.gender), + 'gender_details': value.gender_details, + 'school': value.school, + 'biography': value.biography, + 'kerberos': value.kerberos, + 'country': CountryEnumToJSON(value.country), + }; +} + diff --git a/frontend2/src/utils/types/models/UserProfilePublic.ts b/frontend2/src/utils/types/models/UserProfilePublic.ts new file mode 100644 index 000000000..1a92c544f --- /dev/null +++ b/frontend2/src/utils/types/models/UserProfilePublic.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface UserProfilePublic + */ +export interface UserProfilePublic { + /** + * + * @type {string} + * @memberof UserProfilePublic + */ + school?: string; + /** + * + * @type {string} + * @memberof UserProfilePublic + */ + biography?: string; + /** + * + * @type {string} + * @memberof UserProfilePublic + */ + readonly avatar_url: string; + /** + * + * @type {boolean} + * @memberof UserProfilePublic + */ + readonly has_avatar: boolean; +} + +/** + * Check if a given object implements the UserProfilePublic interface. + */ +export function instanceOfUserProfilePublic(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "avatar_url" in value; + isInstance = isInstance && "has_avatar" in value; + + return isInstance; +} + +export function UserProfilePublicFromJSON(json: any): UserProfilePublic { + return UserProfilePublicFromJSONTyped(json, false); +} + +export function UserProfilePublicFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserProfilePublic { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'school': !exists(json, 'school') ? undefined : json['school'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + 'avatar_url': json['avatar_url'], + 'has_avatar': json['has_avatar'], + }; +} + +export function UserProfilePublicToJSON(value?: UserProfilePublic | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'school': value.school, + 'biography': value.biography, + }; +} + diff --git a/frontend2/src/utils/types/models/UserPublic.ts b/frontend2/src/utils/types/models/UserPublic.ts new file mode 100644 index 000000000..ec0c0c5cb --- /dev/null +++ b/frontend2/src/utils/types/models/UserPublic.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { UserProfilePublic } from './UserProfilePublic'; +import { + UserProfilePublicFromJSON, + UserProfilePublicFromJSONTyped, + UserProfilePublicToJSON, +} from './UserProfilePublic'; + +/** + * + * @export + * @interface UserPublic + */ +export interface UserPublic { + /** + * + * @type {number} + * @memberof UserPublic + */ + readonly id: number; + /** + * + * @type {UserProfilePublic} + * @memberof UserPublic + */ + profile?: UserProfilePublic; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof UserPublic + */ + username: string; + /** + * Designates whether the user can log into this admin site. + * @type {boolean} + * @memberof UserPublic + */ + readonly is_staff: boolean; +} + +/** + * Check if a given object implements the UserPublic interface. + */ +export function instanceOfUserPublic(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "id" in value; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "is_staff" in value; + + return isInstance; +} + +export function UserPublicFromJSON(json: any): UserPublic { + return UserPublicFromJSONTyped(json, false); +} + +export function UserPublicFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPublic { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'profile': !exists(json, 'profile') ? undefined : UserProfilePublicFromJSON(json['profile']), + 'username': json['username'], + 'is_staff': json['is_staff'], + }; +} + +export function UserPublicToJSON(value?: UserPublic | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePublicToJSON(value.profile), + 'username': value.username, + }; +} + diff --git a/frontend2/src/utils/types/models/UserResume.ts b/frontend2/src/utils/types/models/UserResume.ts new file mode 100644 index 000000000..7f131c2ae --- /dev/null +++ b/frontend2/src/utils/types/models/UserResume.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface UserResume + */ +export interface UserResume { + /** + * + * @type {string} + * @memberof UserResume + */ + resume: string; + /** + * + * @type {boolean} + * @memberof UserResume + */ + readonly ready: boolean; + /** + * + * @type {string} + * @memberof UserResume + */ + readonly url: string; + /** + * + * @type {string} + * @memberof UserResume + */ + readonly reason: string; +} + +/** + * Check if a given object implements the UserResume interface. + */ +export function instanceOfUserResume(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "resume" in value; + isInstance = isInstance && "ready" in value; + isInstance = isInstance && "url" in value; + isInstance = isInstance && "reason" in value; + + return isInstance; +} + +export function UserResumeFromJSON(json: any): UserResume { + return UserResumeFromJSONTyped(json, false); +} + +export function UserResumeFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResume { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'resume': json['resume'], + 'ready': json['ready'], + 'url': json['url'], + 'reason': json['reason'], + }; +} + +export function UserResumeToJSON(value?: UserResume | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'resume': value.resume, + }; +} + diff --git a/frontend2/src/utils/types/model/models.ts b/frontend2/src/utils/types/models/index.ts similarity index 97% rename from frontend2/src/utils/types/model/models.ts rename to frontend2/src/utils/types/models/index.ts index 3c401c30e..a3e431b37 100644 --- a/frontend2/src/utils/types/model/models.ts +++ b/frontend2/src/utils/types/models/index.ts @@ -1,3 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ export * from './Autoscrim'; export * from './ClassRequirement'; export * from './CountryEnum'; diff --git a/frontend2/src/utils/types/runtime.ts b/frontend2/src/utils/types/runtime.ts new file mode 100644 index 000000000..100723068 --- /dev/null +++ b/frontend2/src/utils/types/runtime.ts @@ -0,0 +1,425 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + const init: RequestInit = { + ...overriddenInit, + body: + isFormData(overriddenInit.body) || + overriddenInit.body instanceof URLSearchParams || + isBlob(overriddenInit.body) + ? overriddenInit.body + : JSON.stringify(overriddenInit.body), + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/frontend2/src/utils/types/variables.ts b/frontend2/src/utils/types/variables.ts deleted file mode 100644 index d52a33f70..000000000 --- a/frontend2/src/utils/types/variables.ts +++ /dev/null @@ -1,7 +0,0 @@ - -export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} diff --git a/frontend2/src/views/Rankings.tsx b/frontend2/src/views/Rankings.tsx index 68fd7e59e..980b4fed8 100644 --- a/frontend2/src/views/Rankings.tsx +++ b/frontend2/src/views/Rankings.tsx @@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from "react"; import { EpisodeContext } from "../contexts/EpisodeContext"; import * as Api from "../utils/api"; import BattlecodeTable from "../components/BattlecodeTable"; -import { type PaginatedTeamPublicList } from "../utils/types/model/PaginatedTeamPublicList"; +import { type PaginatedTeamPublicList } from "../utils/types"; import BattlecodeTableBottomElement from "../components/BattlecodeTableBottomElement"; import { NavLink, useSearchParams } from "react-router-dom"; import Input from "../components/elements/Input"; @@ -21,7 +21,7 @@ const Rankings: React.FC = () => { const [searchText, setSearchText] = useState(""); const [loading, setLoading] = useState(true); const [data, setData] = useState( - undefined + undefined, ); const [queryParams, setQueryParams] = useSearchParams({ @@ -52,7 +52,7 @@ const Rankings: React.FC = () => { episodeId, searchQuery, false, - page + page, ); setData(result); setLoading(false); @@ -147,23 +147,23 @@ const Rankings: React.FC = () => { { header: "Eligibility", value: (team) => - (team.profile?.eligibleFor ?? []) + (team.profile?.eligible_for ?? []) .map((e) => e.toString()) .join(", "), }, { header: "Auto-Accept Ranked", value: (team) => - team.profile?.autoAcceptRanked !== undefined && - team.profile.autoAcceptRanked + team.profile?.auto_accept_ranked !== undefined && + team.profile.auto_accept_ranked ? "Yes" : "No", }, { header: "Auto-Accept Unranked", value: (team) => - team.profile?.autoAcceptUnranked !== undefined && - team.profile?.autoAcceptUnranked + team.profile?.auto_accept_unranked !== undefined && + team.profile?.auto_accept_unranked ? "Yes" : "No", },