/**
 * Generated by orval v8.23.0 🍺
 * Do not edit manually.
 * FastAPI
 * OpenAPI spec version: v2.2.0
 */
import * as zod from 'zod';


/**
 * Validates the current user, and returns their details
 *
 * Returns:
 *     UserMeResponse: The current user details, and whether they are authenticated or not
 * @summary Me
 */
export const MeAuthMeGetResponse = zod.object({
  "authenticated": zod.boolean(),
  "user": zod.union([zod.object({
  "uuid": zod.uuid(),
  "username": zod.string(),
  "email": zod.email(),
  "is_superuser": zod.boolean(),
  "display_name": zod.union([zod.string(),zod.null()]),
  "team_number": zod.int(),
  "email_verified": zod.boolean(),
  "profile_picture_url": zod.union([zod.string(),zod.null()]),
  "created_at": zod.iso.datetime({"offset":true})
}),zod.null()]),
  "settings": zod.union([zod.array(zod.object({
  "key": zod.string(),
  "value": zod.union([zod.unknown(),zod.null()]),
  "name": zod.string(),
  "description": zod.union([zod.string(),zod.null()]),
  "section": zod.union([zod.string(),zod.null()]),
  "visible": zod.boolean(),
  "type": zod.enum(['string', 'number', 'boolean', 'array', 'json'])
})),zod.null()])
})

/**
 * Logs in a user
 *
 * Returns:
 *     MessageResponse: A message indicating that the user has been logged in
 * @summary Login
 */
export const loginAuthLoginPostBodyGrantTypeOneRegExp = new RegExp('^password$');
export const loginAuthLoginPostBodyScopeDefault = ``;

export const LoginAuthLoginPostBody = zod.object({
  "grant_type": zod.union([zod.string().regex(loginAuthLoginPostBodyGrantTypeOneRegExp),zod.null()]).optional(),
  "username": zod.string(),
  "password": zod.string(),
  "scope": zod.string().default(loginAuthLoginPostBodyScopeDefault),
  "client_id": zod.union([zod.string(),zod.null()]).optional(),
  "client_secret": zod.union([zod.string(),zod.null()]).optional()
})

export const LoginAuthLoginPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Create a new user
 *
 * If this is the first user on the server, make them a superuser
 *
 * TODO: email_verified status probably shouldn't come from the client, and should instead be verified by the server to prevent verified spoofing
 *
 * Paramaters:
 *     data (SignupRequest): The data to create the user
 *
 * Returns:
 *     MessageResponse: A message indicating that the user has been created
 * @summary Signup
 */
export const SignupAuthSignupPostBody = zod.object({
  "username": zod.string(),
  "email": zod.email(),
  "password": zod.string(),
  "confirm_password": zod.string(),
  "team_number": zod.int(),
  "display_name": zod.string(),
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()])
})

export const SignupAuthSignupPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Logs out a user
 * @summary Logout
 */
export const LogoutAuthLogoutPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Get all users on the server
 *
 * Requires superuser access
 *
 * Returns:
 *     list[User]: A list of all users
 * @summary Get Users
 */
export const GetUsersUsersGetResponseItem = zod.object({
  "uuid": zod.uuid(),
  "username": zod.string(),
  "email": zod.email(),
  "is_superuser": zod.boolean(),
  "display_name": zod.union([zod.string(),zod.null()]),
  "team_number": zod.int(),
  "email_verified": zod.boolean(),
  "profile_picture_url": zod.union([zod.string(),zod.null()]),
  "created_at": zod.iso.datetime({"offset":true})
})
export const GetUsersUsersGetResponse = zod.array(GetUsersUsersGetResponseItem)

/**
 * Delete a user on the server
 *
 * Requires superuser access
 *
 * Parameters:
 *     uuid (uuid): The uuid of the user to delete
 *
 * Returns:
 *     MessageResponse: A message indicating that the user was deleted
 * @summary Delete User
 */
export const DeleteUserUsersDeleteUuidDeleteParams = zod.object({
  "uuid": zod.uuid()
})

export const DeleteUserUsersDeleteUuidDeleteResponse = zod.object({
  "message": zod.string()
})

/**
 * Get the settings for the current user
 *
 * Returns:
 *     BaseSettings: The settings for the current user
 * @summary Get User Settings
 */
export const GetUserSettingsUsersMeGetSettingsGetResponseItem = zod.object({
  "key": zod.string(),
  "value": zod.union([zod.unknown(),zod.null()]),
  "name": zod.string(),
  "description": zod.union([zod.string(),zod.null()]),
  "section": zod.union([zod.string(),zod.null()]),
  "visible": zod.boolean(),
  "type": zod.enum(['string', 'number', 'boolean', 'array', 'json'])
})
export const GetUserSettingsUsersMeGetSettingsGetResponse = zod.array(GetUserSettingsUsersMeGetSettingsGetResponseItem)

/**
 * Update the settings for the current user
 *
 * Parameters:
 *     data (BaseSettings): The settings to update
 *
 * Returns:
 *     BaseSettings: The settings for the current user
 * @summary Update User Settings
 */
