// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * AvatarUrlResponse
 */
export const zAvatarUrlResponse = z.object({
  avatar_url: z.string(),
})

/**
 * AccountAvatarPayload
 */
export const zAccountAvatarPayload = z.object({
  avatar: z.string(),
})

/**
 * AccountResponse
 */
export const zAccountResponse = z.object({
  avatar: z.string().nullish(),
  avatar_url: z.string().nullable(),
  created_at: z.int().nullish(),
  email: z.string(),
  id: z.string(),
  interface_language: z.string().nullish(),
  interface_theme: z.string().nullish(),
  is_password_set: z.boolean(),
  last_login_at: z.int().nullish(),
  last_login_ip: z.string().nullish(),
  name: z.string(),
  timezone: z.string().nullish(),
})

/**
 * ChangeEmailSendPayload
 */
export const zChangeEmailSendPayload = z.object({
  email: z.string(),
  language: z.string().nullish(),
  phase: z.string().nullish(),
  token: z.string().nullish(),
})

/**
 * SimpleResultDataResponse
 */
export const zSimpleResultDataResponse = z.object({
  data: z.string(),
  result: z.string(),
})

/**
 * CheckEmailUniquePayload
 */
export const zCheckEmailUniquePayload = z.object({
  email: z.string(),
})

/**
 * SimpleResultResponse
 */
export const zSimpleResultResponse = z.object({
  result: z.string(),
})

/**
 * ChangeEmailResetPayload
 */
export const zChangeEmailResetPayload = z.object({
  new_email: z.string(),
  token: z.string(),
})

/**
 * ChangeEmailValidityPayload
 */
export const zChangeEmailValidityPayload = z.object({
  code: z.string(),
  email: z.string(),
  token: z.string(),
})

/**
 * VerificationTokenResponse
 */
export const zVerificationTokenResponse = z.object({
  email: z.string(),
  is_valid: z.boolean(),
  token: z.string(),
})

/**
 * AccountDeletePayload
 */
export const zAccountDeletePayload = z.object({
  code: z.string(),
  token: z.string(),
})

/**
 * AccountDeletionFeedbackPayload
 */
export const zAccountDeletionFeedbackPayload = z.object({
  email: z.string(),
  feedback: z.string(),
})

/**
 * EducationStatusResponse
 */
export const zEducationStatusResponse = z.object({
  allow_refresh: z.boolean().nullish(),
  expire_at: z.int().nullish(),
  is_student: z.boolean().nullish(),
  result: z.boolean().nullish(),
})

/**
 * EducationActivatePayload
 */
export const zEducationActivatePayload = z.object({
  institution: z.string(),
  role: z.string(),
  token: z.string(),
})

/**
 * EducationAutocompleteResponse
 */
export const zEducationAutocompleteResponse = z.object({
  curr_page: z.int().nullish(),
  data: z.array(z.string()).optional(),
  has_next: z.boolean().nullish(),
})

/**
 * EducationVerifyResponse
 */
export const zEducationVerifyResponse = z.object({
  token: z.string().nullish(),
})

/**
 * AccountInitPayload
 */
export const zAccountInitPayload = z.object({
  interface_language: z.string(),
  invitation_code: z.string().nullish(),
  timezone: z.string(),
})

/**
 * AccountInterfaceLanguagePayload
 */
export const zAccountInterfaceLanguagePayload = z.object({
  interface_language: z.string(),
})

/**
 * AccountInterfaceThemePayload
 */
export const zAccountInterfaceThemePayload = z.object({
  interface_theme: z.enum(['dark', 'light']),
})

/**
 * AccountNamePayload
 */
export const zAccountNamePayload = z.object({
  name: z.string().min(3).max(30),
})

/**
 * AccountPasswordPayload
 */
export const zAccountPasswordPayload = z.object({
  new_password: z.string(),
  password: z.string().nullish(),
  repeat_new_password: z.string(),
})

/**
 * AccountTimezonePayload
 */
export const zAccountTimezonePayload = z.object({
  timezone: z.string(),
})

/**
 * AccountIntegrateResponse
 */
export const zAccountIntegrateResponse = z.object({
  created_at: z.int().nullish(),
  is_bound: z.boolean(),
  link: z.string().nullish(),
  provider: z.string(),
})

