diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37e61c3f7..e71164e3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,9 +4,12 @@ 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/dnephin/pre-commit-golang rev: v0.5.1 diff --git a/backend/siarnaq/api/compete/serializers.py b/backend/siarnaq/api/compete/serializers.py index 9cef457dc..da50ee3be 100644 --- a/backend/siarnaq/api/compete/serializers.py +++ b/backend/siarnaq/api/compete/serializers.py @@ -467,3 +467,7 @@ def save(self, *args, **kwargs): class HistoricalRatingSerializer(serializers.Serializer): rating = RatingField() timestamp = serializers.DateTimeField() + + +class EmptySerializer(serializers.Serializer): + pass diff --git a/backend/siarnaq/api/compete/views.py b/backend/siarnaq/api/compete/views.py index a492dd8e7..6826b2ee3 100644 --- a/backend/siarnaq/api/compete/views.py +++ b/backend/siarnaq/api/compete/views.py @@ -24,6 +24,7 @@ ) from siarnaq.api.compete.permissions import HasTeamSubmission from siarnaq.api.compete.serializers import ( + EmptySerializer, HistoricalRatingSerializer, MatchReportSerializer, MatchSerializer, @@ -149,8 +150,16 @@ def create(self, request, *, episode_id): headers=headers, ) + @extend_schema( + # https://drf-spectacular.readthedocs.io/en/latest/faq.html#i-m-using-action-detail-false-but-the-response-schema-is-not-a-list + responses=TournamentSubmissionSerializer(many=True) + ) @action( - detail=False, methods=["get"], serializer_class=TournamentSubmissionSerializer + detail=False, + methods=["get"], + serializer_class=TournamentSubmissionSerializer, + # needed so that the generated schema is not paginated + pagination_class=None, ) def tournament(self, request, *, episode_id): """Retrieve the submissions used in tournaments by the current team..""" @@ -409,7 +418,7 @@ def report(self, request, pk=None, *, episode_id): detail=True, methods=["post"], permission_classes=(IsAdminUser,), - serializer_class=None, + serializer_class=EmptySerializer, throttle_classes=(), ) def rating_update(self, request, pk=None, *, episode_id): @@ -424,7 +433,7 @@ def rating_update(self, request, pk=None, *, episode_id): detail=True, methods=["post"], permission_classes=(IsAdminUser,), - serializer_class=None, + serializer_class=EmptySerializer, throttle_classes=(), ) def publish_public_bracket(self, request, pk=None, *, episode_id): diff --git a/backend/siarnaq/api/episodes/serializers.py b/backend/siarnaq/api/episodes/serializers.py index 4453da83d..e82eabc3b 100644 --- a/backend/siarnaq/api/episodes/serializers.py +++ b/backend/siarnaq/api/episodes/serializers.py @@ -1,5 +1,5 @@ from drf_spectacular.types import OpenApiTypes -from drf_spectacular.utils import extend_schema_field +from drf_spectacular.utils import extend_schema_field, extend_schema_serializer from rest_framework import serializers from siarnaq.api.episodes.models import ( @@ -48,6 +48,10 @@ def get_frozen(self, obj): return obj.frozen() +@extend_schema_serializer( + # workaround for https://github.com/OpenAPITools/openapi-generator/issues/9289 + component_name="GameMap" +) class MapSerializer(serializers.ModelSerializer): class Meta: model = Map diff --git a/backend/siarnaq/api/teams/serializers.py b/backend/siarnaq/api/teams/serializers.py index e40cad635..9f128770b 100644 --- a/backend/siarnaq/api/teams/serializers.py +++ b/backend/siarnaq/api/teams/serializers.py @@ -186,3 +186,7 @@ class UserPassedSerializer(serializers.Serializer): class TeamReportSerializer(serializers.Serializer): report = serializers.FileField(write_only=True) + + +class TeamLeaveSerializer(serializers.Serializer): + pass diff --git a/backend/siarnaq/api/teams/views.py b/backend/siarnaq/api/teams/views.py index 20a97b090..55a99f8dd 100644 --- a/backend/siarnaq/api/teams/views.py +++ b/backend/siarnaq/api/teams/views.py @@ -22,6 +22,7 @@ TeamAvatarSerializer, TeamCreateSerializer, TeamJoinSerializer, + TeamLeaveSerializer, TeamPrivateSerializer, TeamPublicSerializer, TeamReportSerializer, @@ -114,7 +115,7 @@ def me(self, request, *, episode_id): @action( detail=False, methods=["post"], - serializer_class=None, + serializer_class=TeamLeaveSerializer, permission_classes=(IsAuthenticated, IsEpisodeAvailable), ) def leave(self, request, *, episode_id): diff --git a/backend/siarnaq/api/user/views.py b/backend/siarnaq/api/user/views.py index 615c0b81b..fe3d2f8f0 100644 --- a/backend/siarnaq/api/user/views.py +++ b/backend/siarnaq/api/user/views.py @@ -75,6 +75,14 @@ def me(self, request): serializer.save() return Response(serializer.data) + @extend_schema( + responses={ + status.HTTP_200_OK: { + "type": "object", + "additionalProperties": {"$ref": "#/components/schemas/TeamPublic"}, + } + } + ) @action( detail=True, permission_classes=(AllowAny,), diff --git a/backend/siarnaq/settings.py b/backend/siarnaq/settings.py index e1bb418a2..17c14f211 100644 --- a/backend/siarnaq/settings.py +++ b/backend/siarnaq/settings.py @@ -510,3 +510,18 @@ def dropper(logger, method_name, event_dict): raise structlog.DropEvent structlog.configure(processors=[dropper]) + +SPECTACULAR_SETTINGS = { + # Split components into request and response parts where appropriate + # This setting is highly recommended to achieve the most accurate API + # description, however it comes at the cost of having more components. + "COMPONENT_SPLIT_REQUEST": True, + # Controls which authentication methods are exposed in the schema. If not None, + # will hide authentication classes that are not contained in the whitelist. + # Use full import paths like + # ['rest_framework.authentication.TokenAuthentication', ...]. + # Empty list ([]) will hide all authentication methods. The default None shows all. + "AUTHENTICATION_WHITELIST": [ + "rest_framework_simplejwt.authentication.JWTAuthentication" + ], +} 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..b1cf3b4ef 100644 --- a/frontend2/generate_types.bat +++ b/frontend2/generate_types.bat @@ -3,9 +3,12 @@ call conda activate galaxy echo "navigate to galaxy folder" cd .. echo "Generate OpenAPI 3.0 backend schema from siarnaq" -python backend/manage.py spectacular --file schema.yml +python backend/manage.py spectacular --file schema.yml --validate + +:: TODO: delete the types folder before regenerating it. + :: echo "Download openapitools" :: 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/package-lock.json b/frontend2/package-lock.json index 7a994ba50..6a60d1941 100644 --- a/frontend2/package-lock.json +++ b/frontend2/package-lock.json @@ -18,7 +18,6 @@ "@types/node": "^16.18.26", "@types/react": "^18.2.6", "@types/react-dom": "^18.2.4", - "jquery": "^3.7.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.1", @@ -27,7 +26,6 @@ }, "devDependencies": { "@tailwindcss/forms": "^0.5.4", - "@types/jquery": "^3.5.16", "@types/js-cookie": "^3.0.3", "@typescript-eslint/eslint-plugin": "^5.59.8", "eslint": "^8.42.0", @@ -4407,15 +4405,6 @@ "pretty-format": "^27.0.0" } }, - "node_modules/@types/jquery": { - "version": "3.5.16", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", - "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", - "dev": true, - "dependencies": { - "@types/sizzle": "*" - } - }, "node_modules/@types/js-cookie": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.3.tgz", @@ -4553,12 +4542,6 @@ "@types/node": "*" } }, - "node_modules/@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", - "dev": true - }, "node_modules/@types/sockjs": { "version": "0.3.33", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", @@ -12923,11 +12906,6 @@ "jiti": "bin/jiti.js" } }, - "node_modules/jquery": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", - "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" - }, "node_modules/js-cookie": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", diff --git a/frontend2/package.json b/frontend2/package.json index 19c483fcc..da83998b7 100644 --- a/frontend2/package.json +++ b/frontend2/package.json @@ -13,7 +13,6 @@ "@types/node": "^16.18.26", "@types/react": "^18.2.6", "@types/react-dom": "^18.2.4", - "jquery": "^3.7.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.1", @@ -50,7 +49,6 @@ }, "devDependencies": { "@tailwindcss/forms": "^0.5.4", - "@types/jquery": "^3.5.16", "@types/js-cookie": "^3.0.3", "@typescript-eslint/eslint-plugin": "^5.59.8", "eslint": "^8.42.0", diff --git a/frontend2/src/components/CurrentUserProvider.tsx b/frontend2/src/components/CurrentUserProvider.tsx index 59f2cc2fd..7d3035681 100644 --- a/frontend2/src/components/CurrentUserProvider.tsx +++ b/frontend2/src/components/CurrentUserProvider.tsx @@ -5,8 +5,9 @@ import { type AuthState, CurrentUserContext, } from "../contexts/CurrentUserContext"; -import * as Api from "../utils/api"; -import { removeApiTokens, doApiTokensExist } from "../utils/cookies"; +import { removeApiTokens } from "../utils/cookies"; +import { loginCheck } from "../utils/api/auth"; +import { getUserUserProfile } from "../utils/api/user"; export const CurrentUserProvider: React.FC<{ children: React.ReactNode }> = ({ children, @@ -32,13 +33,12 @@ 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 loginCheck())) { logout(); return; } try { - const user = await Api.getUserUserProfile(); + const user = await getUserUserProfile(); login(user); } catch (error) { logout(); diff --git a/frontend2/src/contexts/CurrentUserContext.ts b/frontend2/src/contexts/CurrentUserContext.ts index 5ce29cdc3..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", diff --git a/frontend2/src/utils/api.ts b/frontend2/src/utils/api.ts deleted file mode 100644 index 3bce6153d..000000000 --- a/frontend2/src/utils/api.ts +++ /dev/null @@ -1,653 +0,0 @@ -import { ApiApi } from "./types/api/ApiApi"; -import Cookies from "js-cookie"; -import * as $ from "jquery"; -import * as models from "./types/model/models"; -import type * as customModels from "./apiTypes"; - -// hacky, fall back to localhost for now -const baseUrl = process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"; -// const LEAGUE = 0; // To be used later for rating history - -// 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); - -// -- TOKEN HANDLING --// - -/** - * Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. - * - TODO: Rework cookie policy - https://github.com/battlecode/galaxy/issues/647 - * @param credentials The user's credentials. - */ -export const getApiTokens = async ( - credentials: models.TokenObtainPair, -): Promise => { - return (await API.apiTokenCreate(credentials)).body; -}; - -/** - * Checks whether the current access token in the browser's cookies is valid. - * Returns a promise that resolves to true if the token is valid, and false otherwise. - */ -export const verifyCurrentToken = async (): Promise => { - const accessToken = Cookies.get("access"); - if (accessToken !== undefined) { - return ( - (await API.apiTokenVerifyCreate({ token: accessToken })).response - .status === 200 - ); - } else { - return false; - } -}; - -// -- EPISODES --// -/** - * Get all maps for the provided episode. - * @param episodeId The current episode's ID. - */ -export const getAllMaps = async ( - episodeId: string, -): Promise => { - return ( - ((await $.get( - `${baseUrl}/api/episode/${episodeId}/map/`, - )) as models.ModelMap[]) ?? [] - ); -}; - -// -- TEAMS --// - -/** - * Creates a new team. - * @param teamName The name of the team. - */ -export const createTeam = async ( - episodeId: string, - teamName: string, -): Promise => { - // build default object... why? I couldn't tell you - const teamCreate = { - id: -1, - episodeId, - name: teamName, - members: [], - joinKey: "", - status: models.Status526Enum.R, - }; - - return (await API.apiTeamTCreate(episodeId, teamCreate)).body; -}; - -/** - * Join the team with the given join key & name. - * @param episodeId The current episode's ID. - * @param teamName The team's name. - * @param joinKey The team's join key. - */ -export const joinTeam = async ( - episodeId: string, - teamName: string, - joinKey: string, -): Promise => { - const teamInfo = { - name: teamName, - joinKey, - }; - await API.apiTeamTJoinCreate(episodeId, teamInfo); -}; - -/** - * Leave the user's current team. - * @param episodeId The current episode's ID. - */ -export const leaveTeam = async (episodeId: string): Promise => { - await API.apiTeamTLeaveCreate(episodeId); -}; - -/** - * Updates the current user's team's join key. - * @param episodeId The current episode's ID. - * @param joinKey The new team join key. - */ -export const updateUserTeamCode = async ( - episodeId: string, - joinKey: string, -): Promise => { - return (await API.apiTeamTMePartialUpdate(episodeId, { joinKey })).body; -}; - -// -- TEAM STATS --// - -// TODO: implement rankings history -// /** -// * Get the Mu history of the given team. -// * @param teamId The team's ID. -// */ -// export const getTeamMuHistoryByTeam = async (teamId: number) => { -// return await $.get(`${baseUrl}/api/${LEAGUE}/team/${teamId}/history/`); -// }; - -/** - * getTeamMuHistoryByTeam - */ - -/** - * getTeamWinStatsByTeam - */ - -/** - * getUserTeamWinStats - */ - -/** - * getTeamInfoByTeam - */ - -/** - * getTeamRankingByTeam - */ - -// -- SEARCHING --// - -/** - * Search team, ordering the result by ranking. - * @param episodeId The current episode's ID. - * @param searchQuery The search query. - * @param requireActiveSubmission Whether to require an active submission. - * @param page The page number. - */ -export const searchTeams = async ( - episodeId: string, - searchQuery: string, - requireActiveSubmission: boolean, - page?: number, -): Promise => { - const apiURL = `${baseUrl}/api/team/${episodeId}/t`; - const encQuery = encodeURIComponent(searchQuery); - const teamUrl = - `${apiURL}/?ordering=-rating,name&search=${encQuery}&page=${page ?? 1}` + - (requireActiveSubmission ? `&has_active_submission=true` : ``); - return (await $.get(teamUrl)) as models.PaginatedTeamPublicList; -}; - -// -- GENERAL INFO --// - -/** - * Get the current episode's info. - * @param episodeId The current episode's ID. - */ -export const getEpisodeInfo = async ( - episodeId: string, -): Promise => { - return (await API.apiEpisodeERetrieve(episodeId)).body; -}; - -/** - * Get updates about the current league. - * TODO: No idea how this is supposed to work! - */ -// export const getUpdates = async (): Promise => { -// return await $.get(`${baseUrl}/api/league/${LEAGUE}/`, (data) => { -// for (let i = 0; i < data.updates.length; i++) { -// const d = new Date(data.updates[i].time); -// data.updates[i].dateObj = d; -// data.updates[i].date = d.toLocaleDateString(); -// data.updates[i].time = d.toLocaleTimeString(); -// } -// }); -// }; - -// -- SUBMISSIONS --// - -/** - * Uploads a new submission to the Google Cloud Storage bucket. - * @param episodeId The current episode's ID. - * @param submission The submission's info. - */ -export const uploadSubmission = async ( - episodeId: string, - submission: { - file: File; - packageName: string; - description: string; - }, -): Promise => { - const fileData = new FormData(); - fileData.append("source_code", submission.file); - fileData.append("package", submission.packageName); - fileData.append("description", submission.description); - await $.ajax({ - url: `${baseUrl}/api/episode/${episodeId}/submission/`, - type: "POST", - data: fileData, - dataType: "json", - processData: false, - contentType: false, - }); -}; - -/** - * Download a submission from the Google Cloud Storage bucket. - * @param episodeId The current episode's ID. - * @param submissionId The submission's ID. - */ -export const downloadSubmission = async ( - episodeId: string, - submissionId: number, -): Promise => { - const url: string = ( - 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); - }); -}; - -/** - * Get all submissions. - * @param episodeId The current episode's ID. - * @param page The page number. - */ -export const getAllSubmissions = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteSubmissionList(episodeId, page)).body; -}; - -/** - * Get all tournament Submissions for the currently logged in user's team. - * @param episodeId The current episode's ID. - * @param page The page number. - */ -export const getAllUserTournamentSubmissions = async ( - episodeId: string, - 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, - results: res ?? [], - }; -}; - -// -- USERS --// - -/** - * Create a new user. - * @param user The user's info. - */ -export const createUser = async ( - user: customModels.CreateUserInput, -): Promise => { - const defaultUser = { - id: -1, - isStaff: false, - profile: { - avatarUrl: "", - hasAvatar: false, - hasResume: 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; -}; - -/** - * Get a user's profile. - * @param userId The user's ID. - */ -export const getUserProfileByUser = async ( - userId: number, -): Promise => { - return (await API.apiUserURetrieve(userId)).body; -}; - -/** - * Get the currently logged in user's profile. - */ -export const getUserUserProfile = async (): Promise => { - return (await API.apiUserUMeRetrieve()).body; -}; - -/** - * Get all teams associated with a user. - * @param userId The user's ID. - */ -export const getTeamsByUser = async ( - userId: number, -): Promise => { - return (await API.apiUserUTeamsRetrieve(userId)).body; -}; - -/** - * Update the currently logged in user's info. - */ -export const updateUser = async ( - user: models.PatchedUserPrivate, -): Promise => { - await API.apiUserUMePartialUpdate(user); -}; - -// -- AVATARS/RESUMES/REPORTS --// - -/** - * Upload a new avatar for the currently logged in user. - * @param avatarFile The avatar file. - */ -export const avatarUpload = async (avatarFile: File): Promise => { - const data = new FormData(); - data.append("avatar", avatarFile); - await $.ajax({ - url: `${baseUrl}/api/user/u/avatar/`, - type: "POST", - data, - dataType: "json", - processData: false, - contentType: false, - }); -}; - -/** - * Upload a new avatar for the currently logged in user's team. - * @param episodeId The current episode's ID. - * @param avatarFile The avatar file. - */ -export const teamAvatarUpload = async ( - episodeId: string, - avatarFile: File, -): Promise => { - const data = new FormData(); - data.append("avatar", avatarFile); - await $.ajax({ - url: `${baseUrl}/api/team/${episodeId}/t/avatar/`, - type: "POST", - data, - dataType: "json", - processData: false, - contentType: false, - }); -}; - -/** - * Upload a resume for the currently logged in user. - * @param resumeFile The resume file. - */ -export const resumeUpload = async (resumeFile: File): Promise => { - const data = new FormData(); - data.append("resume", resumeFile); - await $.ajax({ - url: `${baseUrl}/api/user/u/resume/`, - type: "PUT", - data, - dataType: "json", - processData: false, - contentType: false, - }); -}; - -/** - * Download the resume of the currently logged in user. - */ -export const downloadResume = async (): Promise => { - await $.ajax({ - url: `${baseUrl}/api/user/u/resume/`, - type: "GET", - }).done((data) => { - const blob = new Blob([data], { type: "application/pdf" }); - const url = window.URL.createObjectURL(blob); - // See https://stackoverflow.com/a/9970672 for file download logic - const a = document.createElement("a"); - a.style.display = "none"; - a.href = url; - a.download = "resume.pdf"; - document.body.appendChild(a); - a.click(); - window.URL.revokeObjectURL(url); - }); -}; - -/** - * Upload a new report for the currently logged in user's team. - * @param episodeId The current episode's ID. - * @param reportFile The report file. - */ -export const uploadUserTeamReport = async ( - episodeId: string, - reportFile: File, -): Promise => { - const data = new FormData(); - data.append("report", reportFile); - await $.ajax({ - url: `${baseUrl}/api/team/${episodeId}/requirement/report/`, - type: "PUT", - data, - dataType: "json", - processData: false, - contentType: false, - }); -}; - -// -- SCRIMMAGES/MATCHES --// - -/** - * Accept a scrimmage invitation. - * @param episodeId The current episode's ID. - * @param scrimmageId The scrimmage's ID to accept. - */ -export const acceptScrimmage = async ( - episodeId: string, - scrimmageId: number, -): Promise => { - const scrimId = scrimmageId.toString(); - await API.apiCompeteRequestAcceptCreate(episodeId, scrimId); -}; - -/** - * Reject a scrimmage invitation. - * @param episodeId The current episode's ID. - * @param scrimmageId The scrimmage's ID to reject. - */ -export const rejectScrimmage = async ( - episodeId: string, - scrimmageId: number, -): Promise => { - const scrimId = scrimmageId.toString(); - await API.apiCompeteRequestRejectCreate(episodeId, scrimId); -}; - -/** - * Get all of the currently logged in user's incoming scrimmage requests. - * @param episodeId The current episode's ID. - */ -export const getUserScrimmagesInbox = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteRequestInboxList(episodeId, page)).body; -}; - -/** - * Get all of the currently logged in user's outgoing scrimmage requests. - * @param episodeId The current episode's ID. - */ -export const getUserScrimmagesOutbox = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteRequestOutboxList(episodeId, page)).body; -}; - -/** - * Request a scrimmage with a team. - * @param episodeId The current episode's ID. - * @param request The scrimmage request body. - */ -export const requestScrimmage = async ( - episodeId: string, - request: { - isRanked: boolean; - 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, - id: -1, - episode: "", - created: "", - status: models.ScrimmageRequestStatusEnum.P, - requestedBy: -1, - requestedByName: "", - requestedByRating: -1, - requestedToName: "", - requestedToRating: -1, - maps: [], - }; - await API.apiCompeteRequestCreate(episodeId, scrimRequest); -}; - -/** - * Get all of the scrimmages that the currently logged in user's team has played. - * @param episodeId The current episode's ID. - * @param page The page of scrimmages to get. - */ -export const getUserScrimmages = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, page)).body; -}; - -/** - * Get all of the scrimmages that a given team has played. - * @param episodeId The current episode's ID. - * @param teamId The team's ID. - * @param page The page of scrimmages to get. - */ -export const getScrimmagesByTeam = async ( - episodeId: string, - teamId: number, - page?: number, -): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, teamId, page)).body; -}; - -/** - * Get all of the tournament matches that the given team has played. - * Can be optionally filtered by tournament and round. - * @param episodeId The current episode's ID. - * @param teamId The team's ID. - * @param tournamentId The tournament's ID. - * @param roundId The tournament round's ID. - * @param page The page of matches to get. - */ -export const getMatchesByTeam = async ( - episodeId: string, - teamId: number, - tournamentId?: string, - roundId?: number, - page?: number, -): Promise => { - return ( - await API.apiCompeteMatchTournamentList( - episodeId, - page, - roundId, - teamId, - tournamentId, - ) - ).body; -}; - -/** - * Get all of the tournament matches played in the given episode. - * @param episodeId The current episode's ID. - * @param page The page of matches to get. - */ -export const getAllMatches = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteMatchList(episodeId, page)).body; -}; - -/** - * Get all of the scrimmages played in the given episode. - * @param episodeId The current episode's ID. - * @param page The page of scrimmages to get. - */ -export const getAllScrimmages = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteMatchScrimmageList(episodeId, page)).body; -}; - -/** - * Get all of the tournament matches the currently logged in user's team has played. - * @param episodeId The current episode's ID. - * @param tournamentId The tournament's ID. - */ -export const getUserMatches = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiCompeteMatchList(episodeId, page)).body; -}; - -// -- TOURNAMENTS --// -/** - * Get the next tournament occurring during the given episode, as ordered by submission freeze time. - * @param episodeId The current episode's ID. - */ -export const getNextTournament = async ( - episodeId: string, -): Promise => { - return (await API.apiEpisodeTournamentNextRetrieve(episodeId)).body; -}; - -/** - * Get all of the tournaments occurring during the given episode. - * @param episodeId The current episode's ID. - * @param page The page of tournaments to get. - */ -export const getAllTournaments = async ( - episodeId: string, - page?: number, -): Promise => { - return (await API.apiEpisodeTournamentList(episodeId, page)).body; -}; diff --git a/frontend2/src/utils/api/auth.ts b/frontend2/src/utils/api/auth.ts new file mode 100644 index 000000000..9922c8a2d --- /dev/null +++ b/frontend2/src/utils/api/auth.ts @@ -0,0 +1,58 @@ +import { TokenApi } from "../types"; +import Cookies from "js-cookie"; +import { DEFAULT_API_CONFIGURATION } from "./helpers"; + +/** This file contains all frontend authentication functions. Responsible for interacting with Cookies and expiring/setting JWT tokens. */ +const API = new TokenApi(DEFAULT_API_CONFIGURATION); + +/** + * Clear the access and refresh tokens from the browser's cookies, + * then redirects the user to the home page. + */ +export const logout = (): void => { + Cookies.remove("access"); + Cookies.remove("refresh"); + window.location.replace("/"); +}; + +/** + * Set the access and refresh tokens in the browser's cookies. + * @param username The username of the user. + * @param password The password of the user. + */ +export const login = async ( + username: string, + password: string, +): Promise => { + const tokenObtainPairRequest = { + username, + password, + }; + + const res = await API.tokenCreate({ tokenObtainPairRequest }); + + Cookies.set("access", res.access); + Cookies.set("refresh", res.refresh); +}; + +/** + * Checks whether the currently held JWT access token is still valid (by posting it to the verify endpoint), + * hence whether or not the frontend still has logged-in access. + * @returns true or false + * Callers of this method should check this, before rendering their logged-in or un-logged-in versions. + * If not logged in, then api calls will give 403s, this function will return false, and the website will tell you to log in anyways. + */ +export const loginCheck = async (): Promise => { + const accessToken = Cookies.get("access"); + if (accessToken === undefined) { + return false; + } + try { + await API.tokenVerifyCreate({ + tokenVerifyRequest: { token: accessToken }, + }); + return true; + } catch { + return false; + } +}; diff --git a/frontend2/src/utils/api/compete.ts b/frontend2/src/utils/api/compete.ts new file mode 100644 index 000000000..e46f7703f --- /dev/null +++ b/frontend2/src/utils/api/compete.ts @@ -0,0 +1,207 @@ +import { + CompeteApi, + type TournamentSubmission, + type PaginatedSubmissionList, + type PaginatedScrimmageRequestList, + type ScrimmageRequestRequest, + type PlayerOrderEnum, + type PaginatedMatchList, +} from "../types"; +import { DEFAULT_API_CONFIGURATION, downloadFile } from "./helpers"; + +/** This file contains all frontend compete functions. + * Note that "scrimmage" refers to a match that does not belong to a tournament. + */ +const API = new CompeteApi(DEFAULT_API_CONFIGURATION); + +/** + * Uploads a new submission to the Google Cloud Storage bucket. + * @param episodeId The current episode's ID. + * @param submission The submission's info. + */ +export const uploadSubmission = async ( + episodeId: string, + submission: { + file: File; + packageName: string; + description: string; + }, +): Promise => { + await API.competeSubmissionCreate({ + episodeId, + submissionRequest: { + source_code: submission.file, + _package: submission.packageName, + description: submission.description, + }, + }); +}; + +/** + * Download a submission from the Google Cloud Storage bucket. + * @param episodeId The current episode's ID. + * @param submissionId The submission's ID. + */ +export const downloadSubmission = async ( + episodeId: string, + submissionId: number, +): Promise => { + // the url where the submission is located + const url: string = ( + await API.competeSubmissionDownloadRetrieve({ + episodeId, + id: submissionId.toString(), + }) + ).url; + + await downloadFile(url, `battlecode_source_${submissionId}.zip`); +}; + +/** + * Get all submissions. + * @param episodeId The current episode's ID. + * @param page The page number. + */ +export const getAllSubmissions = async ( + episodeId: string, + page?: number, +): Promise => { + return await API.competeSubmissionList({ episodeId, page }); +}; + +/** + * Get all tournament submissions for the currently logged in user's team. + * @param episodeId The current episode's ID. + */ +export const getAllUserTournamentSubmissions = async ( + episodeId: string, +): Promise => { + return await API.competeSubmissionTournamentList({ episodeId }); +}; + +/** + * Accept a scrimmage invitation. + * @param episodeId The current episode's ID. + * @param scrimmageId The scrimmage's ID to accept. + */ +export const acceptScrimmage = async ( + episodeId: string, + scrimmageId: number, +): Promise => { + const scrimId = scrimmageId.toString(); + await API.competeRequestAcceptCreate({ episodeId, id: scrimId }); +}; + +/** + * Reject a scrimmage invitation. + * @param episodeId The current episode's ID. + * @param scrimmageId The scrimmage's ID to reject. + */ +export const rejectScrimmage = async ( + episodeId: string, + scrimmageId: number, +): Promise => { + const scrimId = scrimmageId.toString(); + await API.competeRequestRejectCreate({ episodeId, id: scrimId }); +}; + +/** + * Get all of the currently logged in user's incoming scrimmage requests. + * @param episodeId The current episode's ID. + */ +export const getUserScrimmagesInbox = async ( + episodeId: string, + page?: number, +): Promise => { + return await API.competeRequestInboxList({ episodeId, page }); +}; + +/** + * Get all of the currently logged in user's outgoing scrimmage requests. + * @param episodeId The current episode's ID. + */ +export const getUserScrimmagesOutbox = async ( + episodeId: string, + page?: number, +): Promise => { + return await API.competeRequestOutboxList({ episodeId, page }); +}; + +/** + * Request a scrimmage with a team. + * @param episodeId The current episode's ID. + * @param request The scrimmage request body. + */ +export const requestScrimmage = async ( + episodeId: string, + request: { + isRanked: boolean; + requestedTo: number; + playerOrder: PlayerOrderEnum; + mapNames: string[]; + }, +): Promise => { + const scrimmageRequest: ScrimmageRequestRequest = { + is_ranked: request.isRanked, + requested_to: request.requestedTo, + player_order: request.playerOrder, + map_names: request.mapNames, + }; + await API.competeRequestCreate({ + episodeId, + scrimmageRequestRequest: scrimmageRequest, + }); +}; + +/** + * Get all of the scrimmages (non-tournament matches) that a given team has played. + * If teamId is not specified, defaults to the logged in user's team. + * @param episodeId The current episode's ID. + * @param teamId The team's ID. Defaults to the logged in user's team. + * @param page The page of scrimmages to get. + */ +export const getScrimmagesByTeam = async ( + episodeId: string, + teamId?: number, + page?: number, +): Promise => { + return await API.competeMatchScrimmageList({ episodeId, teamId, page }); +}; + +/** + * Get all of the tournament matches of an episode, + * optionally filtered by tournament, round and/or team. + * @param episodeId The current episode's ID. + * @param teamId The team's ID. + * @param tournamentId The tournament's ID. + * @param roundId The tournament round's ID. + * @param page The page of matches to get. + */ +export const getTournamentMatches = async ( + episodeId: string, + teamId?: number, + tournamentId?: string, + roundId?: number, + page?: number, +): Promise => { + return await API.competeMatchTournamentList({ + episodeId, + page, + roundId, + teamId, + tournamentId, + }); +}; + +/** + * Get all of the matches played in the given episode. Includes both tournament + * matches and scrimmages. + * @param episodeId The current episode's ID. + * @param page The page of matches to get. + */ +export const getAllMatches = async ( + episodeId: string, + page?: number, +): Promise => { + return await API.competeMatchList({ episodeId, page }); +}; diff --git a/frontend2/src/utils/api/episode.ts b/frontend2/src/utils/api/episode.ts new file mode 100644 index 000000000..00157b71b --- /dev/null +++ b/frontend2/src/utils/api/episode.ts @@ -0,0 +1,49 @@ +import { + type Episode, + EpisodeApi, + type GameMap, + type Tournament, + type PaginatedTournamentList, +} from "../types"; +import { DEFAULT_API_CONFIGURATION } from "./helpers"; + +/** This file contains all frontend episode api functions. */ +const API = new EpisodeApi(DEFAULT_API_CONFIGURATION); + +/** + * Get the current episode's info. + * @param episodeId The current episode's ID. + */ +export const getEpisodeInfo = async (episodeId: string): Promise => { + return await API.episodeERetrieve({ id: episodeId }); +}; + +/** + * Get all maps for the provided episode. + * @param episodeId The current episode's ID. + */ +export const getAllMaps = async (episodeId: string): Promise => { + return await API.episodeMapList({ episodeId }); +}; + +/** + * Get the next tournament occurring during the given episode, as ordered by submission freeze time. + * @param episodeId The current episode's ID. + */ +export const getNextTournament = async ( + episodeId: string, +): Promise => { + return await API.episodeTournamentNextRetrieve({ episodeId }); +}; + +/** + * Get all of the tournaments occurring during the given episode. + * @param episodeId The current episode's ID. + * @param page The page of tournaments to get. + */ +export const getAllTournaments = async ( + episodeId: string, + page?: number, +): Promise => { + return await API.episodeTournamentList({ episodeId, page }); +}; diff --git a/frontend2/src/utils/api/helpers.ts b/frontend2/src/utils/api/helpers.ts new file mode 100644 index 000000000..753576e80 --- /dev/null +++ b/frontend2/src/utils/api/helpers.ts @@ -0,0 +1,29 @@ +import Cookies from "js-cookie"; +import { Configuration } from "../types"; + +// fall back to localhost for now +export const BASE_URL = + process.env.REACT_APP_BACKEND_URL ?? "http://localhost:8000"; + +export const DEFAULT_API_CONFIGURATION = new Configuration({ + basePath: BASE_URL, + accessToken: () => Cookies.get("access") as string, +}); + +export const downloadFile = async ( + url: string, + downloadFileName: string, +): Promise => { + const response = await fetch(url); + const blob = await response.blob(); + + // trigger download in user's browser + const objUrl = window.URL.createObjectURL(blob); + const aHelper = document.createElement("a"); + aHelper.style.display = "none"; + aHelper.href = objUrl; + aHelper.download = downloadFileName; + document.body.appendChild(aHelper); + aHelper.click(); + window.URL.revokeObjectURL(objUrl); +}; diff --git a/frontend2/src/utils/api/team.ts b/frontend2/src/utils/api/team.ts new file mode 100644 index 000000000..59a2ee78e --- /dev/null +++ b/frontend2/src/utils/api/team.ts @@ -0,0 +1,143 @@ +import { + TeamApi, + type TeamJoinRequest, + type TeamCreate, + type PaginatedTeamPublicList, + type TeamTListRequest, + type TeamTAvatarCreateRequest, +} from "../types"; +import { DEFAULT_API_CONFIGURATION } from "./helpers"; + +/** This file contains all frontend team api functions. */ +const API = new TeamApi(DEFAULT_API_CONFIGURATION); + +/** + * Creates a new team. + * @param teamName The name of the team. + */ +export const createTeam = async ( + episodeId: string, + teamName: string, +): Promise => { + return await API.teamTCreate({ + episodeId, + teamCreateRequest: { + episode: episodeId, + name: teamName, + }, + }); +}; + +/** + * Join the team with the given join key & name. + * @param episodeId The current episode's ID. + * @param teamName The team's name. + * @param joinKey The team's join key. + */ +export const joinTeam = async ( + episodeId: string, + teamName: string, + joinKey: string, +): Promise => { + const teamJoinRequest: TeamJoinRequest = { + name: teamName, + join_key: joinKey, + }; + await API.teamTJoinCreate({ episodeId, teamJoinRequest }); +}; + +/** + * Leave the user's current team. + * @param episodeId The current episode's ID. + */ +export const leaveTeam = async (episodeId: string): Promise => { + await API.teamTLeaveCreate({ episodeId }); +}; + +// -- TEAM STATS --// + +// TODO: implement rankings history +// /** +// * Get the Mu history of the given team. +// * @param teamId The team's ID. +// */ +// export const getTeamMuHistoryByTeam = async (teamId: number) => { +// return await $.get(`${baseUrl}/api/${LEAGUE}/team/${teamId}/history/`); +// }; + +/** + * getTeamMuHistoryByTeam + */ + +/** + * getTeamWinStatsByTeam + */ + +/** + * getUserTeamWinStats + */ + +/** + * getTeamInfoByTeam + */ + +/** + * getTeamRankingByTeam + */ + +/** + * Search team, ordering the result by ranking. + * @param episodeId The current episode's ID. + * @param searchQuery The search query. + * @param requireActiveSubmission Whether to require an active submission. + * @param page The page number. + */ +export const searchTeams = async ( + episodeId: string, + searchQuery: string, + requireActiveSubmission: boolean, + page?: number, +): Promise => { + const request: TeamTListRequest = { + episodeId, + ordering: "-rating,name", + search: searchQuery, + page: page ?? 1, + }; + return await API.teamTList(request); +}; + +/** + * Upload a new avatar for the currently logged in user's team. + * @param episodeId The current episode's ID. + * @param avatarFile The avatar file. + */ +export const teamAvatarUpload = async ( + episodeId: string, + avatarFile: File, +): Promise => { + const request: TeamTAvatarCreateRequest = { + episodeId, + teamAvatarRequest: { + avatar: avatarFile, + }, + }; + await API.teamTAvatarCreate(request); +}; + +/** + * Upload a new report for the currently logged in user's team. + * @param episodeId The current episode's ID. + * @param reportFile The report file. + */ +export const uploadUserTeamReport = async ( + episodeId: string, + reportFile: File, +): Promise => { + await API.teamRequirementReportUpdate({ + episodeId, + teamReportRequest: { + report: reportFile, + }, + }); +}; diff --git a/frontend2/src/utils/api/user.ts b/frontend2/src/utils/api/user.ts new file mode 100644 index 000000000..725bef77f --- /dev/null +++ b/frontend2/src/utils/api/user.ts @@ -0,0 +1,115 @@ +import { + UserApi, + type UserPublic, + type UserCreate, + type UserCreateRequest, + type UserPrivate, + type TeamPublic, + type PatchedUserPrivateRequest, + type UserAvatarRequest, +} from "../types"; +import { DEFAULT_API_CONFIGURATION, downloadFile } from "./helpers"; +import { login } from "./auth"; + +/** This file contains all frontend user api functions. */ +const API = new UserApi(DEFAULT_API_CONFIGURATION); + +/** + * Register a new user, and logs the new user in (via access / refresh tokens) + * @param user The user to register. + * @returns The new user that was created. + */ +export const createUser = async ( + user: UserCreateRequest, +): Promise => { + const returnedUser = await API.userUCreate({ userCreateRequest: user }); + await login(user.username, user.password); + return returnedUser; +}; + +/** + * Confirm resetting a user's password. + * @param password The new password. + * @param token The password reset token. + */ +export const doResetPassword = async ( + password: string, + token: string, +): Promise => { + await API.userPasswordResetConfirmCreate({ + passwordTokenRequest: { password, token }, + }); +}; + +/** + * Request a password reset token to be sent to the provided email. + */ +export const forgotPassword = async (email: string): Promise => { + await API.userPasswordResetCreate({ emailRequest: { email } }); +}; + +/** + * Get a user's profile. + * @param userId The user's ID. + */ +export const getUserProfileByUser = async ( + userId: number, +): Promise => { + return await API.userURetrieve({ id: userId }); +}; + +/** + * Get the currently logged in user's profile. + */ +export const getUserUserProfile = async (): Promise => { + return await API.userUMeRetrieve(); +}; + +/** + * Get all teams associated with a user. + * @param userId The user's ID. + */ +export const getTeamsByUser = async ( + userId: number, +): Promise> => { + return await API.userUTeamsRetrieve({ id: userId }); +}; + +/** + * Update the currently logged in user's info. + */ +export const updateUser = async ( + user: PatchedUserPrivateRequest, +): Promise => { + return await API.userUMePartialUpdate({ patchedUserPrivateRequest: user }); +}; + +/** + * Upload a new avatar for the currently logged in user. + * @param avatarFile The avatar file. + */ +export const avatarUpload = async (avatarFile: File): Promise => { + const userAvatarRequest: UserAvatarRequest = { + avatar: avatarFile, + }; + await API.userUAvatarCreate({ userAvatarRequest }); +}; + +/** + * Upload a resume for the currently logged in user. + * @param resumeFile The resume file. + */ +export const resumeUpload = async (resumeFile: File): Promise => { + await API.userUResumeUpdate({ userResumeRequest: { resume: resumeFile } }); +}; + +/** + * Download the resume of the currently logged in user. + */ +export const downloadResume = async (): Promise => { + const { ready, url, reason } = await API.userUResumeRetrieve(); + if (!ready) { + throw new Error(`Error downloading the resume: ${reason}`); + } + await downloadFile(url, "resume.pdf"); +}; diff --git a/frontend2/src/utils/apiTypes.ts b/frontend2/src/utils/apiTypes.ts index 322e9f8cf..4135e91a5 100644 --- a/frontend2/src/utils/apiTypes.ts +++ b/frontend2/src/utils/apiTypes.ts @@ -1,14 +1,16 @@ +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}`; -export const COUNTRIES = { +export const COUNTRIES: Record = { US: "United States of America", CA: "Canada", AU: "Australia", @@ -259,27 +261,3 @@ export const COUNTRIES = { ZM: "Zambia", ZW: "Zimbabwe", } as const; - -export type Country = keyof typeof COUNTRIES; - -export interface CreateUserInput { - profile: { - gender: Gender; - genderDetails?: string; - school?: string; - country: Country; - }; - - /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - */ - username: string; - - password: string; - - email: string; - - firstName: string; - - lastName: string; -} diff --git a/frontend2/src/utils/auth.ts b/frontend2/src/utils/auth.ts deleted file mode 100644 index 7c796f6c3..000000000 --- a/frontend2/src/utils/auth.ts +++ /dev/null @@ -1,102 +0,0 @@ -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 customModels from "./apiTypes"; - -/** 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); - -/** - * Clear the access and refresh tokens from the browser's cookies. - */ -export const logout = (): void => { - Cookies.set("access", ""); - Cookies.set("refresh", ""); - setLoginHeader(); - window.location.replace("/"); -}; - -/** - * Set the access and refresh tokens in the browser's cookies. - * @param username The username of the user. - * @param password The password of the user. - */ -export const login = async ( - username: string, - password: string, -): Promise => { - const credentials = { - username, - password, - access: "", - refresh: "", - }; - - const res = await Api.getApiTokens(credentials); - - Cookies.set("access", res.access); - Cookies.set("refresh", res.refresh); -}; - -/** - * Set authorization header based on the current cookie state, which is provided by - * default for all subsequent requests. The header is a JWT token: see - * https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html - */ -export const setLoginHeader = (): void => { - const accessToken = Cookies.get("access"); - if (accessToken !== undefined) { - $.ajaxSetup({ - headers: { Authorization: `Bearer ${accessToken}` }, - }); - } -}; - -/** - * Checks whether the currently held JWT access token is still valid (by posting it to the verify endpoint), - * hence whether or not the frontend still has logged-in access. - * @returns true or false - * Callers of this method should check this, before rendering their logged-in or un-logged-in versions. - * If not logged in, then api calls will give 403s, and the website will tell you to log in anyways. - */ -export const loginCheck = async (): Promise => { - return await Api.verifyCurrentToken(); -}; - -/** - * Register a new user. - * @param user The user to register. - */ -export const register = async ( - user: customModels.CreateUserInput, -): Promise => { - const returnedUser = await Api.createUser(user); - await login(user.username, user.password); - return returnedUser; -}; - -/** - * Confirm resetting a user's password. - * @param password The new password. - * @param token The password reset token. - */ -export const doResetPassword = async ( - password: string, - token: string, -): Promise => { - await API.apiUserPasswordResetConfirmCreate({ 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 }); -}; diff --git a/frontend2/src/utils/cookies.ts b/frontend2/src/utils/cookies.ts index ce72dd622..e4ad17606 100644 --- a/frontend2/src/utils/cookies.ts +++ b/frontend2/src/utils/cookies.ts @@ -5,6 +5,17 @@ export const removeApiTokens = (): void => { Cookies.remove("refresh"); }; +export const setApiTokens = ({ + access, + refresh, +}: { + access: string; + refresh: string; +}): void => { + Cookies.set("access", access); + Cookies.set("refresh", refresh); +}; + export const doApiTokensExist = (): boolean => { return ( Cookies.get("access") !== undefined && Cookies.get("refresh") !== undefined diff --git a/frontend2/src/utils/types/.openapi-generator/FILES b/frontend2/src/utils/types/.openapi-generator/FILES index 45ab4061d..1771c76ac 100644 --- a/frontend2/src/utils/types/.openapi-generator/FILES +++ b/frontend2/src/utils/types/.openapi-generator/FILES @@ -1,65 +1,85 @@ -api/ApiApi.ts -api/api.ts -configuration.ts -git_push.sh +.openapi-generator-ignore +apis/CompeteApi.ts +apis/EpisodeApi.ts +apis/SpecsApi.ts +apis/TeamApi.ts +apis/TokenApi.ts +apis/UserApi.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/AutoscrimRequest.ts +models/ClassRequirement.ts +models/CountryEnum.ts +models/EligibilityCriterion.ts +models/Email.ts +models/EmailRequest.ts +models/Episode.ts +models/GameMap.ts +models/GenderEnum.ts +models/HistoricalRating.ts +models/LanguageEnum.ts +models/Match.ts +models/MatchParticipant.ts +models/MatchReportRequest.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/PasswordTokenRequest.ts +models/PatchedTeamPrivateRequest.ts +models/PatchedUserPrivateRequest.ts +models/PlayerOrderEnum.ts +models/ReleaseStatusEnum.ts +models/ResetToken.ts +models/ResetTokenRequest.ts +models/SaturnInvocationRequest.ts +models/ScrimmageRequest.ts +models/ScrimmageRequestRequest.ts +models/ScrimmageStatusEnum.ts +models/Status526Enum.ts +models/StatusBccEnum.ts +models/StyleEnum.ts +models/Submission.ts +models/SubmissionDownload.ts +models/SubmissionReportRequest.ts +models/SubmissionRequest.ts +models/TeamAvatarRequest.ts +models/TeamCreate.ts +models/TeamCreateRequest.ts +models/TeamJoinRequest.ts +models/TeamPrivate.ts +models/TeamPrivateRequest.ts +models/TeamProfilePrivate.ts +models/TeamProfilePrivateRequest.ts +models/TeamProfilePublic.ts +models/TeamPublic.ts +models/TeamReportRequest.ts +models/TokenObtainPair.ts +models/TokenObtainPairRequest.ts +models/TokenRefresh.ts +models/TokenRefreshRequest.ts +models/TokenVerifyRequest.ts +models/Tournament.ts +models/TournamentRound.ts +models/TournamentSubmission.ts +models/UserAvatarRequest.ts +models/UserCreate.ts +models/UserCreateRequest.ts +models/UserPassed.ts +models/UserPrivate.ts +models/UserPrivateRequest.ts +models/UserProfilePrivate.ts +models/UserProfilePrivateRequest.ts +models/UserProfilePublic.ts +models/UserProfilePublicRequest.ts +models/UserPublic.ts +models/UserPublicRequest.ts +models/UserResume.ts +models/UserResumeRequest.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/CompeteApi.ts b/frontend2/src/utils/types/apis/CompeteApi.ts new file mode 100644 index 000000000..119fd43eb --- /dev/null +++ b/frontend2/src/utils/types/apis/CompeteApi.ts @@ -0,0 +1,1036 @@ +/* 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 { + HistoricalRating, + Match, + MatchReportRequest, + PaginatedMatchList, + PaginatedScrimmageRequestList, + PaginatedSubmissionList, + ScrimmageRequest, + ScrimmageRequestRequest, + Submission, + SubmissionDownload, + SubmissionReportRequest, + SubmissionRequest, + TournamentSubmission, +} from '../models'; +import { + HistoricalRatingFromJSON, + HistoricalRatingToJSON, + MatchFromJSON, + MatchToJSON, + MatchReportRequestFromJSON, + MatchReportRequestToJSON, + PaginatedMatchListFromJSON, + PaginatedMatchListToJSON, + PaginatedScrimmageRequestListFromJSON, + PaginatedScrimmageRequestListToJSON, + PaginatedSubmissionListFromJSON, + PaginatedSubmissionListToJSON, + ScrimmageRequestFromJSON, + ScrimmageRequestToJSON, + ScrimmageRequestRequestFromJSON, + ScrimmageRequestRequestToJSON, + SubmissionFromJSON, + SubmissionToJSON, + SubmissionDownloadFromJSON, + SubmissionDownloadToJSON, + SubmissionReportRequestFromJSON, + SubmissionReportRequestToJSON, + SubmissionRequestFromJSON, + SubmissionRequestToJSON, + TournamentSubmissionFromJSON, + TournamentSubmissionToJSON, +} from '../models'; + +export interface CompeteMatchHistoricalRatingRetrieveRequest { + episodeId: string; + teamId?: number; +} + +export interface CompeteMatchListRequest { + episodeId: string; + page?: number; +} + +export interface CompeteMatchPublishPublicBracketCreateRequest { + episodeId: string; + id: string; +} + +export interface CompeteMatchRatingUpdateCreateRequest { + episodeId: string; + id: string; +} + +export interface CompeteMatchReportCreateRequest { + episodeId: string; + id: string; + matchReportRequest: MatchReportRequest; +} + +export interface CompeteMatchRetrieveRequest { + episodeId: string; + id: string; +} + +export interface CompeteMatchScrimmageListRequest { + episodeId: string; + page?: number; + teamId?: number; +} + +export interface CompeteMatchTournamentListRequest { + episodeId: string; + page?: number; + roundId?: number; + teamId?: number; + tournamentId?: string; +} + +export interface CompeteRequestAcceptCreateRequest { + episodeId: string; + id: string; +} + +export interface CompeteRequestCreateRequest { + episodeId: string; + scrimmageRequestRequest: ScrimmageRequestRequest; +} + +export interface CompeteRequestDestroyRequest { + episodeId: string; + id: string; +} + +export interface CompeteRequestInboxListRequest { + episodeId: string; + page?: number; +} + +export interface CompeteRequestOutboxListRequest { + episodeId: string; + page?: number; +} + +export interface CompeteRequestRejectCreateRequest { + episodeId: string; + id: string; +} + +export interface CompeteSubmissionCreateRequest { + episodeId: string; + submissionRequest: SubmissionRequest; +} + +export interface CompeteSubmissionDownloadRetrieveRequest { + episodeId: string; + id: string; +} + +export interface CompeteSubmissionListRequest { + episodeId: string; + page?: number; +} + +export interface CompeteSubmissionReportCreateRequest { + episodeId: string; + id: string; + submissionReportRequest: SubmissionReportRequest; +} + +export interface CompeteSubmissionRetrieveRequest { + episodeId: string; + id: string; +} + +export interface CompeteSubmissionTournamentListRequest { + episodeId: string; +} + +/** + * + */ +export class CompeteApi extends runtime.BaseAPI { + + /** + * List the historical rating of a team. + */ + async competeMatchHistoricalRatingRetrieveRaw(requestParameters: CompeteMatchHistoricalRatingRetrieveRequest, 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 competeMatchHistoricalRatingRetrieve.'); + } + + 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 competeMatchHistoricalRatingRetrieve(requestParameters: CompeteMatchHistoricalRatingRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeMatchHistoricalRatingRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async competeMatchListRaw(requestParameters: CompeteMatchListRequest, 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 competeMatchList.'); + } + + 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 competeMatchList(requestParameters: CompeteMatchListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeMatchListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Publish the result of a tournament match to the public bracket. + */ + async competeMatchPublishPublicBracketCreateRaw(requestParameters: CompeteMatchPublishPublicBracketCreateRequest, 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 competeMatchPublishPublicBracketCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeMatchPublishPublicBracketCreate.'); + } + + 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 competeMatchPublishPublicBracketCreate(requestParameters: CompeteMatchPublishPublicBracketCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeMatchPublishPublicBracketCreateRaw(requestParameters, initOverrides); + } + + /** + * Try to finalize the rating of this match. + */ + async competeMatchRatingUpdateCreateRaw(requestParameters: CompeteMatchRatingUpdateCreateRequest, 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 competeMatchRatingUpdateCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeMatchRatingUpdateCreate.'); + } + + 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 competeMatchRatingUpdateCreate(requestParameters: CompeteMatchRatingUpdateCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeMatchRatingUpdateCreateRaw(requestParameters, initOverrides); + } + + /** + * Report the outcome of this match on Saturn. + */ + async competeMatchReportCreateRaw(requestParameters: CompeteMatchReportCreateRequest, 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 competeMatchReportCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeMatchReportCreate.'); + } + + if (requestParameters.matchReportRequest === null || requestParameters.matchReportRequest === undefined) { + throw new runtime.RequiredError('matchReportRequest','Required parameter requestParameters.matchReportRequest was null or undefined when calling competeMatchReportCreate.'); + } + + 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: MatchReportRequestToJSON(requestParameters.matchReportRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Report the outcome of this match on Saturn. + */ + async competeMatchReportCreate(requestParameters: CompeteMatchReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeMatchReportCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for viewing and retrieving Matches. + */ + async competeMatchRetrieveRaw(requestParameters: CompeteMatchRetrieveRequest, 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 competeMatchRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeMatchRetrieve.'); + } + + 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 competeMatchRetrieve(requestParameters: CompeteMatchRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeMatchRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all scrimmages that a particular team participated in. + */ + async competeMatchScrimmageListRaw(requestParameters: CompeteMatchScrimmageListRequest, 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 competeMatchScrimmageList.'); + } + + 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 competeMatchScrimmageList(requestParameters: CompeteMatchScrimmageListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeMatchScrimmageListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List matches played in a tournament. + */ + async competeMatchTournamentListRaw(requestParameters: CompeteMatchTournamentListRequest, 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 competeMatchTournamentList.'); + } + + 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 competeMatchTournamentList(requestParameters: CompeteMatchTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeMatchTournamentListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Accept a scrimmage request. + */ + async competeRequestAcceptCreateRaw(requestParameters: CompeteRequestAcceptCreateRequest, 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 competeRequestAcceptCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeRequestAcceptCreate.'); + } + + 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 competeRequestAcceptCreate(requestParameters: CompeteRequestAcceptCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeRequestAcceptCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for creating and responding to Scrimmage Requests. + */ + async competeRequestCreateRaw(requestParameters: CompeteRequestCreateRequest, 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 competeRequestCreate.'); + } + + if (requestParameters.scrimmageRequestRequest === null || requestParameters.scrimmageRequestRequest === undefined) { + throw new runtime.RequiredError('scrimmageRequestRequest','Required parameter requestParameters.scrimmageRequestRequest was null or undefined when calling competeRequestCreate.'); + } + + 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: ScrimmageRequestRequestToJSON(requestParameters.scrimmageRequestRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ScrimmageRequestFromJSON(jsonValue)); + } + + /** + * A viewset for creating and responding to Scrimmage Requests. + */ + async competeRequestCreate(requestParameters: CompeteRequestCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeRequestCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Cancel a scrimmage request. + */ + async competeRequestDestroyRaw(requestParameters: CompeteRequestDestroyRequest, 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 competeRequestDestroy.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeRequestDestroy.'); + } + + 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 competeRequestDestroy(requestParameters: CompeteRequestDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeRequestDestroyRaw(requestParameters, initOverrides); + } + + /** + * Get all pending scrimmage requests received. + */ + async competeRequestInboxListRaw(requestParameters: CompeteRequestInboxListRequest, 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 competeRequestInboxList.'); + } + + 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 competeRequestInboxList(requestParameters: CompeteRequestInboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeRequestInboxListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Get all pending scrimmage requests sent. + */ + async competeRequestOutboxListRaw(requestParameters: CompeteRequestOutboxListRequest, 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 competeRequestOutboxList.'); + } + + 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 competeRequestOutboxList(requestParameters: CompeteRequestOutboxListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeRequestOutboxListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Reject a scrimmage request. + */ + async competeRequestRejectCreateRaw(requestParameters: CompeteRequestRejectCreateRequest, 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 competeRequestRejectCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeRequestRejectCreate.'); + } + + 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 competeRequestRejectCreate(requestParameters: CompeteRequestRejectCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeRequestRejectCreateRaw(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 competeSubmissionCreateRaw(requestParameters: CompeteSubmissionCreateRequest, 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 competeSubmissionCreate.'); + } + + if (requestParameters.submissionRequest === null || requestParameters.submissionRequest === undefined) { + throw new runtime.RequiredError('submissionRequest','Required parameter requestParameters.submissionRequest was null or undefined when calling competeSubmissionCreate.'); + } + + 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: SubmissionRequestToJSON(requestParameters.submissionRequest), + }, 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 competeSubmissionCreate(requestParameters: CompeteSubmissionCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeSubmissionCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Download the source code associated with a submission. + */ + async competeSubmissionDownloadRetrieveRaw(requestParameters: CompeteSubmissionDownloadRetrieveRequest, 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 competeSubmissionDownloadRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeSubmissionDownloadRetrieve.'); + } + + 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 competeSubmissionDownloadRetrieve(requestParameters: CompeteSubmissionDownloadRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeSubmissionDownloadRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async competeSubmissionListRaw(requestParameters: CompeteSubmissionListRequest, 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 competeSubmissionList.'); + } + + 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 competeSubmissionList(requestParameters: CompeteSubmissionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeSubmissionListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Report the outcome of this submission on Saturn. + */ + async competeSubmissionReportCreateRaw(requestParameters: CompeteSubmissionReportCreateRequest, 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 competeSubmissionReportCreate.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeSubmissionReportCreate.'); + } + + if (requestParameters.submissionReportRequest === null || requestParameters.submissionReportRequest === undefined) { + throw new runtime.RequiredError('submissionReportRequest','Required parameter requestParameters.submissionReportRequest was null or undefined when calling competeSubmissionReportCreate.'); + } + + 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: SubmissionReportRequestToJSON(requestParameters.submissionReportRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Report the outcome of this submission on Saturn. + */ + async competeSubmissionReportCreate(requestParameters: CompeteSubmissionReportCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.competeSubmissionReportCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for creating and retrieving Submissions. + */ + async competeSubmissionRetrieveRaw(requestParameters: CompeteSubmissionRetrieveRequest, 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 competeSubmissionRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling competeSubmissionRetrieve.'); + } + + 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 competeSubmissionRetrieve(requestParameters: CompeteSubmissionRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.competeSubmissionRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve the submissions used in tournaments by the current team.. + */ + async competeSubmissionTournamentListRaw(requestParameters: CompeteSubmissionTournamentListRequest, 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 competeSubmissionTournamentList.'); + } + + 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) => jsonValue.map(TournamentSubmissionFromJSON)); + } + + /** + * Retrieve the submissions used in tournaments by the current team.. + */ + async competeSubmissionTournamentList(requestParameters: CompeteSubmissionTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.competeSubmissionTournamentListRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/frontend2/src/utils/types/apis/EpisodeApi.ts b/frontend2/src/utils/types/apis/EpisodeApi.ts new file mode 100644 index 000000000..c67e404d9 --- /dev/null +++ b/frontend2/src/utils/types/apis/EpisodeApi.ts @@ -0,0 +1,513 @@ +/* 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 { + AutoscrimRequest, + Episode, + GameMap, + PaginatedEpisodeList, + PaginatedTournamentList, + PaginatedTournamentRoundList, + Tournament, + TournamentRound, +} from '../models'; +import { + AutoscrimRequestFromJSON, + AutoscrimRequestToJSON, + EpisodeFromJSON, + EpisodeToJSON, + GameMapFromJSON, + GameMapToJSON, + PaginatedEpisodeListFromJSON, + PaginatedEpisodeListToJSON, + PaginatedTournamentListFromJSON, + PaginatedTournamentListToJSON, + PaginatedTournamentRoundListFromJSON, + PaginatedTournamentRoundListToJSON, + TournamentFromJSON, + TournamentToJSON, + TournamentRoundFromJSON, + TournamentRoundToJSON, +} from '../models'; + +export interface EpisodeEAutoscrimCreateRequest { + id: string; + autoscrimRequest: AutoscrimRequest; +} + +export interface EpisodeEListRequest { + page?: number; +} + +export interface EpisodeERetrieveRequest { + id: string; +} + +export interface EpisodeMapListRequest { + episodeId: string; +} + +export interface EpisodeMapRetrieveRequest { + episodeId: string; + id: string; +} + +export interface EpisodeTournamentListRequest { + episodeId: string; + page?: number; +} + +export interface EpisodeTournamentNextRetrieveRequest { + episodeId: string; +} + +export interface EpisodeTournamentRetrieveRequest { + episodeId: string; + id: string; +} + +export interface EpisodeTournamentRoundListRequest { + episodeId: string; + tournament: string; + page?: number; +} + +export interface EpisodeTournamentRoundRetrieveRequest { + episodeId: string; + id: string; + tournament: string; +} + +/** + * + */ +export class EpisodeApi extends runtime.BaseAPI { + + /** + * Trigger a round of autoscrimmages. + */ + async episodeEAutoscrimCreateRaw(requestParameters: EpisodeEAutoscrimCreateRequest, 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 episodeEAutoscrimCreate.'); + } + + if (requestParameters.autoscrimRequest === null || requestParameters.autoscrimRequest === undefined) { + throw new runtime.RequiredError('autoscrimRequest','Required parameter requestParameters.autoscrimRequest was null or undefined when calling episodeEAutoscrimCreate.'); + } + + 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: AutoscrimRequestToJSON(requestParameters.autoscrimRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Trigger a round of autoscrimmages. + */ + async episodeEAutoscrimCreate(requestParameters: EpisodeEAutoscrimCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.episodeEAutoscrimCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving Episodes. + */ + async episodeEListRaw(requestParameters: EpisodeEListRequest, 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 episodeEList(requestParameters: EpisodeEListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeEListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Episodes. + */ + async episodeERetrieveRaw(requestParameters: EpisodeERetrieveRequest, 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 episodeERetrieve.'); + } + + 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 episodeERetrieve(requestParameters: EpisodeERetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeERetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Maps. + */ + async episodeMapListRaw(requestParameters: EpisodeMapListRequest, 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 episodeMapList.'); + } + + 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, (jsonValue) => jsonValue.map(GameMapFromJSON)); + } + + /** + * A viewset for retrieving Maps. + */ + async episodeMapList(requestParameters: EpisodeMapListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.episodeMapListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Maps. + */ + async episodeMapRetrieveRaw(requestParameters: EpisodeMapRetrieveRequest, 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 episodeMapRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling episodeMapRetrieve.'); + } + + 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); + + return new runtime.JSONApiResponse(response, (jsonValue) => GameMapFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving Maps. + */ + async episodeMapRetrieve(requestParameters: EpisodeMapRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeMapRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Tournaments. + */ + async episodeTournamentListRaw(requestParameters: EpisodeTournamentListRequest, 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 episodeTournamentList.'); + } + + 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 episodeTournamentList(requestParameters: EpisodeTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeTournamentListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve the next upcoming tournament, as ordered by submission freeze time. + */ + async episodeTournamentNextRetrieveRaw(requestParameters: EpisodeTournamentNextRetrieveRequest, 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 episodeTournamentNextRetrieve.'); + } + + 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 episodeTournamentNextRetrieve(requestParameters: EpisodeTournamentNextRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeTournamentNextRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving Tournaments. + */ + async episodeTournamentRetrieveRaw(requestParameters: EpisodeTournamentRetrieveRequest, 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 episodeTournamentRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling episodeTournamentRetrieve.'); + } + + 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 episodeTournamentRetrieve(requestParameters: EpisodeTournamentRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeTournamentRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async episodeTournamentRoundListRaw(requestParameters: EpisodeTournamentRoundListRequest, 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 episodeTournamentRoundList.'); + } + + if (requestParameters.tournament === null || requestParameters.tournament === undefined) { + throw new runtime.RequiredError('tournament','Required parameter requestParameters.tournament was null or undefined when calling episodeTournamentRoundList.'); + } + + 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 episodeTournamentRoundList(requestParameters: EpisodeTournamentRoundListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeTournamentRoundListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving tournament rounds. + */ + async episodeTournamentRoundRetrieveRaw(requestParameters: EpisodeTournamentRoundRetrieveRequest, 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 episodeTournamentRoundRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling episodeTournamentRoundRetrieve.'); + } + + if (requestParameters.tournament === null || requestParameters.tournament === undefined) { + throw new runtime.RequiredError('tournament','Required parameter requestParameters.tournament was null or undefined when calling episodeTournamentRoundRetrieve.'); + } + + 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 episodeTournamentRoundRetrieve(requestParameters: EpisodeTournamentRoundRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.episodeTournamentRoundRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/frontend2/src/utils/types/apis/SpecsApi.ts b/frontend2/src/utils/types/apis/SpecsApi.ts new file mode 100644 index 000000000..1894e6ca9 --- /dev/null +++ b/frontend2/src/utils/types/apis/SpecsApi.ts @@ -0,0 +1,182 @@ +/* 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'; + +export interface SpecsRetrieveRequest { + format?: SpecsRetrieveFormatEnum; + lang?: SpecsRetrieveLangEnum; +} + +/** + * + */ +export class SpecsApi extends runtime.BaseAPI { + + /** + * OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json + */ + async specsRetrieveRaw(requestParameters: SpecsRetrieveRequest, 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 specsRetrieve(requestParameters: SpecsRetrieveRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> { + const response = await this.specsRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + * @enum {string} + */ +export enum SpecsRetrieveFormatEnum { + Json = 'json', + Yaml = 'yaml' +} +/** + * @export + * @enum {string} + */ +export enum SpecsRetrieveLangEnum { + 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', + Ms = 'ms', + 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/TeamApi.ts b/frontend2/src/utils/types/apis/TeamApi.ts new file mode 100644 index 000000000..960c2aa8b --- /dev/null +++ b/frontend2/src/utils/types/apis/TeamApi.ts @@ -0,0 +1,771 @@ +/* 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 { + ClassRequirement, + PaginatedClassRequirementList, + PaginatedTeamPublicList, + PatchedTeamPrivateRequest, + TeamAvatarRequest, + TeamCreate, + TeamCreateRequest, + TeamJoinRequest, + TeamPrivate, + TeamPrivateRequest, + TeamPublic, + TeamReportRequest, + UserPassed, +} from '../models'; +import { + ClassRequirementFromJSON, + ClassRequirementToJSON, + PaginatedClassRequirementListFromJSON, + PaginatedClassRequirementListToJSON, + PaginatedTeamPublicListFromJSON, + PaginatedTeamPublicListToJSON, + PatchedTeamPrivateRequestFromJSON, + PatchedTeamPrivateRequestToJSON, + TeamAvatarRequestFromJSON, + TeamAvatarRequestToJSON, + TeamCreateFromJSON, + TeamCreateToJSON, + TeamCreateRequestFromJSON, + TeamCreateRequestToJSON, + TeamJoinRequestFromJSON, + TeamJoinRequestToJSON, + TeamPrivateFromJSON, + TeamPrivateToJSON, + TeamPrivateRequestFromJSON, + TeamPrivateRequestToJSON, + TeamPublicFromJSON, + TeamPublicToJSON, + TeamReportRequestFromJSON, + TeamReportRequestToJSON, + UserPassedFromJSON, + UserPassedToJSON, +} from '../models'; + +export interface TeamRequirementCheckRetrieveRequest { + episodeId: string; + id: string; +} + +export interface TeamRequirementComputeRetrieveRequest { + episodeId: string; + id: string; +} + +export interface TeamRequirementListRequest { + episodeId: string; + page?: number; +} + +export interface TeamRequirementReportRetrieveRequest { + episodeId: string; +} + +export interface TeamRequirementReportUpdateRequest { + episodeId: string; + teamReportRequest: TeamReportRequest; +} + +export interface TeamRequirementRetrieveRequest { + episodeId: string; + id: string; +} + +export interface TeamTAvatarCreateRequest { + episodeId: string; + teamAvatarRequest: TeamAvatarRequest; +} + +export interface TeamTCreateRequest { + episodeId: string; + teamCreateRequest: TeamCreateRequest; +} + +export interface TeamTJoinCreateRequest { + episodeId: string; + teamJoinRequest: TeamJoinRequest; +} + +export interface TeamTLeaveCreateRequest { + episodeId: string; +} + +export interface TeamTListRequest { + episodeId: string; + ordering?: string; + page?: number; + search?: string; +} + +export interface TeamTMePartialUpdateRequest { + episodeId: string; + patchedTeamPrivateRequest?: PatchedTeamPrivateRequest; +} + +export interface TeamTMeRetrieveRequest { + episodeId: string; +} + +export interface TeamTMeUpdateRequest { + episodeId: string; + teamPrivateRequest?: TeamPrivateRequest; +} + +export interface TeamTRetrieveRequest { + episodeId: string; + id: string; +} + +/** + * + */ +export class TeamApi extends runtime.BaseAPI { + + /** + * A viewset for retrieving and checking class requirements. + */ + async teamRequirementCheckRetrieveRaw(requestParameters: TeamRequirementCheckRetrieveRequest, 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 teamRequirementCheckRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling teamRequirementCheckRetrieve.'); + } + + 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 teamRequirementCheckRetrieve(requestParameters: TeamRequirementCheckRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamRequirementCheckRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async teamRequirementComputeRetrieveRaw(requestParameters: TeamRequirementComputeRetrieveRequest, 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 teamRequirementComputeRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling teamRequirementComputeRetrieve.'); + } + + 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 teamRequirementComputeRetrieve(requestParameters: TeamRequirementComputeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamRequirementComputeRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async teamRequirementListRaw(requestParameters: TeamRequirementListRequest, 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 teamRequirementList.'); + } + + 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 teamRequirementList(requestParameters: TeamRequirementListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamRequirementListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update team strategy report + */ + async teamRequirementReportRetrieveRaw(requestParameters: TeamRequirementReportRetrieveRequest, 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 teamRequirementReportRetrieve.'); + } + + 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 teamRequirementReportRetrieve(requestParameters: TeamRequirementReportRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.teamRequirementReportRetrieveRaw(requestParameters, initOverrides); + } + + /** + * Retrieve or update team strategy report + */ + async teamRequirementReportUpdateRaw(requestParameters: TeamRequirementReportUpdateRequest, 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 teamRequirementReportUpdate.'); + } + + if (requestParameters.teamReportRequest === null || requestParameters.teamReportRequest === undefined) { + throw new runtime.RequiredError('teamReportRequest','Required parameter requestParameters.teamReportRequest was null or undefined when calling teamRequirementReportUpdate.'); + } + + 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: TeamReportRequestToJSON(requestParameters.teamReportRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Retrieve or update team strategy report + */ + async teamRequirementReportUpdate(requestParameters: TeamRequirementReportUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.teamRequirementReportUpdateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and checking class requirements. + */ + async teamRequirementRetrieveRaw(requestParameters: TeamRequirementRetrieveRequest, 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 teamRequirementRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling teamRequirementRetrieve.'); + } + + 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 teamRequirementRetrieve(requestParameters: TeamRequirementRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamRequirementRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update uploaded avatar. + */ + async teamTAvatarCreateRaw(requestParameters: TeamTAvatarCreateRequest, 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 teamTAvatarCreate.'); + } + + if (requestParameters.teamAvatarRequest === null || requestParameters.teamAvatarRequest === undefined) { + throw new runtime.RequiredError('teamAvatarRequest','Required parameter requestParameters.teamAvatarRequest was null or undefined when calling teamTAvatarCreate.'); + } + + 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: TeamAvatarRequestToJSON(requestParameters.teamAvatarRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update uploaded avatar. + */ + async teamTAvatarCreate(requestParameters: TeamTAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.teamTAvatarCreateRaw(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 teamTCreateRaw(requestParameters: TeamTCreateRequest, 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 teamTCreate.'); + } + + if (requestParameters.teamCreateRequest === null || requestParameters.teamCreateRequest === undefined) { + throw new runtime.RequiredError('teamCreateRequest','Required parameter requestParameters.teamCreateRequest was null or undefined when calling teamTCreate.'); + } + + 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: TeamCreateRequestToJSON(requestParameters.teamCreateRequest), + }, 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 teamTCreate(requestParameters: TeamTCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTCreateRaw(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 teamTJoinCreateRaw(requestParameters: TeamTJoinCreateRequest, 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 teamTJoinCreate.'); + } + + if (requestParameters.teamJoinRequest === null || requestParameters.teamJoinRequest === undefined) { + throw new runtime.RequiredError('teamJoinRequest','Required parameter requestParameters.teamJoinRequest was null or undefined when calling teamTJoinCreate.'); + } + + 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: TeamJoinRequestToJSON(requestParameters.teamJoinRequest), + }, 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 teamTJoinCreate(requestParameters: TeamTJoinCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.teamTJoinCreateRaw(requestParameters, initOverrides); + } + + /** + * Leave a team. + */ + async teamTLeaveCreateRaw(requestParameters: TeamTLeaveCreateRequest, 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 teamTLeaveCreate.'); + } + + 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 teamTLeaveCreate(requestParameters: TeamTLeaveCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.teamTLeaveCreateRaw(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 teamTListRaw(requestParameters: TeamTListRequest, 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 teamTList.'); + } + + 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 teamTList(requestParameters: TeamTListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async teamTMePartialUpdateRaw(requestParameters: TeamTMePartialUpdateRequest, 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 teamTMePartialUpdate.'); + } + + 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: PatchedTeamPrivateRequestToJSON(requestParameters.patchedTeamPrivateRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the current team. + */ + async teamTMePartialUpdate(requestParameters: TeamTMePartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTMePartialUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async teamTMeRetrieveRaw(requestParameters: TeamTMeRetrieveRequest, 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 teamTMeRetrieve.'); + } + + 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 teamTMeRetrieve(requestParameters: TeamTMeRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTMeRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the current team. + */ + async teamTMeUpdateRaw(requestParameters: TeamTMeUpdateRequest, 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 teamTMeUpdate.'); + } + + 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: TeamPrivateRequestToJSON(requestParameters.teamPrivateRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TeamPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the current team. + */ + async teamTMeUpdate(requestParameters: TeamTMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTMeUpdateRaw(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 teamTRetrieveRaw(requestParameters: TeamTRetrieveRequest, 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 teamTRetrieve.'); + } + + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling teamTRetrieve.'); + } + + 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 teamTRetrieve(requestParameters: TeamTRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.teamTRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/frontend2/src/utils/types/apis/TokenApi.ts b/frontend2/src/utils/types/apis/TokenApi.ts new file mode 100644 index 000000000..c190e4f21 --- /dev/null +++ b/frontend2/src/utils/types/apis/TokenApi.ts @@ -0,0 +1,152 @@ +/* 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 { + TokenObtainPair, + TokenObtainPairRequest, + TokenRefresh, + TokenRefreshRequest, + TokenVerifyRequest, +} from '../models'; +import { + TokenObtainPairFromJSON, + TokenObtainPairToJSON, + TokenObtainPairRequestFromJSON, + TokenObtainPairRequestToJSON, + TokenRefreshFromJSON, + TokenRefreshToJSON, + TokenRefreshRequestFromJSON, + TokenRefreshRequestToJSON, + TokenVerifyRequestFromJSON, + TokenVerifyRequestToJSON, +} from '../models'; + +export interface TokenCreateRequest { + tokenObtainPairRequest: TokenObtainPairRequest; +} + +export interface TokenRefreshCreateRequest { + tokenRefreshRequest: TokenRefreshRequest; +} + +export interface TokenVerifyCreateRequest { + tokenVerifyRequest: TokenVerifyRequest; +} + +/** + * + */ +export class TokenApi extends runtime.BaseAPI { + + /** + * Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. + */ + async tokenCreateRaw(requestParameters: TokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenObtainPairRequest === null || requestParameters.tokenObtainPairRequest === undefined) { + throw new runtime.RequiredError('tokenObtainPairRequest','Required parameter requestParameters.tokenObtainPairRequest was null or undefined when calling tokenCreate.'); + } + + 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: TokenObtainPairRequestToJSON(requestParameters.tokenObtainPairRequest), + }, 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 tokenCreate(requestParameters: TokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.tokenCreateRaw(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 tokenRefreshCreateRaw(requestParameters: TokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenRefreshRequest === null || requestParameters.tokenRefreshRequest === undefined) { + throw new runtime.RequiredError('tokenRefreshRequest','Required parameter requestParameters.tokenRefreshRequest was null or undefined when calling tokenRefreshCreate.'); + } + + 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: TokenRefreshRequestToJSON(requestParameters.tokenRefreshRequest), + }, 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 tokenRefreshCreate(requestParameters: TokenRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.tokenRefreshCreateRaw(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 tokenVerifyCreateRaw(requestParameters: TokenVerifyCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.tokenVerifyRequest === null || requestParameters.tokenVerifyRequest === undefined) { + throw new runtime.RequiredError('tokenVerifyRequest','Required parameter requestParameters.tokenVerifyRequest was null or undefined when calling tokenVerifyCreate.'); + } + + 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: TokenVerifyRequestToJSON(requestParameters.tokenVerifyRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Takes a token and indicates if it is valid. This view provides no information about a token\'s fitness for a particular use. + */ + async tokenVerifyCreate(requestParameters: TokenVerifyCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.tokenVerifyCreateRaw(requestParameters, initOverrides); + } + +} diff --git a/frontend2/src/utils/types/apis/UserApi.ts b/frontend2/src/utils/types/apis/UserApi.ts new file mode 100644 index 000000000..2f4dd8e2a --- /dev/null +++ b/frontend2/src/utils/types/apis/UserApi.ts @@ -0,0 +1,558 @@ +/* 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 { + Email, + EmailRequest, + PasswordToken, + PasswordTokenRequest, + PatchedUserPrivateRequest, + ResetToken, + ResetTokenRequest, + TeamPublic, + UserAvatarRequest, + UserCreate, + UserCreateRequest, + UserPrivate, + UserPrivateRequest, + UserPublic, + UserResume, + UserResumeRequest, +} from '../models'; +import { + EmailFromJSON, + EmailToJSON, + EmailRequestFromJSON, + EmailRequestToJSON, + PasswordTokenFromJSON, + PasswordTokenToJSON, + PasswordTokenRequestFromJSON, + PasswordTokenRequestToJSON, + PatchedUserPrivateRequestFromJSON, + PatchedUserPrivateRequestToJSON, + ResetTokenFromJSON, + ResetTokenToJSON, + ResetTokenRequestFromJSON, + ResetTokenRequestToJSON, + TeamPublicFromJSON, + TeamPublicToJSON, + UserAvatarRequestFromJSON, + UserAvatarRequestToJSON, + UserCreateFromJSON, + UserCreateToJSON, + UserCreateRequestFromJSON, + UserCreateRequestToJSON, + UserPrivateFromJSON, + UserPrivateToJSON, + UserPrivateRequestFromJSON, + UserPrivateRequestToJSON, + UserPublicFromJSON, + UserPublicToJSON, + UserResumeFromJSON, + UserResumeToJSON, + UserResumeRequestFromJSON, + UserResumeRequestToJSON, +} from '../models'; + +export interface UserPasswordResetConfirmCreateRequest { + passwordTokenRequest: PasswordTokenRequest; +} + +export interface UserPasswordResetCreateRequest { + emailRequest: EmailRequest; +} + +export interface UserPasswordResetValidateTokenCreateRequest { + resetTokenRequest: ResetTokenRequest; +} + +export interface UserUAvatarCreateRequest { + userAvatarRequest: UserAvatarRequest; +} + +export interface UserUCreateRequest { + userCreateRequest: UserCreateRequest; +} + +export interface UserUMePartialUpdateRequest { + patchedUserPrivateRequest?: PatchedUserPrivateRequest; +} + +export interface UserUMeUpdateRequest { + userPrivateRequest: UserPrivateRequest; +} + +export interface UserUResumeUpdateRequest { + userResumeRequest: UserResumeRequest; +} + +export interface UserURetrieveRequest { + id: number; +} + +export interface UserUTeamsRetrieveRequest { + id: number; +} + +/** + * + */ +export class UserApi extends runtime.BaseAPI { + + /** + * An Api View which provides a method to reset a password based on a unique token + */ + async userPasswordResetConfirmCreateRaw(requestParameters: UserPasswordResetConfirmCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.passwordTokenRequest === null || requestParameters.passwordTokenRequest === undefined) { + throw new runtime.RequiredError('passwordTokenRequest','Required parameter requestParameters.passwordTokenRequest was null or undefined when calling userPasswordResetConfirmCreate.'); + } + + 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: PasswordTokenRequestToJSON(requestParameters.passwordTokenRequest), + }, 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 userPasswordResetConfirmCreate(requestParameters: UserPasswordResetConfirmCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userPasswordResetConfirmCreateRaw(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 userPasswordResetCreateRaw(requestParameters: UserPasswordResetCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.emailRequest === null || requestParameters.emailRequest === undefined) { + throw new runtime.RequiredError('emailRequest','Required parameter requestParameters.emailRequest was null or undefined when calling userPasswordResetCreate.'); + } + + 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: EmailRequestToJSON(requestParameters.emailRequest), + }, 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 userPasswordResetCreate(requestParameters: UserPasswordResetCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userPasswordResetCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * An Api View which provides a method to verify that a token is valid + */ + async userPasswordResetValidateTokenCreateRaw(requestParameters: UserPasswordResetValidateTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.resetTokenRequest === null || requestParameters.resetTokenRequest === undefined) { + throw new runtime.RequiredError('resetTokenRequest','Required parameter requestParameters.resetTokenRequest was null or undefined when calling userPasswordResetValidateTokenCreate.'); + } + + 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: ResetTokenRequestToJSON(requestParameters.resetTokenRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ResetTokenFromJSON(jsonValue)); + } + + /** + * An Api View which provides a method to verify that a token is valid + */ + async userPasswordResetValidateTokenCreate(requestParameters: UserPasswordResetValidateTokenCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userPasswordResetValidateTokenCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update uploaded avatar. + */ + async userUAvatarCreateRaw(requestParameters: UserUAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userAvatarRequest === null || requestParameters.userAvatarRequest === undefined) { + throw new runtime.RequiredError('userAvatarRequest','Required parameter requestParameters.userAvatarRequest was null or undefined when calling userUAvatarCreate.'); + } + + 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: UserAvatarRequestToJSON(requestParameters.userAvatarRequest), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Update uploaded avatar. + */ + async userUAvatarCreate(requestParameters: UserUAvatarCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.userUAvatarCreateRaw(requestParameters, initOverrides); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async userUCreateRaw(requestParameters: UserUCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userCreateRequest === null || requestParameters.userCreateRequest === undefined) { + throw new runtime.RequiredError('userCreateRequest','Required parameter requestParameters.userCreateRequest was null or undefined when calling userUCreate.'); + } + + 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: UserCreateRequestToJSON(requestParameters.userCreateRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserCreateFromJSON(jsonValue)); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async userUCreate(requestParameters: UserUCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async userUMePartialUpdateRaw(requestParameters: UserUMePartialUpdateRequest, 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: PatchedUserPrivateRequestToJSON(requestParameters.patchedUserPrivateRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async userUMePartialUpdate(requestParameters: UserUMePartialUpdateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUMePartialUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async userUMeRetrieveRaw(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 userUMeRetrieve(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUMeRetrieveRaw(initOverrides); + return await response.value(); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async userUMeUpdateRaw(requestParameters: UserUMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userPrivateRequest === null || requestParameters.userPrivateRequest === undefined) { + throw new runtime.RequiredError('userPrivateRequest','Required parameter requestParameters.userPrivateRequest was null or undefined when calling userUMeUpdate.'); + } + + 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: UserPrivateRequestToJSON(requestParameters.userPrivateRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserPrivateFromJSON(jsonValue)); + } + + /** + * Retrieve or update information about the logged-in user. + */ + async userUMeUpdate(requestParameters: UserUMeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUMeUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve or update the uploaded resume. + */ + async userUResumeRetrieveRaw(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 userUResumeRetrieve(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUResumeRetrieveRaw(initOverrides); + return await response.value(); + } + + /** + * Retrieve or update the uploaded resume. + */ + async userUResumeUpdateRaw(requestParameters: UserUResumeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userResumeRequest === null || requestParameters.userResumeRequest === undefined) { + throw new runtime.RequiredError('userResumeRequest','Required parameter requestParameters.userResumeRequest was null or undefined when calling userUResumeUpdate.'); + } + + 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: UserResumeRequestToJSON(requestParameters.userResumeRequest), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserResumeFromJSON(jsonValue)); + } + + /** + * Retrieve or update the uploaded resume. + */ + async userUResumeUpdate(requestParameters: UserUResumeUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userUResumeUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * A viewset for retrieving and updating all user info. + */ + async userURetrieveRaw(requestParameters: UserURetrieveRequest, 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 userURetrieve.'); + } + + 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 userURetrieve(requestParameters: UserURetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.userURetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve all teams associated with a user. + */ + async userUTeamsRetrieveRaw(requestParameters: UserUTeamsRetrieveRequest, 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 userUTeamsRetrieve.'); + } + + 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) => runtime.mapValues(jsonValue, TeamPublicFromJSON)); + } + + /** + * Retrieve all teams associated with a user. + */ + async userUTeamsRetrieve(requestParameters: UserUTeamsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: TeamPublic; }> { + const response = await this.userUTeamsRetrieveRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/frontend2/src/utils/types/apis/index.ts b/frontend2/src/utils/types/apis/index.ts new file mode 100644 index 000000000..1dd22d776 --- /dev/null +++ b/frontend2/src/utils/types/apis/index.ts @@ -0,0 +1,8 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './CompeteApi'; +export * from './EpisodeApi'; +export * from './SpecsApi'; +export * from './TeamApi'; +export * from './TokenApi'; +export * from './UserApi'; 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/AutoscrimRequest.ts b/frontend2/src/utils/types/models/AutoscrimRequest.ts new file mode 100644 index 000000000..c8fb33c6a --- /dev/null +++ b/frontend2/src/utils/types/models/AutoscrimRequest.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 AutoscrimRequest + */ +export interface AutoscrimRequest { + /** + * + * @type {number} + * @memberof AutoscrimRequest + */ + best_of: number; +} + +/** + * Check if a given object implements the AutoscrimRequest interface. + */ +export function instanceOfAutoscrimRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "best_of" in value; + + return isInstance; +} + +export function AutoscrimRequestFromJSON(json: any): AutoscrimRequest { + return AutoscrimRequestFromJSONTyped(json, false); +} + +export function AutoscrimRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoscrimRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'best_of': json['best_of'], + }; +} + +export function AutoscrimRequestToJSON(value?: AutoscrimRequest | 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/EmailRequest.ts b/frontend2/src/utils/types/models/EmailRequest.ts new file mode 100644 index 000000000..9c9e039d8 --- /dev/null +++ b/frontend2/src/utils/types/models/EmailRequest.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 EmailRequest + */ +export interface EmailRequest { + /** + * + * @type {string} + * @memberof EmailRequest + */ + email: string; +} + +/** + * Check if a given object implements the EmailRequest interface. + */ +export function instanceOfEmailRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "email" in value; + + return isInstance; +} + +export function EmailRequestFromJSON(json: any): EmailRequest { + return EmailRequestFromJSONTyped(json, false); +} + +export function EmailRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'email': json['email'], + }; +} + +export function EmailRequestToJSON(value?: EmailRequest | 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/GameMap.ts b/frontend2/src/utils/types/models/GameMap.ts new file mode 100644 index 000000000..96b71447d --- /dev/null +++ b/frontend2/src/utils/types/models/GameMap.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 GameMap + */ +export interface GameMap { + /** + * + * @type {number} + * @memberof GameMap + */ + readonly id: number; + /** + * + * @type {string} + * @memberof GameMap + */ + readonly episode: string; + /** + * + * @type {string} + * @memberof GameMap + */ + readonly name: string; + /** + * + * @type {boolean} + * @memberof GameMap + */ + readonly is_public: boolean; +} + +/** + * Check if a given object implements the GameMap interface. + */ +export function instanceOfGameMap(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 GameMapFromJSON(json: any): GameMap { + return GameMapFromJSONTyped(json, false); +} + +export function GameMapFromJSONTyped(json: any, ignoreDiscriminator: boolean): GameMap { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'episode': json['episode'], + 'name': json['name'], + 'is_public': json['is_public'], + }; +} + +export function GameMapToJSON(value?: GameMap | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + 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/MatchReportRequest.ts b/frontend2/src/utils/types/models/MatchReportRequest.ts new file mode 100644 index 000000000..683141a1e --- /dev/null +++ b/frontend2/src/utils/types/models/MatchReportRequest.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 { SaturnInvocationRequest } from './SaturnInvocationRequest'; +import { + SaturnInvocationRequestFromJSON, + SaturnInvocationRequestFromJSONTyped, + SaturnInvocationRequestToJSON, +} from './SaturnInvocationRequest'; + +/** + * + * @export + * @interface MatchReportRequest + */ +export interface MatchReportRequest { + /** + * + * @type {SaturnInvocationRequest} + * @memberof MatchReportRequest + */ + invocation: SaturnInvocationRequest; + /** + * + * @type {Array} + * @memberof MatchReportRequest + */ + scores?: Array; +} + +/** + * Check if a given object implements the MatchReportRequest interface. + */ +export function instanceOfMatchReportRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "invocation" in value; + + return isInstance; +} + +export function MatchReportRequestFromJSON(json: any): MatchReportRequest { + return MatchReportRequestFromJSONTyped(json, false); +} + +export function MatchReportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MatchReportRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'invocation': SaturnInvocationRequestFromJSON(json['invocation']), + 'scores': !exists(json, 'scores') ? undefined : json['scores'], + }; +} + +export function MatchReportRequestToJSON(value?: MatchReportRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'invocation': SaturnInvocationRequestToJSON(value.invocation), + 'scores': value.scores, + }; +} + 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/PasswordTokenRequest.ts b/frontend2/src/utils/types/models/PasswordTokenRequest.ts new file mode 100644 index 000000000..55b43a506 --- /dev/null +++ b/frontend2/src/utils/types/models/PasswordTokenRequest.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 PasswordTokenRequest + */ +export interface PasswordTokenRequest { + /** + * + * @type {string} + * @memberof PasswordTokenRequest + */ + password: string; + /** + * + * @type {string} + * @memberof PasswordTokenRequest + */ + token: string; +} + +/** + * Check if a given object implements the PasswordTokenRequest interface. + */ +export function instanceOfPasswordTokenRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "password" in value; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function PasswordTokenRequestFromJSON(json: any): PasswordTokenRequest { + return PasswordTokenRequestFromJSONTyped(json, false); +} + +export function PasswordTokenRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordTokenRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'password': json['password'], + 'token': json['token'], + }; +} + +export function PasswordTokenRequestToJSON(value?: PasswordTokenRequest | 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/PatchedTeamPrivateRequest.ts b/frontend2/src/utils/types/models/PatchedTeamPrivateRequest.ts new file mode 100644 index 000000000..2ff69cec4 --- /dev/null +++ b/frontend2/src/utils/types/models/PatchedTeamPrivateRequest.ts @@ -0,0 +1,80 @@ +/* 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 { TeamProfilePrivateRequest } from './TeamProfilePrivateRequest'; +import { + TeamProfilePrivateRequestFromJSON, + TeamProfilePrivateRequestFromJSONTyped, + TeamProfilePrivateRequestToJSON, +} from './TeamProfilePrivateRequest'; + +/** + * + * @export + * @interface PatchedTeamPrivateRequest + */ +export interface PatchedTeamPrivateRequest { + /** + * + * @type {TeamProfilePrivateRequest} + * @memberof PatchedTeamPrivateRequest + */ + profile?: TeamProfilePrivateRequest; + /** + * + * @type {string} + * @memberof PatchedTeamPrivateRequest + */ + episode?: string; +} + +/** + * Check if a given object implements the PatchedTeamPrivateRequest interface. + */ +export function instanceOfPatchedTeamPrivateRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PatchedTeamPrivateRequestFromJSON(json: any): PatchedTeamPrivateRequest { + return PatchedTeamPrivateRequestFromJSONTyped(json, false); +} + +export function PatchedTeamPrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedTeamPrivateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateRequestFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + }; +} + +export function PatchedTeamPrivateRequestToJSON(value?: PatchedTeamPrivateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateRequestToJSON(value.profile), + 'episode': value.episode, + }; +} + diff --git a/frontend2/src/utils/types/models/PatchedUserPrivateRequest.ts b/frontend2/src/utils/types/models/PatchedUserPrivateRequest.ts new file mode 100644 index 000000000..47180ee4e --- /dev/null +++ b/frontend2/src/utils/types/models/PatchedUserPrivateRequest.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 { UserProfilePrivateRequest } from './UserProfilePrivateRequest'; +import { + UserProfilePrivateRequestFromJSON, + UserProfilePrivateRequestFromJSONTyped, + UserProfilePrivateRequestToJSON, +} from './UserProfilePrivateRequest'; + +/** + * + * @export + * @interface PatchedUserPrivateRequest + */ +export interface PatchedUserPrivateRequest { + /** + * + * @type {UserProfilePrivateRequest} + * @memberof PatchedUserPrivateRequest + */ + profile?: UserProfilePrivateRequest; + /** + * + * @type {string} + * @memberof PatchedUserPrivateRequest + */ + email?: string; + /** + * + * @type {string} + * @memberof PatchedUserPrivateRequest + */ + first_name?: string; + /** + * + * @type {string} + * @memberof PatchedUserPrivateRequest + */ + last_name?: string; +} + +/** + * Check if a given object implements the PatchedUserPrivateRequest interface. + */ +export function instanceOfPatchedUserPrivateRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function PatchedUserPrivateRequestFromJSON(json: any): PatchedUserPrivateRequest { + return PatchedUserPrivateRequestFromJSONTyped(json, false); +} + +export function PatchedUserPrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedUserPrivateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateRequestFromJSON(json['profile']), + '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'], + }; +} + +export function PatchedUserPrivateRequestToJSON(value?: PatchedUserPrivateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateRequestToJSON(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/ResetTokenRequest.ts b/frontend2/src/utils/types/models/ResetTokenRequest.ts new file mode 100644 index 000000000..3c67f83b3 --- /dev/null +++ b/frontend2/src/utils/types/models/ResetTokenRequest.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 ResetTokenRequest + */ +export interface ResetTokenRequest { + /** + * + * @type {string} + * @memberof ResetTokenRequest + */ + token: string; +} + +/** + * Check if a given object implements the ResetTokenRequest interface. + */ +export function instanceOfResetTokenRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function ResetTokenRequestFromJSON(json: any): ResetTokenRequest { + return ResetTokenRequestFromJSONTyped(json, false); +} + +export function ResetTokenRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResetTokenRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'token': json['token'], + }; +} + +export function ResetTokenRequestToJSON(value?: ResetTokenRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'token': value.token, + }; +} + diff --git a/frontend2/src/utils/types/models/SaturnInvocationRequest.ts b/frontend2/src/utils/types/models/SaturnInvocationRequest.ts new file mode 100644 index 000000000..9095c3d3e --- /dev/null +++ b/frontend2/src/utils/types/models/SaturnInvocationRequest.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 SaturnInvocationRequest + */ +export interface SaturnInvocationRequest { + /** + * + * @type {StatusBccEnum} + * @memberof SaturnInvocationRequest + */ + status: StatusBccEnum; + /** + * + * @type {string} + * @memberof SaturnInvocationRequest + */ + logs?: string; + /** + * + * @type {boolean} + * @memberof SaturnInvocationRequest + */ + interrupted?: boolean; +} + +/** + * Check if a given object implements the SaturnInvocationRequest interface. + */ +export function instanceOfSaturnInvocationRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "status" in value; + + return isInstance; +} + +export function SaturnInvocationRequestFromJSON(json: any): SaturnInvocationRequest { + return SaturnInvocationRequestFromJSONTyped(json, false); +} + +export function SaturnInvocationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SaturnInvocationRequest { + 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 SaturnInvocationRequestToJSON(value?: SaturnInvocationRequest | 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..19b0161c3 --- /dev/null +++ b/frontend2/src/utils/types/models/ScrimmageRequest.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 { PlayerOrderEnum } from './PlayerOrderEnum'; +import { + PlayerOrderEnumFromJSON, + PlayerOrderEnumFromJSONTyped, + PlayerOrderEnumToJSON, +} from './PlayerOrderEnum'; +import type { ScrimmageStatusEnum } from './ScrimmageStatusEnum'; +import { + ScrimmageStatusEnumFromJSON, + ScrimmageStatusEnumFromJSONTyped, + ScrimmageStatusEnumToJSON, +} from './ScrimmageStatusEnum'; + +/** + * + * @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 {ScrimmageStatusEnum} + * @memberof ScrimmageRequest + */ + readonly status: ScrimmageStatusEnum; + /** + * + * @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; +} + +/** + * 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; + + 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': ScrimmageStatusEnumFromJSON(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'], + }; +} + +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), + }; +} + diff --git a/frontend2/src/utils/types/models/ScrimmageRequestRequest.ts b/frontend2/src/utils/types/models/ScrimmageRequestRequest.ts new file mode 100644 index 000000000..583ff1136 --- /dev/null +++ b/frontend2/src/utils/types/models/ScrimmageRequestRequest.ts @@ -0,0 +1,100 @@ +/* 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'; + +/** + * + * @export + * @interface ScrimmageRequestRequest + */ +export interface ScrimmageRequestRequest { + /** + * + * @type {boolean} + * @memberof ScrimmageRequestRequest + */ + is_ranked: boolean; + /** + * + * @type {number} + * @memberof ScrimmageRequestRequest + */ + requested_to: number; + /** + * + * @type {PlayerOrderEnum} + * @memberof ScrimmageRequestRequest + */ + player_order: PlayerOrderEnum; + /** + * + * @type {Array} + * @memberof ScrimmageRequestRequest + */ + map_names: Array; +} + +/** + * Check if a given object implements the ScrimmageRequestRequest interface. + */ +export function instanceOfScrimmageRequestRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "is_ranked" in value; + isInstance = isInstance && "requested_to" in value; + isInstance = isInstance && "player_order" in value; + isInstance = isInstance && "map_names" in value; + + return isInstance; +} + +export function ScrimmageRequestRequestFromJSON(json: any): ScrimmageRequestRequest { + return ScrimmageRequestRequestFromJSONTyped(json, false); +} + +export function ScrimmageRequestRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScrimmageRequestRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'is_ranked': json['is_ranked'], + 'requested_to': json['requested_to'], + 'player_order': PlayerOrderEnumFromJSON(json['player_order']), + 'map_names': json['map_names'], + }; +} + +export function ScrimmageRequestRequestToJSON(value?: ScrimmageRequestRequest | 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/ScrimmageStatusEnum.ts b/frontend2/src/utils/types/models/ScrimmageStatusEnum.ts new file mode 100644 index 000000000..04eb6fd7b --- /dev/null +++ b/frontend2/src/utils/types/models/ScrimmageStatusEnum.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 ScrimmageStatusEnum { + P = 'P', + Y = 'Y', + N = 'N' +} + + +export function ScrimmageStatusEnumFromJSON(json: any): ScrimmageStatusEnum { + return ScrimmageStatusEnumFromJSONTyped(json, false); +} + +export function ScrimmageStatusEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScrimmageStatusEnum { + return json as ScrimmageStatusEnum; +} + +export function ScrimmageStatusEnumToJSON(value?: ScrimmageStatusEnum | 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..d61410819 --- /dev/null +++ b/frontend2/src/utils/types/models/Submission.ts @@ -0,0 +1,160 @@ +/* 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; +} + +/** + * 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; + + 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'], + }; +} + +export function SubmissionToJSON(value?: Submission | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'package': value._package, + 'description': value.description, + }; +} + 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/SubmissionReportRequest.ts b/frontend2/src/utils/types/models/SubmissionReportRequest.ts new file mode 100644 index 000000000..1759f25fb --- /dev/null +++ b/frontend2/src/utils/types/models/SubmissionReportRequest.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 { SaturnInvocationRequest } from './SaturnInvocationRequest'; +import { + SaturnInvocationRequestFromJSON, + SaturnInvocationRequestFromJSONTyped, + SaturnInvocationRequestToJSON, +} from './SaturnInvocationRequest'; + +/** + * + * @export + * @interface SubmissionReportRequest + */ +export interface SubmissionReportRequest { + /** + * + * @type {SaturnInvocationRequest} + * @memberof SubmissionReportRequest + */ + invocation: SaturnInvocationRequest; + /** + * + * @type {boolean} + * @memberof SubmissionReportRequest + */ + accepted?: boolean; +} + +/** + * Check if a given object implements the SubmissionReportRequest interface. + */ +export function instanceOfSubmissionReportRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "invocation" in value; + + return isInstance; +} + +export function SubmissionReportRequestFromJSON(json: any): SubmissionReportRequest { + return SubmissionReportRequestFromJSONTyped(json, false); +} + +export function SubmissionReportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionReportRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'invocation': SaturnInvocationRequestFromJSON(json['invocation']), + 'accepted': !exists(json, 'accepted') ? undefined : json['accepted'], + }; +} + +export function SubmissionReportRequestToJSON(value?: SubmissionReportRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'invocation': SaturnInvocationRequestToJSON(value.invocation), + 'accepted': value.accepted, + }; +} + diff --git a/frontend2/src/utils/types/models/SubmissionRequest.ts b/frontend2/src/utils/types/models/SubmissionRequest.ts new file mode 100644 index 000000000..e73345527 --- /dev/null +++ b/frontend2/src/utils/types/models/SubmissionRequest.ts @@ -0,0 +1,82 @@ +/* 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 SubmissionRequest + */ +export interface SubmissionRequest { + /** + * + * @type {string} + * @memberof SubmissionRequest + */ + _package?: string; + /** + * + * @type {string} + * @memberof SubmissionRequest + */ + description?: string; + /** + * + * @type {Blob} + * @memberof SubmissionRequest + */ + source_code: Blob; +} + +/** + * Check if a given object implements the SubmissionRequest interface. + */ +export function instanceOfSubmissionRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "source_code" in value; + + return isInstance; +} + +export function SubmissionRequestFromJSON(json: any): SubmissionRequest { + return SubmissionRequestFromJSONTyped(json, false); +} + +export function SubmissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + '_package': !exists(json, 'package') ? undefined : json['package'], + 'description': !exists(json, 'description') ? undefined : json['description'], + 'source_code': json['source_code'], + }; +} + +export function SubmissionRequestToJSON(value?: SubmissionRequest | 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/TeamAvatarRequest.ts b/frontend2/src/utils/types/models/TeamAvatarRequest.ts new file mode 100644 index 000000000..34b25ad73 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamAvatarRequest.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 TeamAvatarRequest + */ +export interface TeamAvatarRequest { + /** + * + * @type {Blob} + * @memberof TeamAvatarRequest + */ + avatar: Blob; +} + +/** + * Check if a given object implements the TeamAvatarRequest interface. + */ +export function instanceOfTeamAvatarRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "avatar" in value; + + return isInstance; +} + +export function TeamAvatarRequestFromJSON(json: any): TeamAvatarRequest { + return TeamAvatarRequestFromJSONTyped(json, false); +} + +export function TeamAvatarRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamAvatarRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'avatar': json['avatar'], + }; +} + +export function TeamAvatarRequestToJSON(value?: TeamAvatarRequest | 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/TeamCreateRequest.ts b/frontend2/src/utils/types/models/TeamCreateRequest.ts new file mode 100644 index 000000000..e34df8a47 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamCreateRequest.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 { TeamProfilePrivateRequest } from './TeamProfilePrivateRequest'; +import { + TeamProfilePrivateRequestFromJSON, + TeamProfilePrivateRequestFromJSONTyped, + TeamProfilePrivateRequestToJSON, +} from './TeamProfilePrivateRequest'; + +/** + * + * @export + * @interface TeamCreateRequest + */ +export interface TeamCreateRequest { + /** + * + * @type {TeamProfilePrivateRequest} + * @memberof TeamCreateRequest + */ + profile?: TeamProfilePrivateRequest; + /** + * + * @type {string} + * @memberof TeamCreateRequest + */ + episode?: string; + /** + * + * @type {string} + * @memberof TeamCreateRequest + */ + name: string; +} + +/** + * Check if a given object implements the TeamCreateRequest interface. + */ +export function instanceOfTeamCreateRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function TeamCreateRequestFromJSON(json: any): TeamCreateRequest { + return TeamCreateRequestFromJSONTyped(json, false); +} + +export function TeamCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamCreateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateRequestFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + 'name': json['name'], + }; +} + +export function TeamCreateRequestToJSON(value?: TeamCreateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateRequestToJSON(value.profile), + 'episode': value.episode, + 'name': value.name, + }; +} + diff --git a/frontend2/src/utils/types/models/TeamJoinRequest.ts b/frontend2/src/utils/types/models/TeamJoinRequest.ts new file mode 100644 index 000000000..9afd02d27 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamJoinRequest.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 TeamJoinRequest + */ +export interface TeamJoinRequest { + /** + * + * @type {string} + * @memberof TeamJoinRequest + */ + join_key: string; + /** + * + * @type {string} + * @memberof TeamJoinRequest + */ + name: string; +} + +/** + * Check if a given object implements the TeamJoinRequest interface. + */ +export function instanceOfTeamJoinRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "join_key" in value; + isInstance = isInstance && "name" in value; + + return isInstance; +} + +export function TeamJoinRequestFromJSON(json: any): TeamJoinRequest { + return TeamJoinRequestFromJSONTyped(json, false); +} + +export function TeamJoinRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamJoinRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'join_key': json['join_key'], + 'name': json['name'], + }; +} + +export function TeamJoinRequestToJSON(value?: TeamJoinRequest | 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/TeamPrivateRequest.ts b/frontend2/src/utils/types/models/TeamPrivateRequest.ts new file mode 100644 index 000000000..845e0748d --- /dev/null +++ b/frontend2/src/utils/types/models/TeamPrivateRequest.ts @@ -0,0 +1,80 @@ +/* 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 { TeamProfilePrivateRequest } from './TeamProfilePrivateRequest'; +import { + TeamProfilePrivateRequestFromJSON, + TeamProfilePrivateRequestFromJSONTyped, + TeamProfilePrivateRequestToJSON, +} from './TeamProfilePrivateRequest'; + +/** + * + * @export + * @interface TeamPrivateRequest + */ +export interface TeamPrivateRequest { + /** + * + * @type {TeamProfilePrivateRequest} + * @memberof TeamPrivateRequest + */ + profile?: TeamProfilePrivateRequest; + /** + * + * @type {string} + * @memberof TeamPrivateRequest + */ + episode?: string; +} + +/** + * Check if a given object implements the TeamPrivateRequest interface. + */ +export function instanceOfTeamPrivateRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TeamPrivateRequestFromJSON(json: any): TeamPrivateRequest { + return TeamPrivateRequestFromJSONTyped(json, false); +} + +export function TeamPrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamPrivateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : TeamProfilePrivateRequestFromJSON(json['profile']), + 'episode': !exists(json, 'episode') ? undefined : json['episode'], + }; +} + +export function TeamPrivateRequestToJSON(value?: TeamPrivateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': TeamProfilePrivateRequestToJSON(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/TeamProfilePrivateRequest.ts b/frontend2/src/utils/types/models/TeamProfilePrivateRequest.ts new file mode 100644 index 000000000..da1a26b61 --- /dev/null +++ b/frontend2/src/utils/types/models/TeamProfilePrivateRequest.ts @@ -0,0 +1,105 @@ +/* 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 TeamProfilePrivateRequest + */ +export interface TeamProfilePrivateRequest { + /** + * + * @type {string} + * @memberof TeamProfilePrivateRequest + */ + quote?: string; + /** + * + * @type {string} + * @memberof TeamProfilePrivateRequest + */ + biography?: string; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivateRequest + */ + has_report?: boolean; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivateRequest + */ + auto_accept_ranked?: boolean; + /** + * + * @type {boolean} + * @memberof TeamProfilePrivateRequest + */ + auto_accept_unranked?: boolean; + /** + * + * @type {Array} + * @memberof TeamProfilePrivateRequest + */ + eligible_for?: Array; +} + +/** + * Check if a given object implements the TeamProfilePrivateRequest interface. + */ +export function instanceOfTeamProfilePrivateRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function TeamProfilePrivateRequestFromJSON(json: any): TeamProfilePrivateRequest { + return TeamProfilePrivateRequestFromJSONTyped(json, false); +} + +export function TeamProfilePrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamProfilePrivateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'quote': !exists(json, 'quote') ? undefined : json['quote'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + 'has_report': !exists(json, 'has_report') ? undefined : json['has_report'], + '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 TeamProfilePrivateRequestToJSON(value?: TeamProfilePrivateRequest | 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/TeamReportRequest.ts b/frontend2/src/utils/types/models/TeamReportRequest.ts new file mode 100644 index 000000000..5bd60f38e --- /dev/null +++ b/frontend2/src/utils/types/models/TeamReportRequest.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 TeamReportRequest + */ +export interface TeamReportRequest { + /** + * + * @type {Blob} + * @memberof TeamReportRequest + */ + report: Blob; +} + +/** + * Check if a given object implements the TeamReportRequest interface. + */ +export function instanceOfTeamReportRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "report" in value; + + return isInstance; +} + +export function TeamReportRequestFromJSON(json: any): TeamReportRequest { + return TeamReportRequestFromJSONTyped(json, false); +} + +export function TeamReportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TeamReportRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'report': json['report'], + }; +} + +export function TeamReportRequestToJSON(value?: TeamReportRequest | 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..a86a966b0 --- /dev/null +++ b/frontend2/src/utils/types/models/TokenObtainPair.ts @@ -0,0 +1,73 @@ +/* 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 + */ + 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 && "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 { + + 'access': json['access'], + 'refresh': json['refresh'], + }; +} + +export function TokenObtainPairToJSON(value?: TokenObtainPair | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/TokenObtainPairRequest.ts b/frontend2/src/utils/types/models/TokenObtainPairRequest.ts new file mode 100644 index 000000000..a872aa54d --- /dev/null +++ b/frontend2/src/utils/types/models/TokenObtainPairRequest.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 TokenObtainPairRequest + */ +export interface TokenObtainPairRequest { + /** + * + * @type {string} + * @memberof TokenObtainPairRequest + */ + username: string; + /** + * + * @type {string} + * @memberof TokenObtainPairRequest + */ + password: string; +} + +/** + * Check if a given object implements the TokenObtainPairRequest interface. + */ +export function instanceOfTokenObtainPairRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "username" in value; + isInstance = isInstance && "password" in value; + + return isInstance; +} + +export function TokenObtainPairRequestFromJSON(json: any): TokenObtainPairRequest { + return TokenObtainPairRequestFromJSONTyped(json, false); +} + +export function TokenObtainPairRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenObtainPairRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'username': json['username'], + 'password': json['password'], + }; +} + +export function TokenObtainPairRequestToJSON(value?: TokenObtainPairRequest | 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..c5d688eb2 --- /dev/null +++ b/frontend2/src/utils/types/models/TokenRefresh.ts @@ -0,0 +1,65 @@ +/* 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; +} + +/** + * Check if a given object implements the TokenRefresh interface. + */ +export function instanceOfTokenRefresh(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "access" 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'], + }; +} + +export function TokenRefreshToJSON(value?: TokenRefresh | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/TokenRefreshRequest.ts b/frontend2/src/utils/types/models/TokenRefreshRequest.ts new file mode 100644 index 000000000..e171b65ee --- /dev/null +++ b/frontend2/src/utils/types/models/TokenRefreshRequest.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 TokenRefreshRequest + */ +export interface TokenRefreshRequest { + /** + * + * @type {string} + * @memberof TokenRefreshRequest + */ + refresh: string; +} + +/** + * Check if a given object implements the TokenRefreshRequest interface. + */ +export function instanceOfTokenRefreshRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "refresh" in value; + + return isInstance; +} + +export function TokenRefreshRequestFromJSON(json: any): TokenRefreshRequest { + return TokenRefreshRequestFromJSONTyped(json, false); +} + +export function TokenRefreshRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenRefreshRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'refresh': json['refresh'], + }; +} + +export function TokenRefreshRequestToJSON(value?: TokenRefreshRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'refresh': value.refresh, + }; +} + diff --git a/frontend2/src/utils/types/models/TokenVerifyRequest.ts b/frontend2/src/utils/types/models/TokenVerifyRequest.ts new file mode 100644 index 000000000..b204aa9e0 --- /dev/null +++ b/frontend2/src/utils/types/models/TokenVerifyRequest.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 TokenVerifyRequest + */ +export interface TokenVerifyRequest { + /** + * + * @type {string} + * @memberof TokenVerifyRequest + */ + token: string; +} + +/** + * Check if a given object implements the TokenVerifyRequest interface. + */ +export function instanceOfTokenVerifyRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "token" in value; + + return isInstance; +} + +export function TokenVerifyRequestFromJSON(json: any): TokenVerifyRequest { + return TokenVerifyRequestFromJSONTyped(json, false); +} + +export function TokenVerifyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenVerifyRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'token': json['token'], + }; +} + +export function TokenVerifyRequestToJSON(value?: TokenVerifyRequest | 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..0a8d04fc3 --- /dev/null +++ b/frontend2/src/utils/types/models/TournamentSubmission.ts @@ -0,0 +1,168 @@ +/* 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 + */ + 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 && "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'], + 'tournament': json['tournament'], + }; +} + +export function TournamentSubmissionToJSON(value?: TournamentSubmission | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + }; +} + diff --git a/frontend2/src/utils/types/models/UserAvatarRequest.ts b/frontend2/src/utils/types/models/UserAvatarRequest.ts new file mode 100644 index 000000000..78f412142 --- /dev/null +++ b/frontend2/src/utils/types/models/UserAvatarRequest.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 UserAvatarRequest + */ +export interface UserAvatarRequest { + /** + * + * @type {Blob} + * @memberof UserAvatarRequest + */ + avatar: Blob; +} + +/** + * Check if a given object implements the UserAvatarRequest interface. + */ +export function instanceOfUserAvatarRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "avatar" in value; + + return isInstance; +} + +export function UserAvatarRequestFromJSON(json: any): UserAvatarRequest { + return UserAvatarRequestFromJSONTyped(json, false); +} + +export function UserAvatarRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserAvatarRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'avatar': json['avatar'], + }; +} + +export function UserAvatarRequestToJSON(value?: UserAvatarRequest | 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..4a39682de --- /dev/null +++ b/frontend2/src/utils/types/models/UserCreate.ts @@ -0,0 +1,124 @@ +/* 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 + */ + 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 && "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'], + '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, + 'email': value.email, + 'first_name': value.first_name, + 'last_name': value.last_name, + }; +} + diff --git a/frontend2/src/utils/types/models/UserCreateRequest.ts b/frontend2/src/utils/types/models/UserCreateRequest.ts new file mode 100644 index 000000000..b7b7a995d --- /dev/null +++ b/frontend2/src/utils/types/models/UserCreateRequest.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 { UserProfilePrivateRequest } from './UserProfilePrivateRequest'; +import { + UserProfilePrivateRequestFromJSON, + UserProfilePrivateRequestFromJSONTyped, + UserProfilePrivateRequestToJSON, +} from './UserProfilePrivateRequest'; + +/** + * + * @export + * @interface UserCreateRequest + */ +export interface UserCreateRequest { + /** + * + * @type {UserProfilePrivateRequest} + * @memberof UserCreateRequest + */ + profile?: UserProfilePrivateRequest; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof UserCreateRequest + */ + username: string; + /** + * + * @type {string} + * @memberof UserCreateRequest + */ + password: string; + /** + * + * @type {string} + * @memberof UserCreateRequest + */ + email: string; + /** + * + * @type {string} + * @memberof UserCreateRequest + */ + first_name: string; + /** + * + * @type {string} + * @memberof UserCreateRequest + */ + last_name: string; +} + +/** + * Check if a given object implements the UserCreateRequest interface. + */ +export function instanceOfUserCreateRequest(value: object): boolean { + let isInstance = true; + 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; + + return isInstance; +} + +export function UserCreateRequestFromJSON(json: any): UserCreateRequest { + return UserCreateRequestFromJSONTyped(json, false); +} + +export function UserCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCreateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateRequestFromJSON(json['profile']), + 'username': json['username'], + 'password': json['password'], + 'email': json['email'], + 'first_name': json['first_name'], + 'last_name': json['last_name'], + }; +} + +export function UserCreateRequestToJSON(value?: UserCreateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateRequestToJSON(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/UserPrivateRequest.ts b/frontend2/src/utils/types/models/UserPrivateRequest.ts new file mode 100644 index 000000000..b65dd4f9a --- /dev/null +++ b/frontend2/src/utils/types/models/UserPrivateRequest.ts @@ -0,0 +1,99 @@ +/* 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 { UserProfilePrivateRequest } from './UserProfilePrivateRequest'; +import { + UserProfilePrivateRequestFromJSON, + UserProfilePrivateRequestFromJSONTyped, + UserProfilePrivateRequestToJSON, +} from './UserProfilePrivateRequest'; + +/** + * + * @export + * @interface UserPrivateRequest + */ +export interface UserPrivateRequest { + /** + * + * @type {UserProfilePrivateRequest} + * @memberof UserPrivateRequest + */ + profile?: UserProfilePrivateRequest; + /** + * + * @type {string} + * @memberof UserPrivateRequest + */ + email: string; + /** + * + * @type {string} + * @memberof UserPrivateRequest + */ + first_name: string; + /** + * + * @type {string} + * @memberof UserPrivateRequest + */ + last_name: string; +} + +/** + * Check if a given object implements the UserPrivateRequest interface. + */ +export function instanceOfUserPrivateRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "email" in value; + isInstance = isInstance && "first_name" in value; + isInstance = isInstance && "last_name" in value; + + return isInstance; +} + +export function UserPrivateRequestFromJSON(json: any): UserPrivateRequest { + return UserPrivateRequestFromJSONTyped(json, false); +} + +export function UserPrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPrivateRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : UserProfilePrivateRequestFromJSON(json['profile']), + 'email': json['email'], + 'first_name': json['first_name'], + 'last_name': json['last_name'], + }; +} + +export function UserPrivateRequestToJSON(value?: UserPrivateRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePrivateRequestToJSON(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/UserProfilePrivateRequest.ts b/frontend2/src/utils/types/models/UserProfilePrivateRequest.ts new file mode 100644 index 000000000..3cffe1073 --- /dev/null +++ b/frontend2/src/utils/types/models/UserProfilePrivateRequest.ts @@ -0,0 +1,120 @@ +/* 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 UserProfilePrivateRequest + */ +export interface UserProfilePrivateRequest { + /** + * + * @type {GenderEnum} + * @memberof UserProfilePrivateRequest + */ + gender: GenderEnum; + /** + * + * @type {string} + * @memberof UserProfilePrivateRequest + */ + gender_details?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivateRequest + */ + school?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivateRequest + */ + biography?: string; + /** + * + * @type {string} + * @memberof UserProfilePrivateRequest + */ + kerberos?: string; + /** + * + * @type {CountryEnum} + * @memberof UserProfilePrivateRequest + */ + country: CountryEnum; +} + +/** + * Check if a given object implements the UserProfilePrivateRequest interface. + */ +export function instanceOfUserProfilePrivateRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "gender" in value; + isInstance = isInstance && "country" in value; + + return isInstance; +} + +export function UserProfilePrivateRequestFromJSON(json: any): UserProfilePrivateRequest { + return UserProfilePrivateRequestFromJSONTyped(json, false); +} + +export function UserProfilePrivateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserProfilePrivateRequest { + 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'], + 'country': CountryEnumFromJSON(json['country']), + }; +} + +export function UserProfilePrivateRequestToJSON(value?: UserProfilePrivateRequest | 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/UserProfilePublicRequest.ts b/frontend2/src/utils/types/models/UserProfilePublicRequest.ts new file mode 100644 index 000000000..782702085 --- /dev/null +++ b/frontend2/src/utils/types/models/UserProfilePublicRequest.ts @@ -0,0 +1,73 @@ +/* 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 UserProfilePublicRequest + */ +export interface UserProfilePublicRequest { + /** + * + * @type {string} + * @memberof UserProfilePublicRequest + */ + school?: string; + /** + * + * @type {string} + * @memberof UserProfilePublicRequest + */ + biography?: string; +} + +/** + * Check if a given object implements the UserProfilePublicRequest interface. + */ +export function instanceOfUserProfilePublicRequest(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function UserProfilePublicRequestFromJSON(json: any): UserProfilePublicRequest { + return UserProfilePublicRequestFromJSONTyped(json, false); +} + +export function UserProfilePublicRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserProfilePublicRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'school': !exists(json, 'school') ? undefined : json['school'], + 'biography': !exists(json, 'biography') ? undefined : json['biography'], + }; +} + +export function UserProfilePublicRequestToJSON(value?: UserProfilePublicRequest | 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/UserPublicRequest.ts b/frontend2/src/utils/types/models/UserPublicRequest.ts new file mode 100644 index 000000000..4300a4afb --- /dev/null +++ b/frontend2/src/utils/types/models/UserPublicRequest.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 { UserProfilePublicRequest } from './UserProfilePublicRequest'; +import { + UserProfilePublicRequestFromJSON, + UserProfilePublicRequestFromJSONTyped, + UserProfilePublicRequestToJSON, +} from './UserProfilePublicRequest'; + +/** + * + * @export + * @interface UserPublicRequest + */ +export interface UserPublicRequest { + /** + * + * @type {UserProfilePublicRequest} + * @memberof UserPublicRequest + */ + profile?: UserProfilePublicRequest; + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof UserPublicRequest + */ + username: string; +} + +/** + * Check if a given object implements the UserPublicRequest interface. + */ +export function instanceOfUserPublicRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "username" in value; + + return isInstance; +} + +export function UserPublicRequestFromJSON(json: any): UserPublicRequest { + return UserPublicRequestFromJSONTyped(json, false); +} + +export function UserPublicRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPublicRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'profile': !exists(json, 'profile') ? undefined : UserProfilePublicRequestFromJSON(json['profile']), + 'username': json['username'], + }; +} + +export function UserPublicRequestToJSON(value?: UserPublicRequest | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'profile': UserProfilePublicRequestToJSON(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..e119e173a --- /dev/null +++ b/frontend2/src/utils/types/models/UserResume.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 UserResume + */ +export interface UserResume { + /** + * + * @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 && "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 { + + '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 { + + }; +} + diff --git a/frontend2/src/utils/types/models/UserResumeRequest.ts b/frontend2/src/utils/types/models/UserResumeRequest.ts new file mode 100644 index 000000000..a27268b56 --- /dev/null +++ b/frontend2/src/utils/types/models/UserResumeRequest.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 UserResumeRequest + */ +export interface UserResumeRequest { + /** + * + * @type {Blob} + * @memberof UserResumeRequest + */ + resume: Blob; +} + +/** + * Check if a given object implements the UserResumeRequest interface. + */ +export function instanceOfUserResumeRequest(value: object): boolean { + let isInstance = true; + isInstance = isInstance && "resume" in value; + + return isInstance; +} + +export function UserResumeRequestFromJSON(json: any): UserResumeRequest { + return UserResumeRequestFromJSONTyped(json, false); +} + +export function UserResumeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResumeRequest { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'resume': json['resume'], + }; +} + +export function UserResumeRequestToJSON(value?: UserResumeRequest | 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 57% rename from frontend2/src/utils/types/model/models.ts rename to frontend2/src/utils/types/models/index.ts index 3c401c30e..0adfd3f5e 100644 --- a/frontend2/src/utils/types/model/models.ts +++ b/frontend2/src/utils/types/models/index.ts @@ -1,16 +1,19 @@ -export * from './Autoscrim'; +/* tslint:disable */ +/* eslint-disable */ +export * from './AutoscrimRequest'; export * from './ClassRequirement'; export * from './CountryEnum'; export * from './EligibilityCriterion'; export * from './Email'; +export * from './EmailRequest'; export * from './Episode'; +export * from './GameMap'; export * from './GenderEnum'; export * from './HistoricalRating'; export * from './LanguageEnum'; export * from './Match'; export * from './MatchParticipant'; -export * from './MatchReport'; -export * from './ModelMap'; +export * from './MatchReportRequest'; export * from './PaginatedClassRequirementList'; export * from './PaginatedEpisodeList'; export * from './PaginatedMatchList'; @@ -20,39 +23,54 @@ export * from './PaginatedTeamPublicList'; export * from './PaginatedTournamentList'; export * from './PaginatedTournamentRoundList'; export * from './PasswordToken'; -export * from './PatchedTeamPrivate'; -export * from './PatchedUserPrivate'; +export * from './PasswordTokenRequest'; +export * from './PatchedTeamPrivateRequest'; +export * from './PatchedUserPrivateRequest'; export * from './PlayerOrderEnum'; export * from './ReleaseStatusEnum'; export * from './ResetToken'; -export * from './SaturnInvocation'; +export * from './ResetTokenRequest'; +export * from './SaturnInvocationRequest'; export * from './ScrimmageRequest'; -export * from './ScrimmageRequestStatusEnum'; +export * from './ScrimmageRequestRequest'; +export * from './ScrimmageStatusEnum'; export * from './Status526Enum'; export * from './StatusBccEnum'; export * from './StyleEnum'; export * from './Submission'; export * from './SubmissionDownload'; -export * from './SubmissionReport'; -export * from './TeamAvatar'; +export * from './SubmissionReportRequest'; +export * from './SubmissionRequest'; +export * from './TeamAvatarRequest'; export * from './TeamCreate'; -export * from './TeamJoin'; +export * from './TeamCreateRequest'; +export * from './TeamJoinRequest'; export * from './TeamPrivate'; +export * from './TeamPrivateRequest'; export * from './TeamProfilePrivate'; +export * from './TeamProfilePrivateRequest'; export * from './TeamProfilePublic'; export * from './TeamPublic'; -export * from './TeamReport'; +export * from './TeamReportRequest'; export * from './TokenObtainPair'; +export * from './TokenObtainPairRequest'; export * from './TokenRefresh'; -export * from './TokenVerify'; +export * from './TokenRefreshRequest'; +export * from './TokenVerifyRequest'; export * from './Tournament'; export * from './TournamentRound'; export * from './TournamentSubmission'; -export * from './UserAvatar'; +export * from './UserAvatarRequest'; export * from './UserCreate'; +export * from './UserCreateRequest'; export * from './UserPassed'; export * from './UserPrivate'; +export * from './UserPrivateRequest'; export * from './UserProfilePrivate'; +export * from './UserProfilePrivateRequest'; export * from './UserProfilePublic'; +export * from './UserProfilePublicRequest'; export * from './UserPublic'; +export * from './UserPublicRequest'; export * from './UserResume'; +export * from './UserResumeRequest'; 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 65546cc8f..bcd9d3777 100644 --- a/frontend2/src/views/Rankings.tsx +++ b/frontend2/src/views/Rankings.tsx @@ -1,12 +1,12 @@ 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"; import Button from "../components/elements/Button"; +import { searchTeams } from "../utils/api/team"; function trimString(str: string, maxLength: number): string { if (str.length > maxLength) { @@ -48,12 +48,7 @@ const Rankings: React.FC = () => { const search = async (): Promise => { try { - const result = await Api.searchTeams( - episodeId, - searchQuery, - false, - page, - ); + const result = await searchTeams(episodeId, searchQuery, false, page); setData(result); setLoading(false); } catch (err) { @@ -147,23 +142,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", }, diff --git a/frontend2/src/views/Register.tsx b/frontend2/src/views/Register.tsx index e2865294e..0acf558f4 100644 --- a/frontend2/src/views/Register.tsx +++ b/frontend2/src/views/Register.tsx @@ -1,17 +1,17 @@ import React, { useState } from "react"; -import * as Auth from "../utils/auth"; +import { createUser } from "../utils/api/user"; import Input from "../components/elements/Input"; import Button from "../components/elements/Button"; import { type SubmitHandler, useForm } from "react-hook-form"; import { useCurrentUser } from "../contexts/CurrentUserContext"; -import { - GenderEnum, - type Country, - type CreateUserInput, - COUNTRIES, -} from "../utils/apiTypes"; +import { COUNTRIES } from "../utils/apiTypes"; import SelectMenu from "../components/elements/SelectMenu"; import { type Maybe } from "../utils/utilTypes"; +import { + GenderEnum, + type CountryEnum, + type UserCreateRequest, +} from "../utils/types"; const REQUIRED_ERROR_MSG = "This field is required."; @@ -24,17 +24,17 @@ const Register: React.FC = () => { setError, clearErrors, formState: { errors }, - } = useForm(); + } = useForm(); const [gender, setGender] = useState>(); - const [country, setCountry] = useState>(); + const [country, setCountry] = useState>(); const [formError, setFormError] = useState>(); - const onSubmit: SubmitHandler = async (data) => { + const onSubmit: SubmitHandler = async (data) => { if (gender === undefined || country === undefined) { return; } try { - const newUser = await Auth.register(data); + const newUser = await createUser(data); login(newUser); setFormError(undefined); } catch { @@ -95,21 +95,21 @@ const Register: React.FC = () => { required placeholder="Tim" label="First name" - errorMessage={errors.firstName?.message} - {...register("firstName", { required: REQUIRED_ERROR_MSG })} + errorMessage={errors.first_name?.message} + {...register("first_name", { required: REQUIRED_ERROR_MSG })} /> {/* begin profile fields */}
- + required onChange={(newCountry) => { setCountry(newCountry); @@ -121,7 +121,7 @@ const Register: React.FC = () => { label="Country" placeholder="Select country" options={Object.entries(COUNTRIES).map(([code, name]) => ({ - value: code as Country, + value: code as CountryEnum, label: name, }))} /> @@ -144,20 +144,20 @@ const Register: React.FC = () => { label="Gender identity" placeholder="Select gender" options={[ - { value: GenderEnum.FEMALE, label: "Female" }, - { value: GenderEnum.MALE, label: "Male" }, - { value: GenderEnum.NONBINARY, label: "Non-binary" }, + { value: GenderEnum.F, label: "Female" }, + { value: GenderEnum.M, label: "Male" }, + { value: GenderEnum.N, label: "Non-binary" }, { - value: GenderEnum.SELF_DESCRIBED, + value: GenderEnum.Star, label: "Prefer to self describe", }, - { value: GenderEnum.RATHER_NOT_SAY, label: "Rather not say" }, + { value: GenderEnum.QuestionMark, label: "Rather not say" }, ]} /> - {gender === GenderEnum.SELF_DESCRIBED && ( + {gender === GenderEnum.Star && ( )}
diff --git a/schema.yml b/schema.yml index 721942fec..957d7db82 100644 --- a/schema.yml +++ b/schema.yml @@ -5,7 +5,7 @@ info: paths: /api/compete/{episode_id}/match/: get: - operationId: api_compete_match_list + operationId: compete_match_list description: A viewset for viewing and retrieving Matches. parameters: - in: path @@ -21,7 +21,7 @@ paths: schema: type: integer tags: - - api + - compete security: - jwtAuth: [] responses: @@ -33,7 +33,7 @@ paths: description: '' /api/compete/{episode_id}/match/{id}/: get: - operationId: api_compete_match_retrieve + operationId: compete_match_retrieve description: A viewset for viewing and retrieving Matches. parameters: - in: path @@ -48,7 +48,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -60,7 +60,7 @@ paths: description: '' /api/compete/{episode_id}/match/{id}/publish_public_bracket/: post: - operationId: api_compete_match_publish_public_bracket_create + operationId: compete_match_publish_public_bracket_create description: Publish the result of a tournament match to the public bracket. parameters: - in: path @@ -75,7 +75,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -83,7 +83,7 @@ paths: description: No response body /api/compete/{episode_id}/match/{id}/rating_update/: post: - operationId: api_compete_match_rating_update_create + operationId: compete_match_rating_update_create description: Try to finalize the rating of this match. parameters: - in: path @@ -98,7 +98,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -106,7 +106,7 @@ paths: description: No response body /api/compete/{episode_id}/match/{id}/report/: post: - operationId: api_compete_match_report_create + operationId: compete_match_report_create description: Report the outcome of this match on Saturn. parameters: - in: path @@ -121,18 +121,18 @@ paths: type: string required: true tags: - - api + - compete requestBody: content: application/json: schema: - $ref: '#/components/schemas/MatchReport' + $ref: '#/components/schemas/MatchReportRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/MatchReport' + $ref: '#/components/schemas/MatchReportRequest' multipart/form-data: schema: - $ref: '#/components/schemas/MatchReport' + $ref: '#/components/schemas/MatchReportRequest' required: true security: - jwtAuth: [] @@ -143,7 +143,7 @@ paths: description: This match was already finalized /api/compete/{episode_id}/match/historical_rating/: get: - operationId: api_compete_match_historical_rating_retrieve + operationId: compete_match_historical_rating_retrieve description: List the historical rating of a team. parameters: - in: path @@ -158,7 +158,7 @@ paths: type: integer description: A team to filter for. Defaults to your own team. tags: - - api + - compete security: - jwtAuth: [] responses: @@ -172,7 +172,7 @@ paths: description: '' /api/compete/{episode_id}/match/scrimmage/: get: - operationId: api_compete_match_scrimmage_list + operationId: compete_match_scrimmage_list description: List all scrimmages that a particular team participated in. parameters: - in: path @@ -193,7 +193,7 @@ paths: type: integer description: A team to filter for. Defaults to your own team. tags: - - api + - compete security: - jwtAuth: [] responses: @@ -205,7 +205,7 @@ paths: description: '' /api/compete/{episode_id}/match/tournament/: get: - operationId: api_compete_match_tournament_list + operationId: compete_match_tournament_list description: List matches played in a tournament. parameters: - in: path @@ -236,7 +236,7 @@ paths: type: string description: A tournament to filter for. tags: - - api + - compete security: - jwtAuth: [] responses: @@ -248,7 +248,7 @@ paths: description: '' /api/compete/{episode_id}/request/: post: - operationId: api_compete_request_create + operationId: compete_request_create description: A viewset for creating and responding to Scrimmage Requests. parameters: - in: path @@ -258,18 +258,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - compete requestBody: content: application/json: schema: - $ref: '#/components/schemas/ScrimmageRequest' + $ref: '#/components/schemas/ScrimmageRequestRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/ScrimmageRequest' + $ref: '#/components/schemas/ScrimmageRequestRequest' multipart/form-data: schema: - $ref: '#/components/schemas/ScrimmageRequest' + $ref: '#/components/schemas/ScrimmageRequestRequest' required: true security: - jwtAuth: [] @@ -282,7 +282,7 @@ paths: description: '' /api/compete/{episode_id}/request/{id}/: delete: - operationId: api_compete_request_destroy + operationId: compete_request_destroy description: Cancel a scrimmage request. parameters: - in: path @@ -297,7 +297,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -305,7 +305,7 @@ paths: description: No response body /api/compete/{episode_id}/request/{id}/accept/: post: - operationId: api_compete_request_accept_create + operationId: compete_request_accept_create description: Accept a scrimmage request. parameters: - in: path @@ -320,7 +320,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -328,7 +328,7 @@ paths: description: Scrimmage request has been accepted /api/compete/{episode_id}/request/{id}/reject/: post: - operationId: api_compete_request_reject_create + operationId: compete_request_reject_create description: Reject a scrimmage request. parameters: - in: path @@ -343,7 +343,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -351,7 +351,7 @@ paths: description: Scrimmage request has been rejected /api/compete/{episode_id}/request/inbox/: get: - operationId: api_compete_request_inbox_list + operationId: compete_request_inbox_list description: Get all pending scrimmage requests received. parameters: - in: path @@ -367,7 +367,7 @@ paths: schema: type: integer tags: - - api + - compete security: - jwtAuth: [] responses: @@ -379,7 +379,7 @@ paths: description: '' /api/compete/{episode_id}/request/outbox/: get: - operationId: api_compete_request_outbox_list + operationId: compete_request_outbox_list description: Get all pending scrimmage requests sent. parameters: - in: path @@ -395,7 +395,7 @@ paths: schema: type: integer tags: - - api + - compete security: - jwtAuth: [] responses: @@ -407,7 +407,7 @@ paths: description: '' /api/compete/{episode_id}/submission/: get: - operationId: api_compete_submission_list + operationId: compete_submission_list description: A viewset for creating and retrieving Submissions. parameters: - in: path @@ -423,7 +423,7 @@ paths: schema: type: integer tags: - - api + - compete security: - jwtAuth: [] responses: @@ -434,7 +434,7 @@ paths: $ref: '#/components/schemas/PaginatedSubmissionList' description: '' post: - operationId: api_compete_submission_create + operationId: compete_submission_create description: |- 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 @@ -447,18 +447,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - compete requestBody: content: application/json: schema: - $ref: '#/components/schemas/Submission' + $ref: '#/components/schemas/SubmissionRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/Submission' + $ref: '#/components/schemas/SubmissionRequest' multipart/form-data: schema: - $ref: '#/components/schemas/Submission' + $ref: '#/components/schemas/SubmissionRequest' required: true security: - jwtAuth: [] @@ -471,7 +471,7 @@ paths: description: '' /api/compete/{episode_id}/submission/{id}/: get: - operationId: api_compete_submission_retrieve + operationId: compete_submission_retrieve description: A viewset for creating and retrieving Submissions. parameters: - in: path @@ -486,7 +486,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -498,7 +498,7 @@ paths: description: '' /api/compete/{episode_id}/submission/{id}/download/: get: - operationId: api_compete_submission_download_retrieve + operationId: compete_submission_download_retrieve description: Download the source code associated with a submission. parameters: - in: path @@ -513,7 +513,7 @@ paths: type: string required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -525,7 +525,7 @@ paths: description: '' /api/compete/{episode_id}/submission/{id}/report/: post: - operationId: api_compete_submission_report_create + operationId: compete_submission_report_create description: Report the outcome of this submission on Saturn. parameters: - in: path @@ -540,18 +540,18 @@ paths: type: string required: true tags: - - api + - compete requestBody: content: application/json: schema: - $ref: '#/components/schemas/SubmissionReport' + $ref: '#/components/schemas/SubmissionReportRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/SubmissionReport' + $ref: '#/components/schemas/SubmissionReportRequest' multipart/form-data: schema: - $ref: '#/components/schemas/SubmissionReport' + $ref: '#/components/schemas/SubmissionReportRequest' required: true security: - jwtAuth: [] @@ -562,7 +562,7 @@ paths: description: This submission was already finalized /api/compete/{episode_id}/submission/tournament/: get: - operationId: api_compete_submission_tournament_retrieve + operationId: compete_submission_tournament_list description: Retrieve the submissions used in tournaments by the current team.. parameters: - in: path @@ -572,7 +572,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - compete security: - jwtAuth: [] responses: @@ -580,11 +580,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TournamentSubmission' + type: array + items: + $ref: '#/components/schemas/TournamentSubmission' description: '' /api/episode/{episode_id}/map/: get: - operationId: api_episode_map_list + operationId: episode_map_list description: A viewset for retrieving Maps. parameters: - in: path @@ -594,7 +596,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -604,11 +606,11 @@ paths: schema: type: array items: - $ref: '#/components/schemas/Map' + $ref: '#/components/schemas/GameMap' description: '' /api/episode/{episode_id}/map/{id}/: get: - operationId: api_episode_map_retrieve + operationId: episode_map_retrieve description: A viewset for retrieving Maps. parameters: - in: path @@ -623,7 +625,7 @@ paths: type: string required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -631,11 +633,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Map' + $ref: '#/components/schemas/GameMap' description: '' /api/episode/{episode_id}/tournament/: get: - operationId: api_episode_tournament_list + operationId: episode_tournament_list description: A viewset for retrieving Tournaments. parameters: - in: path @@ -651,7 +653,7 @@ paths: schema: type: integer tags: - - api + - episode security: - jwtAuth: [] responses: @@ -663,7 +665,7 @@ paths: description: '' /api/episode/{episode_id}/tournament/{id}/: get: - operationId: api_episode_tournament_retrieve + operationId: episode_tournament_retrieve description: A viewset for retrieving Tournaments. parameters: - in: path @@ -678,7 +680,7 @@ paths: type: string required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -690,7 +692,7 @@ paths: description: '' /api/episode/{episode_id}/tournament/{tournament}/round/: get: - operationId: api_episode_tournament_round_list + operationId: episode_tournament_round_list description: A viewset for retrieving tournament rounds. parameters: - in: path @@ -712,7 +714,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -724,7 +726,7 @@ paths: description: '' /api/episode/{episode_id}/tournament/{tournament}/round/{id}/: get: - operationId: api_episode_tournament_round_retrieve + operationId: episode_tournament_round_retrieve description: A viewset for retrieving tournament rounds. parameters: - in: path @@ -745,7 +747,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -757,7 +759,7 @@ paths: description: '' /api/episode/{episode_id}/tournament/next/: get: - operationId: api_episode_tournament_next_retrieve + operationId: episode_tournament_next_retrieve description: Retrieve the next upcoming tournament, as ordered by submission freeze time. parameters: @@ -768,7 +770,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - episode security: - jwtAuth: [] responses: @@ -780,7 +782,7 @@ paths: description: '' /api/episode/e/: get: - operationId: api_episode_e_list + operationId: episode_e_list description: A viewset for retrieving Episodes. parameters: - name: page @@ -790,7 +792,7 @@ paths: schema: type: integer tags: - - api + - episode security: - jwtAuth: [] - {} @@ -803,7 +805,7 @@ paths: description: '' /api/episode/e/{id}/: get: - operationId: api_episode_e_retrieve + operationId: episode_e_retrieve description: A viewset for retrieving Episodes. parameters: - in: path @@ -812,7 +814,7 @@ paths: type: string required: true tags: - - api + - episode security: - jwtAuth: [] - {} @@ -825,7 +827,7 @@ paths: description: '' /api/episode/e/{id}/autoscrim/: post: - operationId: api_episode_e_autoscrim_create + operationId: episode_e_autoscrim_create description: Trigger a round of autoscrimmages. parameters: - in: path @@ -834,18 +836,18 @@ paths: type: string required: true tags: - - api + - episode requestBody: content: application/json: schema: - $ref: '#/components/schemas/Autoscrim' + $ref: '#/components/schemas/AutoscrimRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/Autoscrim' + $ref: '#/components/schemas/AutoscrimRequest' multipart/form-data: schema: - $ref: '#/components/schemas/Autoscrim' + $ref: '#/components/schemas/AutoscrimRequest' required: true security: - jwtAuth: [] @@ -854,7 +856,7 @@ paths: description: Created successfully /api/specs/: get: - operationId: api_specs_retrieve + operationId: specs_retrieve description: |- OpenApi3 schema for this API. Format can be selected via content negotiation. @@ -936,6 +938,7 @@ paths: - ml - mn - mr + - ms - my - nb - ne @@ -970,7 +973,7 @@ paths: - zh-hans - zh-hant tags: - - api + - specs security: - jwtAuth: [] - {} @@ -996,7 +999,7 @@ paths: description: '' /api/team/{episode_id}/requirement/: get: - operationId: api_team_requirement_list + operationId: team_requirement_list description: A viewset for retrieving and checking class requirements. parameters: - in: path @@ -1012,7 +1015,7 @@ paths: schema: type: integer tags: - - api + - team security: - jwtAuth: [] responses: @@ -1024,7 +1027,7 @@ paths: description: '' /api/team/{episode_id}/requirement/{id}/: get: - operationId: api_team_requirement_retrieve + operationId: team_requirement_retrieve description: A viewset for retrieving and checking class requirements. parameters: - in: path @@ -1039,7 +1042,7 @@ paths: type: string required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1051,7 +1054,7 @@ paths: description: '' /api/team/{episode_id}/requirement/{id}/check/: get: - operationId: api_team_requirement_check_retrieve + operationId: team_requirement_check_retrieve description: A viewset for retrieving and checking class requirements. parameters: - in: path @@ -1066,7 +1069,7 @@ paths: type: string required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1078,7 +1081,7 @@ paths: description: '' /api/team/{episode_id}/requirement/{id}/compute/: get: - operationId: api_team_requirement_compute_retrieve + operationId: team_requirement_compute_retrieve description: A viewset for retrieving and checking class requirements. parameters: - in: path @@ -1093,7 +1096,7 @@ paths: type: string required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1105,7 +1108,7 @@ paths: description: '' /api/team/{episode_id}/requirement/report/: get: - operationId: api_team_requirement_report_retrieve + operationId: team_requirement_report_retrieve description: Retrieve or update team strategy report parameters: - in: path @@ -1115,14 +1118,14 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team security: - jwtAuth: [] responses: '204': description: No response body put: - operationId: api_team_requirement_report_update + operationId: team_requirement_report_update description: Retrieve or update team strategy report parameters: - in: path @@ -1132,18 +1135,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/TeamReport' + $ref: '#/components/schemas/TeamReportRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TeamReport' + $ref: '#/components/schemas/TeamReportRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TeamReport' + $ref: '#/components/schemas/TeamReportRequest' required: true security: - jwtAuth: [] @@ -1152,7 +1155,7 @@ paths: description: No response body /api/team/{episode_id}/t/: get: - operationId: api_team_t_list + operationId: team_t_list description: |- A viewset for retrieving and updating all team/team profile info. @@ -1183,7 +1186,7 @@ paths: schema: type: string tags: - - api + - team security: - jwtAuth: [] responses: @@ -1194,7 +1197,7 @@ paths: $ref: '#/components/schemas/PaginatedTeamPublicList' description: '' post: - operationId: api_team_t_create + operationId: team_t_create description: |- A viewset for retrieving and updating all team/team profile info. @@ -1207,18 +1210,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/TeamCreate' + $ref: '#/components/schemas/TeamCreateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TeamCreate' + $ref: '#/components/schemas/TeamCreateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TeamCreate' + $ref: '#/components/schemas/TeamCreateRequest' required: true security: - jwtAuth: [] @@ -1231,7 +1234,7 @@ paths: description: '' /api/team/{episode_id}/t/{id}/: get: - operationId: api_team_t_retrieve + operationId: team_t_retrieve description: |- A viewset for retrieving and updating all team/team profile info. @@ -1249,7 +1252,7 @@ paths: type: string required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1261,7 +1264,7 @@ paths: description: '' /api/team/{episode_id}/t/avatar/: post: - operationId: api_team_t_avatar_create + operationId: team_t_avatar_create description: Update uploaded avatar. parameters: - in: path @@ -1271,18 +1274,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/TeamAvatar' + $ref: '#/components/schemas/TeamAvatarRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TeamAvatar' + $ref: '#/components/schemas/TeamAvatarRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TeamAvatar' + $ref: '#/components/schemas/TeamAvatarRequest' required: true security: - jwtAuth: [] @@ -1291,7 +1294,7 @@ paths: description: No response body /api/team/{episode_id}/t/join/: post: - operationId: api_team_t_join_create + operationId: team_t_join_create description: |- A viewset for retrieving and updating all team/team profile info. @@ -1304,18 +1307,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/TeamJoin' + $ref: '#/components/schemas/TeamJoinRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TeamJoin' + $ref: '#/components/schemas/TeamJoinRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TeamJoin' + $ref: '#/components/schemas/TeamJoinRequest' required: true security: - jwtAuth: [] @@ -1324,7 +1327,7 @@ paths: description: No response body /api/team/{episode_id}/t/leave/: post: - operationId: api_team_t_leave_create + operationId: team_t_leave_create description: Leave a team. parameters: - in: path @@ -1334,7 +1337,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1342,7 +1345,7 @@ paths: description: No response body /api/team/{episode_id}/t/me/: get: - operationId: api_team_t_me_retrieve + operationId: team_t_me_retrieve description: Retrieve or update information about the current team. parameters: - in: path @@ -1352,7 +1355,7 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team security: - jwtAuth: [] responses: @@ -1363,7 +1366,7 @@ paths: $ref: '#/components/schemas/TeamPrivate' description: '' put: - operationId: api_team_t_me_update + operationId: team_t_me_update description: Retrieve or update information about the current team. parameters: - in: path @@ -1373,18 +1376,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/TeamPrivate' + $ref: '#/components/schemas/TeamPrivateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TeamPrivate' + $ref: '#/components/schemas/TeamPrivateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TeamPrivate' + $ref: '#/components/schemas/TeamPrivateRequest' security: - jwtAuth: [] responses: @@ -1395,7 +1398,7 @@ paths: $ref: '#/components/schemas/TeamPrivate' description: '' patch: - operationId: api_team_t_me_partial_update + operationId: team_t_me_partial_update description: Retrieve or update information about the current team. parameters: - in: path @@ -1405,18 +1408,18 @@ paths: pattern: ^[^\/.]+$ required: true tags: - - api + - team requestBody: content: application/json: schema: - $ref: '#/components/schemas/PatchedTeamPrivate' + $ref: '#/components/schemas/PatchedTeamPrivateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/PatchedTeamPrivate' + $ref: '#/components/schemas/PatchedTeamPrivateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/PatchedTeamPrivate' + $ref: '#/components/schemas/PatchedTeamPrivateRequest' security: - jwtAuth: [] responses: @@ -1428,23 +1431,23 @@ paths: description: '' /api/token/: post: - operationId: api_token_create + operationId: token_create description: |- Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. tags: - - api + - token requestBody: content: application/json: schema: - $ref: '#/components/schemas/TokenObtainPair' + $ref: '#/components/schemas/TokenObtainPairRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TokenObtainPair' + $ref: '#/components/schemas/TokenObtainPairRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TokenObtainPair' + $ref: '#/components/schemas/TokenObtainPairRequest' required: true responses: '200': @@ -1455,23 +1458,23 @@ paths: description: '' /api/token/refresh/: post: - operationId: api_token_refresh_create + operationId: token_refresh_create description: |- Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid. tags: - - api + - token requestBody: content: application/json: schema: - $ref: '#/components/schemas/TokenRefresh' + $ref: '#/components/schemas/TokenRefreshRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TokenRefresh' + $ref: '#/components/schemas/TokenRefreshRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TokenRefresh' + $ref: '#/components/schemas/TokenRefreshRequest' required: true responses: '200': @@ -1482,51 +1485,47 @@ paths: description: '' /api/token/verify/: post: - operationId: api_token_verify_create + operationId: token_verify_create description: |- Takes a token and indicates if it is valid. This view provides no information about a token's fitness for a particular use. tags: - - api + - token requestBody: content: application/json: schema: - $ref: '#/components/schemas/TokenVerify' + $ref: '#/components/schemas/TokenVerifyRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/TokenVerify' + $ref: '#/components/schemas/TokenVerifyRequest' multipart/form-data: schema: - $ref: '#/components/schemas/TokenVerify' + $ref: '#/components/schemas/TokenVerifyRequest' required: true responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TokenVerify' - description: '' + description: No response body /api/user/password_reset/: post: - operationId: api_user_password_reset_create + operationId: user_password_reset_create description: |- 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 tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/Email' + $ref: '#/components/schemas/EmailRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/Email' + $ref: '#/components/schemas/EmailRequest' multipart/form-data: schema: - $ref: '#/components/schemas/Email' + $ref: '#/components/schemas/EmailRequest' required: true responses: '200': @@ -1537,22 +1536,22 @@ paths: description: '' /api/user/password_reset/confirm/: post: - operationId: api_user_password_reset_confirm_create + operationId: user_password_reset_confirm_create description: An Api View which provides a method to reset a password based on a unique token tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/PasswordToken' + $ref: '#/components/schemas/PasswordTokenRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/PasswordToken' + $ref: '#/components/schemas/PasswordTokenRequest' multipart/form-data: schema: - $ref: '#/components/schemas/PasswordToken' + $ref: '#/components/schemas/PasswordTokenRequest' required: true responses: '200': @@ -1563,21 +1562,21 @@ paths: description: '' /api/user/password_reset/validate_token/: post: - operationId: api_user_password_reset_validate_token_create + operationId: user_password_reset_validate_token_create description: An Api View which provides a method to verify that a token is valid tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/ResetToken' + $ref: '#/components/schemas/ResetTokenRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/ResetToken' + $ref: '#/components/schemas/ResetTokenRequest' multipart/form-data: schema: - $ref: '#/components/schemas/ResetToken' + $ref: '#/components/schemas/ResetTokenRequest' required: true responses: '200': @@ -1588,21 +1587,21 @@ paths: description: '' /api/user/u/: post: - operationId: api_user_u_create + operationId: user_u_create description: A viewset for retrieving and updating all user info. tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserCreate' + $ref: '#/components/schemas/UserCreateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserCreate' + $ref: '#/components/schemas/UserCreateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/UserCreate' + $ref: '#/components/schemas/UserCreateRequest' required: true security: - jwtAuth: [] @@ -1616,7 +1615,7 @@ paths: description: '' /api/user/u/{id}/: get: - operationId: api_user_u_retrieve + operationId: user_u_retrieve description: A viewset for retrieving and updating all user info. parameters: - in: path @@ -1626,7 +1625,7 @@ paths: description: A unique integer value identifying this user. required: true tags: - - api + - user security: - jwtAuth: [] - {} @@ -1639,7 +1638,7 @@ paths: description: '' /api/user/u/{id}/teams/: get: - operationId: api_user_u_teams_retrieve + operationId: user_u_teams_retrieve description: Retrieve all teams associated with a user. parameters: - in: path @@ -1649,7 +1648,7 @@ paths: description: A unique integer value identifying this user. required: true tags: - - api + - user security: - jwtAuth: [] - {} @@ -1658,25 +1657,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamPublic' + type: object + additionalProperties: + $ref: '#/components/schemas/TeamPublic' description: '' /api/user/u/avatar/: post: - operationId: api_user_u_avatar_create + operationId: user_u_avatar_create description: Update uploaded avatar. tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserAvatar' + $ref: '#/components/schemas/UserAvatarRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserAvatar' + $ref: '#/components/schemas/UserAvatarRequest' multipart/form-data: schema: - $ref: '#/components/schemas/UserAvatar' + $ref: '#/components/schemas/UserAvatarRequest' required: true security: - jwtAuth: [] @@ -1685,10 +1686,10 @@ paths: description: No response body /api/user/u/me/: get: - operationId: api_user_u_me_retrieve + operationId: user_u_me_retrieve description: Retrieve or update information about the logged-in user. tags: - - api + - user security: - jwtAuth: [] responses: @@ -1699,21 +1700,21 @@ paths: $ref: '#/components/schemas/UserPrivate' description: '' put: - operationId: api_user_u_me_update + operationId: user_u_me_update description: Retrieve or update information about the logged-in user. tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserPrivate' + $ref: '#/components/schemas/UserPrivateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserPrivate' + $ref: '#/components/schemas/UserPrivateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/UserPrivate' + $ref: '#/components/schemas/UserPrivateRequest' required: true security: - jwtAuth: [] @@ -1725,21 +1726,21 @@ paths: $ref: '#/components/schemas/UserPrivate' description: '' patch: - operationId: api_user_u_me_partial_update + operationId: user_u_me_partial_update description: Retrieve or update information about the logged-in user. tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/PatchedUserPrivate' + $ref: '#/components/schemas/PatchedUserPrivateRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/PatchedUserPrivate' + $ref: '#/components/schemas/PatchedUserPrivateRequest' multipart/form-data: schema: - $ref: '#/components/schemas/PatchedUserPrivate' + $ref: '#/components/schemas/PatchedUserPrivateRequest' security: - jwtAuth: [] responses: @@ -1751,10 +1752,10 @@ paths: description: '' /api/user/u/resume/: get: - operationId: api_user_u_resume_retrieve + operationId: user_u_resume_retrieve description: Retrieve or update the uploaded resume. tags: - - api + - user security: - jwtAuth: [] responses: @@ -1765,21 +1766,21 @@ paths: $ref: '#/components/schemas/UserResume' description: '' put: - operationId: api_user_u_resume_update + operationId: user_u_resume_update description: Retrieve or update the uploaded resume. tags: - - api + - user requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserResume' + $ref: '#/components/schemas/UserResumeRequest' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/UserResume' + $ref: '#/components/schemas/UserResumeRequest' multipart/form-data: schema: - $ref: '#/components/schemas/UserResume' + $ref: '#/components/schemas/UserResumeRequest' required: true security: - jwtAuth: [] @@ -1792,7 +1793,7 @@ paths: description: '' components: schemas: - Autoscrim: + AutoscrimRequest: type: object properties: best_of: @@ -1813,8 +1814,6 @@ components: type: integer min_score: type: integer - maximum: 32767 - minimum: 0 required: - episode - maps @@ -2100,6 +2099,15 @@ components: format: email required: - email + EmailRequest: + type: object + properties: + email: + type: string + format: email + minLength: 1 + required: + - email Episode: type: object properties: @@ -2144,6 +2152,27 @@ components: - language - name_long - name_short + GameMap: + type: object + properties: + id: + type: integer + readOnly: true + episode: + type: string + readOnly: true + name: + type: string + readOnly: true + pattern: ^[-a-zA-Z0-9_]+$ + is_public: + type: boolean + readOnly: true + required: + - episode + - id + - is_public + - name GenderEnum: enum: - F @@ -2169,27 +2198,6 @@ components: - java8 - py3 type: string - Map: - type: object - properties: - id: - type: integer - readOnly: true - episode: - type: string - readOnly: true - name: - type: string - readOnly: true - pattern: ^[-a-zA-Z0-9_]+$ - is_public: - type: boolean - readOnly: true - required: - - episode - - id - - is_public - - name Match: type: object properties: @@ -2279,11 +2287,11 @@ components: - submission - team - teamname - MatchReport: + MatchReportRequest: type: object properties: invocation: - $ref: '#/components/schemas/SaturnInvocation' + $ref: '#/components/schemas/SaturnInvocationRequest' scores: type: array items: @@ -2461,61 +2469,45 @@ components: required: - password - token - PatchedTeamPrivate: + PasswordTokenRequest: type: object properties: - id: - type: integer - readOnly: true - profile: - $ref: '#/components/schemas/TeamProfilePrivate' - episode: - type: string - name: + password: type: string - readOnly: true - members: - type: array - items: - $ref: '#/components/schemas/UserPublic' - readOnly: true - join_key: + minLength: 1 + token: type: string - readOnly: true - pattern: ^[-a-zA-Z0-9_]+$ - status: - allOf: - - $ref: '#/components/schemas/Status526Enum' - readOnly: true - PatchedUserPrivate: + minLength: 1 + required: + - password + - token + PatchedTeamPrivateRequest: type: object properties: - id: - type: integer - readOnly: true profile: - $ref: '#/components/schemas/UserProfilePrivate' - username: + $ref: '#/components/schemas/TeamProfilePrivateRequest' + episode: type: string - readOnly: true - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. + minLength: 1 + PatchedUserPrivateRequest: + type: object + properties: + profile: + $ref: '#/components/schemas/UserProfilePrivateRequest' email: type: string format: email + minLength: 1 title: Email address maxLength: 254 first_name: type: string + minLength: 1 maxLength: 30 last_name: type: string + minLength: 1 maxLength: 30 - is_staff: - type: boolean - readOnly: true - title: Staff status - description: Designates whether the user can log into this admin site. PlayerOrderEnum: enum: - + @@ -2535,7 +2527,15 @@ components: type: string required: - token - SaturnInvocation: + ResetTokenRequest: + type: object + properties: + token: + type: string + minLength: 1 + required: + - token + SaturnInvocationRequest: type: object properties: status: @@ -2561,7 +2561,7 @@ components: readOnly: true status: allOf: - - $ref: '#/components/schemas/ScrimmageRequestStatusEnum' + - $ref: '#/components/schemas/ScrimmageStatusEnum' readOnly: true is_ranked: type: boolean @@ -2591,18 +2591,11 @@ components: items: type: string readOnly: true - map_names: - type: array - items: - type: string - writeOnly: true - maxItems: 10 required: - created - episode - id - is_ranked - - map_names - maps - player_order - requested_by @@ -2612,7 +2605,28 @@ components: - requested_to_name - requested_to_rating - status - ScrimmageRequestStatusEnum: + ScrimmageRequestRequest: + type: object + properties: + is_ranked: + type: boolean + requested_to: + type: integer + player_order: + $ref: '#/components/schemas/PlayerOrderEnum' + map_names: + type: array + items: + type: string + minLength: 1 + writeOnly: true + maxItems: 10 + required: + - is_ranked + - map_names + - player_order + - requested_to + ScrimmageStatusEnum: enum: - P - Y @@ -2681,17 +2695,12 @@ components: description: type: string maxLength: 128 - source_code: - type: string - format: uri - writeOnly: true required: - accepted - created - episode - id - logs - - source_code - status - team - teamname @@ -2714,21 +2723,36 @@ components: - ready - reason - url - SubmissionReport: + SubmissionReportRequest: type: object properties: invocation: - $ref: '#/components/schemas/SaturnInvocation' + $ref: '#/components/schemas/SaturnInvocationRequest' accepted: type: boolean required: - invocation - TeamAvatar: + SubmissionRequest: + type: object + properties: + package: + type: string + maxLength: 32 + description: + type: string + maxLength: 128 + source_code: + type: string + format: binary + writeOnly: true + required: + - source_code + TeamAvatarRequest: type: object properties: avatar: type: string - format: uri + format: binary writeOnly: true required: - avatar @@ -2765,13 +2789,30 @@ components: - members - name - status - TeamJoin: + TeamCreateRequest: + type: object + properties: + profile: + $ref: '#/components/schemas/TeamProfilePrivateRequest' + episode: + type: string + minLength: 1 + name: + type: string + minLength: 1 + pattern: ^[ -~]*$ + maxLength: 32 + required: + - name + TeamJoinRequest: type: object properties: join_key: type: string + minLength: 1 name: type: string + minLength: 1 required: - join_key - name @@ -2807,6 +2848,14 @@ components: - members - name - status + TeamPrivateRequest: + type: object + properties: + profile: + $ref: '#/components/schemas/TeamProfilePrivateRequest' + episode: + type: string + minLength: 1 TeamProfilePrivate: type: object properties: @@ -2841,6 +2890,26 @@ components: - avatar_url - has_avatar - rating + TeamProfilePrivateRequest: + type: object + properties: + quote: + type: string + pattern: ^[ -~]*$ + maxLength: 80 + biography: + type: string + maxLength: 1024 + has_report: + type: boolean + auto_accept_ranked: + type: boolean + auto_accept_unranked: + type: boolean + eligible_for: + type: array + items: + type: integer TeamProfilePublic: type: object properties: @@ -2907,24 +2976,18 @@ components: - members - name - status - TeamReport: + TeamReportRequest: type: object properties: report: type: string - format: uri + format: binary writeOnly: true required: - report TokenObtainPair: type: object properties: - username: - type: string - writeOnly: true - password: - type: string - writeOnly: true access: type: string readOnly: true @@ -2933,8 +2996,20 @@ components: readOnly: true required: - access - - password - refresh + TokenObtainPairRequest: + type: object + properties: + username: + type: string + writeOnly: true + minLength: 1 + password: + type: string + writeOnly: true + minLength: 1 + required: + - password - username TokenRefresh: type: object @@ -2942,18 +3017,24 @@ components: access: type: string readOnly: true + required: + - access + TokenRefreshRequest: + type: object + properties: refresh: type: string writeOnly: true + minLength: 1 required: - - access - refresh - TokenVerify: + TokenVerifyRequest: type: object properties: token: type: string writeOnly: true + minLength: 1 required: - token Tournament: @@ -3017,8 +3098,6 @@ components: type: string external_id: type: integer - maximum: 32767 - minimum: -32768 nullable: true name: type: string @@ -3028,10 +3107,7 @@ components: items: type: integer release_status: - allOf: - - $ref: '#/components/schemas/ReleaseStatusEnum' - minimum: -2147483648 - maximum: 2147483647 + $ref: '#/components/schemas/ReleaseStatusEnum' required: - id - name @@ -3077,10 +3153,6 @@ components: description: type: string readOnly: true - source_code: - type: string - format: uri - writeOnly: true tournament: type: string readOnly: true @@ -3092,19 +3164,18 @@ components: - id - logs - package - - source_code - status - team - teamname - tournament - user - username - UserAvatar: + UserAvatarRequest: type: object properties: avatar: type: string - format: uri + format: binary writeOnly: true required: - avatar @@ -3122,9 +3193,6 @@ components: only. pattern: ^[\w.@+-]+$ maxLength: 150 - password: - type: string - writeOnly: true email: type: string format: email @@ -3147,6 +3215,41 @@ components: - id - is_staff - last_name + - username + UserCreateRequest: + type: object + properties: + profile: + $ref: '#/components/schemas/UserProfilePrivateRequest' + username: + type: string + minLength: 1 + description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ + only. + pattern: ^[\w.@+-]+$ + maxLength: 150 + password: + type: string + writeOnly: true + minLength: 1 + email: + type: string + format: email + minLength: 1 + title: Email address + maxLength: 254 + first_name: + type: string + minLength: 1 + maxLength: 30 + last_name: + type: string + minLength: 1 + maxLength: 30 + required: + - email + - first_name + - last_name - password - username UserPassed: @@ -3202,6 +3305,29 @@ components: - is_staff - last_name - username + UserPrivateRequest: + type: object + properties: + profile: + $ref: '#/components/schemas/UserProfilePrivateRequest' + email: + type: string + format: email + minLength: 1 + title: Email address + maxLength: 254 + first_name: + type: string + minLength: 1 + maxLength: 30 + last_name: + type: string + minLength: 1 + maxLength: 30 + required: + - email + - first_name + - last_name UserProfilePrivate: type: object properties: @@ -3237,6 +3363,29 @@ components: - gender - has_avatar - has_resume + UserProfilePrivateRequest: + type: object + properties: + gender: + $ref: '#/components/schemas/GenderEnum' + gender_details: + type: string + maxLength: 32 + school: + type: string + maxLength: 128 + biography: + type: string + maxLength: 1024 + kerberos: + type: string + maxLength: 16 + pattern: ^[-a-zA-Z0-9_]+$ + country: + $ref: '#/components/schemas/CountryEnum' + required: + - country + - gender UserProfilePublic: type: object properties: @@ -3255,6 +3404,15 @@ components: required: - avatar_url - has_avatar + UserProfilePublicRequest: + type: object + properties: + school: + type: string + maxLength: 128 + biography: + type: string + maxLength: 1024 UserPublic: type: object properties: @@ -3278,13 +3436,23 @@ components: - id - is_staff - username - UserResume: + UserPublicRequest: type: object properties: - resume: + profile: + $ref: '#/components/schemas/UserProfilePublicRequest' + username: type: string - format: uri - writeOnly: true + minLength: 1 + description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ + only. + pattern: ^[\w.@+-]+$ + maxLength: 150 + required: + - username + UserResume: + type: object + properties: ready: type: boolean readOnly: true @@ -3298,8 +3466,16 @@ components: required: - ready - reason - - resume - url + UserResumeRequest: + type: object + properties: + resume: + type: string + format: binary + writeOnly: true + required: + - resume securitySchemes: jwtAuth: type: http