export const UpdateUserSettingsUsersMeUpdateSettingsPostBody = zod.object({
  "created_at": zod.union([zod.unknown(),zod.null()]).optional(),
  "created_by": zod.union([zod.unknown(),zod.null()]).optional(),
  "favorite_events": zod.union([zod.array(zod.unknown()),zod.null()]).optional()
})

export const UpdateUserSettingsUsersMeUpdateSettingsPostResponse = zod.object({
  "created_at": zod.union([zod.unknown(),zod.null()]).optional(),
  "created_by": zod.union([zod.unknown(),zod.null()]).optional(),
  "favorite_events": zod.union([zod.array(zod.unknown()),zod.null()]).optional()
})

/**
 * Set a user as a superuser
 *
 * Requires superuser access
 *
 * Parameters:
 *     uuid (uuid): The uuid of the user to set as a superuser
 *
 * Returns:
 *     User: The user that was set as a superuser
 * @summary Set Superuser
 */
export const SetSuperuserUsersSetSuperuserUuidPostParams = zod.object({
  "uuid": zod.uuid()
})

export const SetSuperuserUsersSetSuperuserUuidPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Remove a user as a superuser
 *
 * Requires superuser access
 *
 * Parameters:
 *     uuid (uuid): The uuid of the user to remove as a superuser
 *
 * Returns:
 *     User: The user that was removed as a superuser
 * @summary Remove Superuser
 */
export const RemoveSuperuserUsersRemoveSuperuserUuidPostParams = zod.object({
  "uuid": zod.uuid()
})

export const RemoveSuperuserUsersRemoveSuperuserUuidPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Set the display name for the current user
 *
 * Parameters:
 *     display_name (str): The display name to set
 *
 * Returns:
 *     MessageResponse: A message indicating that the display name was set
 * @summary Set Display Name
 */
export const SetDisplayNameUsersMeSetDisplayNamePostQueryParams = zod.object({
  "display_name": zod.string()
})

export const SetDisplayNameUsersMeSetDisplayNamePostResponse = zod.object({
  "message": zod.string()
})

/**
 * Set the team number for the current user
 *
 * Parameters:
 *     team_number (int): The team number to set
 *
 * Returns:
 *     MessageResponse: A message indicating that the team number was set
 * @summary Set Team Number
 */
export const SetTeamNumberUsersMeSetTeamNumberPostQueryParams = zod.object({
  "team_number": zod.int()
})

export const SetTeamNumberUsersMeSetTeamNumberPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Check if a username and email is unique
 *
 * Parameters:
 *     username (str | None): The username to check
 *     email (str | None): The email to check
 *
 * Returns:
 *     MessageResponse: A message indicating whether the username is unique
 * @summary Check Unique Username
 */
export const CheckUniqueUsernameAuthCheckUniqueUsernameGetQueryParams = zod.object({
  "username": zod.union([zod.string(),zod.null()]).optional(),
  "email": zod.union([zod.string(),zod.null()]).optional()
})

export const CheckUniqueUsernameAuthCheckUniqueUsernameGetResponse = zod.unknown()

/**
 * Given an email, create a verification code and send it to the user
 *
 * If an identity is found, attach the user to the verification code
 *
 * Parameters:
 *     email (str): The email to create a verification code for
 * @summary Create Verification Code
 */
export const createVerificationCodeAuthCreateVerificationCodePostQueryStyleDefault = `verification_code`;

export const CreateVerificationCodeAuthCreateVerificationCodePostQueryParams = zod.object({
  "email": zod.string(),
  "style": zod.enum(['verification_code', 'forgot_password']).default(createVerificationCodeAuthCreateVerificationCodePostQueryStyleDefault)
})

export const CreateVerificationCodeAuthCreateVerificationCodePostResponse = zod.unknown()

/**
 * Verify a verification code for a user
 *
 * Given an email and a verification code, verify the verification code
 *
 * If an identity is found, the verification code must be attached to the user to be validated.
 *     This would occour when verifying an email from the profile page when their email was not yet verified.
 *     When doing this, also set that user's email_verified to be true if it is not already.
 *
 * The code's created_at should be less than VERIFICATION_CODE_EXPIRE_MINUTES to be validated.
 *
 * Parameters:
 *     email (str): The email to verify the verification code for
 *     code (int): The verification code to verify
 * @summary Verify Verification Code
 */
export const VerifyVerificationCodeAuthVerifyVerificationCodePostBody = zod.object({
  "email": zod.email(),
  "code": zod.string()
})

export const VerifyVerificationCodeAuthVerifyVerificationCodePostResponse = zod.object({
  "verified": zod.boolean(),
  "message": zod.string(),
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()]).optional()
})

/**
 * Given an email, password, and verification code UUID, change the password for a user
 *
 * First, confirm that the verification code is valid. If so, change the password for the user.
 *
 * Parameters:
 *     email (str): The email to change the password for
 *     password (str): The new password
 *     verification_code_uuid (str): The UUID of the verification code
 * @summary Forgot Password
 */