/**
 * AccountIntegrateListResponse
 */
export const zAccountIntegrateListResponse = z.object({
  data: z.array(zAccountIntegrateResponse),
})

/**
 * AccountResponse
 */
export const zAccountResponseWritable = z.object({
  avatar: z.string().nullish(),
  created_at: z.int().nullish(),
  email: z.string(),
  id: z.string(),
  interface_language: z.string().nullish(),
  interface_theme: z.string().nullish(),
  is_password_set: z.boolean(),
  last_login_at: z.int().nullish(),
  last_login_ip: z.string().nullish(),
  name: z.string(),
  timezone: z.string().nullish(),
})

export const zGetAccountAvatarQuery = z.object({
  avatar: z.string(),
})

/**
 * Success
 */
export const zGetAccountAvatarResponse = zAvatarUrlResponse

export const zPostAccountAvatarBody = zAccountAvatarPayload

/**
 * Success
 */
export const zPostAccountAvatarResponse = zAccountResponse

export const zPostAccountChangeEmailBody = zChangeEmailSendPayload

/**
 * Success
 */
export const zPostAccountChangeEmailResponse = zSimpleResultDataResponse

export const zPostAccountChangeEmailCheckEmailUniqueBody = zCheckEmailUniquePayload

/**
 * Success
 */
export const zPostAccountChangeEmailCheckEmailUniqueResponse = zSimpleResultResponse

export const zPostAccountChangeEmailResetBody = zChangeEmailResetPayload

/**
 * Success
 */
export const zPostAccountChangeEmailResetResponse = zAccountResponse

export const zPostAccountChangeEmailValidityBody = zChangeEmailValidityPayload

/**
 * Success
 */
export const zPostAccountChangeEmailValidityResponse = zVerificationTokenResponse

export const zPostAccountDeleteBody = zAccountDeletePayload

/**
 * Success
 */
export const zPostAccountDeleteResponse = zSimpleResultResponse

export const zPostAccountDeleteFeedbackBody = zAccountDeletionFeedbackPayload

/**
 * Success
 */
export const zPostAccountDeleteFeedbackResponse = zSimpleResultResponse

/**
 * Success
 */
export const zGetAccountDeleteVerifyResponse = zSimpleResultDataResponse

/**
 * Success
 */
export const zGetAccountEducationResponse = zEducationStatusResponse

export const zPostAccountEducationBody = zEducationActivatePayload

/**
 * Success
 */
export const zPostAccountEducationResponse = z.record(z.string(), z.unknown())

export const zGetAccountEducationAutocompleteQuery = z.object({
  keywords: z.string(),
  limit: z.int().optional().default(20),
  page: z.int().optional().default(0),
})

/**
 * Success
 */
export const zGetAccountEducationAutocompleteResponse = zEducationAutocompleteResponse

/**
 * Success
 */
export const zGetAccountEducationVerifyResponse = zEducationVerifyResponse

export const zPostAccountInitBody = zAccountInitPayload

/**
 * Success
 */
export const zPostAccountInitResponse = zSimpleResultResponse

/**
 * Success
 */
export const zGetAccountIntegratesResponse = zAccountIntegrateListResponse

export const zPostAccountInterfaceLanguageBody = zAccountInterfaceLanguagePayload

/**
 * Success
 */
export const zPostAccountInterfaceLanguageResponse = zAccountResponse

export const zPostAccountInterfaceThemeBody = zAccountInterfaceThemePayload

/**
 * Success
 */
export const zPostAccountInterfaceThemeResponse = zAccountResponse

export const zPostAccountNameBody = zAccountNamePayload

/**
 * Success
 */
export const zPostAccountNameResponse = zAccountResponse

export const zPostAccountPasswordBody = zAccountPasswordPayload

/**
 * Success
 */
export const zPostAccountPasswordResponse = zAccountResponse

/**
 * Success
 */
export const zGetAccountProfileResponse = zAccountResponse

export const zPostAccountTimezoneBody = zAccountTimezonePayload

/**
 * Success
 */
export const zPostAccountTimezoneResponse = zAccountResponse
