/* eslint-disable */ // @ts-nocheck /* * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY */ import * as fm from "../../../../../fetch.pb" import * as GoogleProtobufEmpty from "../../../../../google/protobuf/empty.pb" import * as GoogleProtobufTimestamp from "../../../../../google/protobuf/timestamp.pb" export type Token = { token?: string expires?: GoogleProtobufTimestamp.Timestamp } export type OAuthCodeRequest = { } export type OAuthCodeResponse = { redirectURI?: string } export type TokenRequest = { code?: string state?: string } export type DeleteTokenRequest = { all?: boolean token?: Token } export type User = { id?: string name?: string email?: string picture?: string gradeLevel?: number admin?: boolean createdAt?: GoogleProtobufTimestamp.Timestamp } export type PartData = { part?: number completed?: boolean pointsWorth?: number } export type Question = { id?: string title?: string content?: string part1?: PartData part2?: PartData } export type QuestionsResponse = { questions?: Question[] } export type QuestionByIDRequest = { id?: string } export type QuestionInputRequest = { id?: string } export type QuestionInput = { id?: string input?: string } export type SubmitRequest = { id?: string answer?: string part?: boolean code?: string } export type SubmitResponse = { id?: string part?: number correct?: boolean ranking?: number points?: number } export type UpdateFields = { name?: string gradeLevel?: number admin?: boolean } export type UserRequest = { } export type AllUsersRequest = { } export type UpdateUserRequest = { email?: string body?: UpdateFields } export type UserByEmailRequest = { email?: string } export type DeleteUserRequest = { email?: string } export type AllUsersResponse = { users?: User[] } export class AuthService { static OAuthCode(req: OAuthCodeRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/auth/code?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static Token(req: TokenRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/auth/token?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static DeleteToken(req: DeleteTokenRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/auth/token`, {...initReq, method: "DELETE"}) } } export class QuestService { static Questions(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/questions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static QuestionByID(req: QuestionByIDRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/questions/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"}) } static QuestionInput(req: QuestionInputRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/questions/${req["id"]}/input?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"}) } static Submit(req: SubmitRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/questions/${req["id"]}`, {...initReq, method: "POST"}) } } export class UserService { static User(req: UserRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/users/me?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static UserByEmail(req: UserByEmailRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/admin/users/${req["email"]}?${fm.renderURLSearchParams(req, ["email"])}`, {...initReq, method: "GET"}) } static AllUsers(req: AllUsersRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/admin/users?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) } static UpdateUser(req: UpdateUserRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/users/me`, {...initReq, method: "PUT", body: JSON.stringify(req["Body"])}) } static AdminUpdateUser(req: UpdateUserRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/admin/users/${req["email"]}`, {...initReq, method: "PUT", body: JSON.stringify(req["Body"])}) } static DeleteUser(req: DeleteUserRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/v1/admin/users/${req["email"]}`, {...initReq, method: "DELETE"}) } }