export const ForgotPasswordAuthForgotPasswordPostBody = zod.object({
  "email": zod.email(),
  "password": zod.string(),
  "verification_code_uuid": zod.uuid()
})

export const ForgotPasswordAuthForgotPasswordPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Begin the passkey registration process
 *
 * Requires either verification_code_uuid or passkey_uuid to verify the user's identity, unless the account is less than PASSKEY_NO_VERIFICATION_MINUTES minutes old
 * @summary Create Passkey
 */
export const CreatePasskeyAuthPasskeysRegisterCreatePostQueryParams = zod.object({
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()]).optional(),
  "passkey_uuid": zod.union([zod.uuid(),zod.null()]).optional()
})

export const CreatePasskeyAuthPasskeysRegisterCreatePostResponse = zod.unknown()

/**
 * Verify the passkey registration
 * @summary Verify Passkey
 */
export const VerifyPasskeyAuthPasskeysRegisterVerifyPostQueryParams = zod.object({
  "challenge_uuid": zod.uuid(),
  "label": zod.string()
})

export const VerifyPasskeyAuthPasskeysRegisterVerifyPostBody = zod.record(zod.string(), zod.unknown())

export const VerifyPasskeyAuthPasskeysRegisterVerifyPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Begin the passkey login process
 * @summary Create Login Passkey
 */
export const CreateLoginPasskeyAuthPasskeysLoginCreatePostResponse = zod.unknown()

/**
 * Verify the passkey login
 * @summary Verify Login Passkey
 */
export const VerifyLoginPasskeyAuthPasskeysLoginVerifyPostQueryParams = zod.object({
  "challenge_uuid": zod.uuid()
})

export const VerifyLoginPasskeyAuthPasskeysLoginVerifyPostBody = zod.record(zod.string(), zod.unknown())

export const VerifyLoginPasskeyAuthPasskeysLoginVerifyPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Begin the passkey verification process
 * @summary Create Verification Passkey
 */
export const CreateVerificationPasskeyAuthPasskeysVerificationCreatePostQueryParams = zod.object({
  "email": zod.string()
})

export const CreateVerificationPasskeyAuthPasskeysVerificationCreatePostResponse = zod.unknown()

/**
 * Verify the passkey verification
 * @summary Verify Verification Passkey
 */
export const VerifyVerificationPasskeyAuthPasskeysVerificationVerifyPostQueryParams = zod.object({
  "challenge_uuid": zod.uuid(),
  "email": zod.string()
})

export const VerifyVerificationPasskeyAuthPasskeysVerificationVerifyPostBody = zod.record(zod.string(), zod.unknown())

export const VerifyVerificationPasskeyAuthPasskeysVerificationVerifyPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Get the passkeys for the current user
 * @summary Get Passkeys
 */
export const GetPasskeysAuthPasskeysGetGetResponseItem = zod.object({
  "uuid": zod.uuid(),
  "label": zod.union([zod.string(),zod.null()]),
  "created_at": zod.iso.datetime({"offset":true})
})
export const GetPasskeysAuthPasskeysGetGetResponse = zod.array(GetPasskeysAuthPasskeysGetGetResponseItem)

/**
 * Delete a passkey on the server
 *
 * Parameters:
 *     uuid (uuid): The uuid of the passkey to delete
 *
 * Returns:
 *     MessageResponse: A message indicating that the passkey was deleted
 * @summary Delete Passkey
 */
export const DeletePasskeyAuthPasskeysDeleteUuidDeleteParams = zod.object({
  "uuid": zod.uuid()
})

export const DeletePasskeyAuthPasskeysDeleteUuidDeleteResponse = zod.object({
  "message": zod.string()
})

/**
 * Change the password for the current user
 *
 * Requires either verification_code_uuid or passkey_uuid to change a password
 * @summary Change Password
 */
export const ChangePasswordAuthChangePasswordPostBody = zod.object({
  "password": zod.string(),
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()]).optional(),
  "passkey_uuid": zod.union([zod.uuid(),zod.null()]).optional()
})

export const ChangePasswordAuthChangePasswordPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Change the email for the current user
 *
 * Requires either verification_code_uuid or passkey_uuid to change an email
 * @summary Change Email
 */
export const ChangeEmailAuthChangeEmailPostBody = zod.object({
  "email": zod.string(),
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()]).optional(),
  "passkey_uuid": zod.union([zod.uuid(),zod.null()]).optional()
})

export const ChangeEmailAuthChangeEmailPostResponse = zod.object({
  "message": zod.string()
})

/**
 * Delete the current user's account
 *
 * Requires either verification_code_uuid or passkey_uuid to delete the account
 * @summary Delete Account
 */
export const DeleteAccountAuthMeDeleteAccountDeleteBody = zod.object({
  "delete_data": zod.boolean(),
  "verification_code_uuid": zod.union([zod.uuid(),zod.null()]).optional(),
  "passkey_uuid": zod.union([zod.uuid(),zod.null()]).optional()
})

export const DeleteAccountAuthMeDeleteAccountDeleteResponse = zod.object({
  "message": zod.string()
})

