/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddGpgKeyParams } from '../models/AddGpgKeyParams';
import type { AddSshKeyParams } from '../models/AddSshKeyParams';
import type { ApiEmptyResponse } from '../models/ApiEmptyResponse';
import type { ApiResponse_AvatarData } from '../models/ApiResponse_AvatarData';
import type { ApiResponse_CreatePersonalAccessTokenResponse } from '../models/ApiResponse_CreatePersonalAccessTokenResponse';
import type { ApiResponse_String } from '../models/ApiResponse_String';
import type { ApiResponse_User } from '../models/ApiResponse_User';
import type { ApiResponse_UserAppearance } from '../models/ApiResponse_UserAppearance';
import type { ApiResponse_UserBlock } from '../models/ApiResponse_UserBlock';
import type { ApiResponse_UserFollow } from '../models/ApiResponse_UserFollow';
import type { ApiResponse_UserGpgKey } from '../models/ApiResponse_UserGpgKey';
import type { ApiResponse_UserNotifySetting } from '../models/ApiResponse_UserNotifySetting';
import type { ApiResponse_UserPresence } from '../models/ApiResponse_UserPresence';
import type { ApiResponse_UserProfile } from '../models/ApiResponse_UserProfile';
import type { ApiResponse_UserSshKey } from '../models/ApiResponse_UserSshKey';
import type { ApiResponse_Vec_UserBlock } from '../models/ApiResponse_Vec_UserBlock';
import type { ApiResponse_Vec_UserDevice } from '../models/ApiResponse_Vec_UserDevice';
import type { ApiResponse_Vec_UserFollow } from '../models/ApiResponse_Vec_UserFollow';
import type { ApiResponse_Vec_UserGpgKey } from '../models/ApiResponse_Vec_UserGpgKey';
import type { ApiResponse_Vec_UserOAuthInfo } from '../models/ApiResponse_Vec_UserOAuthInfo';
import type { ApiResponse_Vec_UserPersonalAccessTokenInfo } from '../models/ApiResponse_Vec_UserPersonalAccessTokenInfo';
import type { ApiResponse_Vec_UserSecurityLog } from '../models/ApiResponse_Vec_UserSecurityLog';
import type { ApiResponse_Vec_UserSessionInfo } from '../models/ApiResponse_Vec_UserSessionInfo';
import type { ApiResponse_Vec_UserSshKey } from '../models/ApiResponse_Vec_UserSshKey';
import type { BlockBody } from '../models/BlockBody';
import type { CreateTokenBody } from '../models/CreateTokenBody';
import type { DeviceType } from '../models/DeviceType';
import type { PresenceStatus } from '../models/PresenceStatus';
import type { Scope } from '../models/Scope';
import type { UpdatePresenceBody } from '../models/UpdatePresenceBody';
import type { UpdateUserAccountParams } from '../models/UpdateUserAccountParams';
import type { UpdateUserAppearanceParams } from '../models/UpdateUserAppearanceParams';
import type { UpdateUserNotifySettingParams } from '../models/UpdateUserNotifySettingParams';
import type { UpdateUserProfileParams } from '../models/UpdateUserProfileParams';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class UserService {
	/**
	 * Get current user account
	 * Returns the authenticated user's account information including:
	 * - Username, display name, and bio
	 * - Avatar URL
	 * - Account status and role
	 * - Last login and creation timestamps
	 *
	 * Requires authentication.
	 * @returns ApiResponse_User Account retrieved successfully. Returns user account with all metadata.
	 * @throws ApiError
	 */
	public static userGetAccount(): CancelablePromise<ApiResponse_User> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/account',
			errors: {
				401: `Authentication required or session expired`,
				404: `User not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update user account
	 * Updates the authenticated user's account settings.
	 * Requires authentication.
	 *
	 * Updatable fields:
	 * - username: New username (must be unique across the platform)
	 * - display_name: Human-readable display name
	 * - bio: Short biography text
	 * - visibility: Profile visibility ("public", "private", or "internal")
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated user account with all metadata.
	 * @returns ApiResponse_User Account updated successfully. Returns updated user account with all metadata.
	 * @throws ApiError
	 */
	public static userUpdateAccount({
		requestBody,
	}: {
		/**
		 * Account update parameters (all fields optional)
		 */
		requestBody: UpdateUserAccountParams,
	}): CancelablePromise<ApiResponse_User> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/user/account',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: empty username or unsupported visibility value`,
				401: `Authentication required or session expired`,
				404: `User not found`,
				409: `Username already taken`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete user account
	 * Marks the authenticated user's account and all associated data for deletion.
	 * The user's data is soft-deleted (marked as deleted, not physically removed).
	 * A restore link is sent to the user's verified email, valid for 30 days.
	 * Requires authentication and a verified email address.
	 *
	 * Preconditions:
	 * - User must have at least one verified email address
	 * - User must transfer or delete all owned workspaces
	 * - User must transfer or delete all owned repositories
	 *
	 * Effects:
	 * - All user data is soft-deleted (SSH keys, GPG keys, sessions, devices, etc.)
	 * - Current session is cleared
	 * - A restore token is generated and sent via email
	 * - Account can be restored within 30 days using the restore link
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Account marked for deletion. A restore link has been sent to your email.
	 * @throws ApiError
	 */
	public static userDeleteAccount(): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/account',
			errors: {
				400: `Cannot delete: user still owns workspaces or repositories, or no verified email`,
				401: `Authentication required or session expired`,
				404: `User not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Upload user avatar
	 * Uploads a new avatar image for the authenticated user.
	 * Requires authentication. Accepts multipart/form-data with a single "avatar" field.
	 *
	 * Supported formats: PNG, JPEG, WebP, GIF (max 5MB).
	 *
	 * Effects:
	 * - Avatar image is stored in S3-compatible object storage
	 * - Previous avatar is deleted from storage
	 * - User's avatar URL is updated
	 *
	 * Returns the new avatar URL and storage key.
	 * @returns ApiResponse_AvatarData Avatar uploaded successfully
	 * @throws ApiError
	 */
	public static userUploadAvatar({
		requestBody,
	}: {
		/**
		 * Avatar image file in a multipart form field named 'avatar'.
		 */
		requestBody?: any,
	}): CancelablePromise<ApiResponse_AvatarData> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/account/avatar',
			body: requestBody,
			errors: {
				400: `Invalid parameters: unsupported file type or image too large`,
				401: `Authentication required or session expired`,
				404: `User not found`,
				500: `Internal server error or S3 storage failure`,
			},
		});
	}
	/**
	 * Get user appearance settings
	 * Returns the authenticated user's UI appearance preferences including:
	 * - Theme (system, light, dark)
	 * - Color scheme (system, light, dark)
	 * - Density (compact, comfortable)
	 * - Font size (small, medium, large)
	 * - Editor theme
	 * - Markdown preview toggle
	 * - Reduced motion toggle
	 *
	 * If no settings exist, defaults are created automatically.
	 * Requires authentication.
	 * @returns ApiResponse_UserAppearance Appearance settings retrieved successfully. Returns all UI preference settings.
	 * @throws ApiError
	 */
	public static userGetAppearance(): CancelablePromise<ApiResponse_UserAppearance> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/appearance',
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update user appearance settings
	 * Updates the authenticated user's UI appearance preferences.
	 * Requires authentication.
	 *
	 * Updatable fields:
	 * - theme: UI theme ("system", "light", "dark")
	 * - color_scheme: Color scheme ("system", "light", "dark")
	 * - density: UI density ("compact", "comfortable")
	 * - font_size: Font size ("small", "medium", "large")
	 * - editor_theme: Code editor theme name
	 * - markdown_preview: Enable/disable markdown live preview
	 * - reduced_motion: Enable/disable reduced motion
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated appearance settings.
	 * @returns ApiResponse_UserAppearance Appearance settings updated successfully. Returns all updated UI preferences.
	 * @throws ApiError
	 */
	public static userUpdateAppearance({
		requestBody,
	}: {
		/**
		 * Appearance update parameters (all fields optional)
		 */
		requestBody: UpdateUserAppearanceParams,
	}): CancelablePromise<ApiResponse_UserAppearance> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/user/appearance',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: unsupported theme, color scheme, density, or font size`,
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List blocked users
	 * Returns a paginated list of users blocked by the authenticated user.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserBlock Blocked users listed successfully.
	 * @throws ApiError
	 */
	public static userListBlocks({
		limit,
		offset,
	}: {
		/**
		 * Maximum number of blocks to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of blocks to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserBlock> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/blocks',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Block a user
	 * Blocks the specified user. Once blocked, neither user can see the other's
	 * content or interact in shared channels. Requires authentication.
	 * @returns ApiResponse_UserBlock User blocked successfully.
	 * @throws ApiError
	 */
	public static userBlockUser({
		targetUserId,
		requestBody,
	}: {
		/**
		 * User ID to block
		 */
		targetUserId: string,
		requestBody?: BlockBody,
	}): CancelablePromise<ApiResponse_UserBlock> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/blocks/{target_user_id}',
			path: {
				'target_user_id': targetUserId,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid request (e.g., blocking yourself)`,
				401: `Authentication required or session expired`,
				409: `User is already blocked`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unblock a user
	 * Removes a previously applied block on the specified user. Requires authentication.
	 * @returns ApiEmptyResponse User unblocked successfully.
	 * @throws ApiError
	 */
	public static userUnblockUser({
		targetUserId,
	}: {
		/**
		 * User ID to unblock
		 */
		targetUserId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/blocks/{target_user_id}',
			path: {
				'target_user_id': targetUserId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Block not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List followed users
	 * Returns a paginated list of users followed by the authenticated user.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserFollow Follows listed successfully.
	 * @throws ApiError
	 */
	public static userListFollows({
		limit,
		offset,
	}: {
		/**
		 * Maximum number of follows to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of follows to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserFollow> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/follows',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Follow a user
	 * Starts following the specified user. Requires authentication.
	 * @returns ApiResponse_UserFollow User followed successfully.
	 * @throws ApiError
	 */
	public static userFollowUser({
		targetUserId,
	}: {
		/**
		 * User ID to follow
		 */
		targetUserId: string,
	}): CancelablePromise<ApiResponse_UserFollow> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/follows/{target_user_id}',
			path: {
				'target_user_id': targetUserId,
			},
			errors: {
				400: `Invalid request (e.g., following yourself)`,
				401: `Authentication required or session expired`,
				409: `Already following this user`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unfollow a user
	 * Stops following the specified user. Requires authentication.
	 * @returns ApiEmptyResponse User unfollowed successfully.
	 * @throws ApiError
	 */
	public static userUnfollowUser({
		targetUserId,
	}: {
		/**
		 * User ID to unfollow
		 */
		targetUserId: string,
	}): CancelablePromise<ApiEmptyResponse> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/follows/{target_user_id}',
			path: {
				'target_user_id': targetUserId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Follow not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List user GPG keys
	 * Returns all GPG public keys registered by the authenticated user.
	 * Keys are sorted by creation date (newest first).
	 * Only non-revoked keys are included.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserGpgKey GPG keys listed successfully. Returns array of GPG key objects with fingerprints and metadata.
	 * @throws ApiError
	 */
	public static userListGpgKeys({
		limit,
		offset,
	}: {
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserGpgKey> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/keys/gpg',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Add a GPG key
	 * Registers a new GPG public key for the authenticated user.
	 * Requires authentication.
	 *
	 * Parameters:
	 * - public_key: ASCII-armored PGP public key block
	 * - key_id: Short key ID or full fingerprint
	 * - primary_email: Primary email associated with the key (optional)
	 * - expires_at: Optional expiration date for the key
	 *
	 * Effects:
	 * - Key fingerprint is computed and stored
	 * - Key is immediately usable for verifying signed commits/tags
	 * - Duplicate keys are rejected
	 *
	 * Returns the created GPG key with fingerprint and metadata.
	 * @returns ApiResponse_UserGpgKey GPG key added successfully. Returns the created key with fingerprint and metadata.
	 * @throws ApiError
	 */
	public static userAddGpgKey({
		requestBody,
	}: {
		/**
		 * GPG key creation parameters
		 */
		requestBody: AddGpgKeyParams,
	}): CancelablePromise<ApiResponse_UserGpgKey> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/keys/gpg',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: invalid PGP key format`,
				401: `Authentication required or session expired`,
				409: `GPG key with this fingerprint already exists`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a GPG key
	 * Revokes a GPG key belonging to the authenticated user.
	 * Requires authentication.
	 *
	 * Effects:
	 * - Key is marked as revoked (soft-deleted)
	 * - Key can no longer be used for verifying commits/tags
	 * - Revoked keys remain visible in key history
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String GPG key revoked successfully.
	 * @throws ApiError
	 */
	public static userDeleteGpgKey({
		keyId,
	}: {
		/**
		 * GPG key ID (UUID)
		 */
		keyId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/keys/gpg/{key_id}',
			path: {
				'key_id': keyId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `GPG key not found or already revoked`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List user SSH keys
	 * Returns all SSH public keys registered by the authenticated user.
	 * Keys are sorted by creation date (newest first).
	 * Only non-revoked keys are included.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserSshKey SSH keys listed successfully. Returns array of SSH key objects with fingerprints and metadata.
	 * @throws ApiError
	 */
	public static userListSshKeys({
		limit,
		offset,
	}: {
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserSshKey> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/keys/ssh',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Add an SSH key
	 * Registers a new SSH public key for the authenticated user.
	 * Requires authentication.
	 *
	 * Parameters:
	 * - title: Human-readable label for the key (e.g., "Work Laptop")
	 * - public_key: SSH public key string (supports RSA, Ed25519, ECDSA, DSA)
	 * - key_type: Key algorithm type ("rsa", "ed25519", "ecdsa", "dsa")
	 * - expires_at: Optional expiration date for the key
	 *
	 * Effects:
	 * - Key fingerprint is computed and stored
	 * - Key is immediately usable for Git operations
	 * - Duplicate keys are rejected
	 *
	 * Returns the created SSH key with fingerprint and metadata.
	 * @returns ApiResponse_UserSshKey SSH key added successfully. Returns the created key with fingerprint and metadata.
	 * @throws ApiError
	 */
	public static userAddSshKey({
		requestBody,
	}: {
		/**
		 * SSH key creation parameters
		 */
		requestBody: AddSshKeyParams,
	}): CancelablePromise<ApiResponse_UserSshKey> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/keys/ssh',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: invalid key format, unsupported key type, or type mismatch`,
				401: `Authentication required or session expired`,
				409: `SSH key with this fingerprint already exists`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete an SSH key
	 * Revokes an SSH key belonging to the authenticated user.
	 * Requires authentication.
	 *
	 * Effects:
	 * - Key is marked as revoked (soft-deleted)
	 * - Key can no longer be used for Git operations
	 * - Revoked keys remain visible in key history
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String SSH key revoked successfully.
	 * @throws ApiError
	 */
	public static userDeleteSshKey({
		keyId,
	}: {
		/**
		 * SSH key ID (UUID)
		 */
		keyId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/keys/ssh/{key_id}',
			path: {
				'key_id': keyId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `SSH key not found or already revoked`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get user notification settings
	 * Returns the authenticated user's notification preferences including:
	 * - Email notification toggle
	 * - Web push notification toggle
	 * - Mention notification toggle
	 * - Review notification toggle
	 * - Security notification toggle
	 * - Marketing email toggle
	 * - Digest frequency (realtime, daily, weekly, off)
	 *
	 * If no settings exist, defaults are created automatically.
	 * Requires authentication.
	 * @returns ApiResponse_UserNotifySetting Notification settings retrieved successfully. Returns all notification preferences.
	 * @throws ApiError
	 */
	public static userGetNotifications(): CancelablePromise<ApiResponse_UserNotifySetting> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/notifications',
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update user notification settings
	 * Updates the authenticated user's notification preferences.
	 * Requires authentication.
	 *
	 * Updatable fields:
	 * - email_notifications: Enable/disable email notifications
	 * - web_notifications: Enable/disable web push notifications
	 * - mention_notifications: Enable/disable @mention notifications
	 * - review_notifications: Enable/disable code review notifications
	 * - security_notifications: Enable/disable security notifications
	 * - marketing_emails: Enable/disable marketing emails
	 * - digest_frequency: Digest email frequency ("realtime", "daily", "weekly", "off")
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated notification settings.
	 * @returns ApiResponse_UserNotifySetting Notification settings updated successfully. Returns all updated preferences.
	 * @throws ApiError
	 */
	public static userUpdateNotifications({
		requestBody,
	}: {
		/**
		 * Notification settings update parameters (all fields optional)
		 */
		requestBody: UpdateUserNotifySettingParams,
	}): CancelablePromise<ApiResponse_UserNotifySetting> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/user/notifications',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters: unsupported digest frequency`,
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get user presence
	 * Returns the current presence status for the authenticated user,
	 * including online/offline status, custom status text, and device information.
	 * Requires authentication.
	 * @returns ApiResponse_UserPresence Presence retrieved successfully.
	 * @throws ApiError
	 */
	public static userGetPresence(): CancelablePromise<ApiResponse_UserPresence> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/presence',
			errors: {
				401: `Authentication required or session expired`,
				404: `Presence not found for this user`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update user presence
	 * Updates the presence status for the authenticated user.
	 * Supports custom status text, emoji, device type, and IP address.
	 * Creates a new presence record if one does not exist.
	 * Requires authentication.
	 * @returns ApiResponse_UserPresence Presence updated successfully.
	 * @throws ApiError
	 */
	public static userUpdatePresence({
		status,
		customStatusText,
		customStatusEmoji,
		deviceType,
		ipAddress,
		requestBody,
	}: {
		/**
		 * New presence status
		 */
		status: PresenceStatus,
		/**
		 * Optional custom status text (e.g., "In a meeting")
		 */
		customStatusText: string | null,
		/**
		 * Optional custom status emoji (e.g., ":palm_tree:")
		 */
		customStatusEmoji: string | null,
		/**
		 * Device type the user is currently using
		 */
		deviceType: (null | DeviceType),
		/**
		 * IP address of the current session
		 */
		ipAddress: string | null,
		requestBody: UpdatePresenceBody,
	}): CancelablePromise<ApiResponse_UserPresence> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/user/presence',
			path: {
				'status': status,
				'custom_status_text': customStatusText,
				'custom_status_emoji': customStatusEmoji,
				'device_type': deviceType,
				'ip_address': ipAddress,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid request body`,
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Get user profile
	 * Returns the authenticated user's public profile information including:
	 * - Full name and company
	 * - Location and website URL
	 * - Twitter username
	 * - Timezone and language
	 * - Profile README
	 *
	 * If no profile exists, an empty profile is created automatically.
	 * Requires authentication.
	 * @returns ApiResponse_UserProfile Profile retrieved successfully. Returns all profile fields.
	 * @throws ApiError
	 */
	public static userGetProfile(): CancelablePromise<ApiResponse_UserProfile> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/profile',
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Update user profile
	 * Updates the authenticated user's public profile information.
	 * Requires authentication.
	 *
	 * Updatable fields:
	 * - full_name: Full legal name or display name
	 * - company: Organization or company name
	 * - location: Geographic location (e.g., "San Francisco, CA")
	 * - website_url: Personal or company website URL
	 * - twitter_username: Twitter/X handle
	 * - timezone: IANA timezone identifier (e.g., "America/New_York")
	 * - language: Preferred language code (e.g., "en", "zh-CN")
	 * - profile_readme: Markdown content for profile README
	 *
	 * All fields are optional; only provided fields are updated.
	 * Returns the updated profile with all fields.
	 * @returns ApiResponse_UserProfile Profile updated successfully. Returns all updated profile fields.
	 * @throws ApiError
	 */
	public static userUpdateProfile({
		requestBody,
	}: {
		/**
		 * Profile update parameters (all fields optional)
		 */
		requestBody: UpdateUserProfileParams,
	}): CancelablePromise<ApiResponse_UserProfile> {
		return __request(OpenAPI, {
			method: 'PUT',
			url: '/api/v1/user/profile',
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid parameters`,
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List user devices
	 * Returns all registered devices for the authenticated user.
	 * Devices are sorted by last seen time (most recent first).
	 * Includes device metadata such as name, type, fingerprint, and trust status.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserDevice Devices listed successfully. Returns array of device objects with metadata.
	 * @throws ApiError
	 */
	public static userListDevices({
		limit,
		offset,
	}: {
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserDevice> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/security/devices',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Delete a user device
	 * Removes a registered device from the authenticated user's trusted devices.
	 * Requires authentication.
	 *
	 * Effects:
	 * - Device is permanently removed
	 * - Device can no longer be used for 2FA bypass
	 * - Device will need to be re-registered and verified if needed
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Device deleted successfully.
	 * @throws ApiError
	 */
	public static userDeleteDevice({
		deviceId,
	}: {
		/**
		 * Device ID (UUID)
		 */
		deviceId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/security/devices/{device_id}',
			path: {
				'device_id': deviceId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Device not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List security logs
	 * Returns a paginated list of security events for the authenticated user.
	 * Entries are sorted by creation date (newest first).
	 * Includes event types, descriptions, IP addresses, and user agents.
	 * Useful for auditing account activity and detecting suspicious behavior.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserSecurityLog Security logs listed successfully. Returns array of security event entries with metadata.
	 * @throws ApiError
	 */
	public static userListSecurityLogs({
		limit,
		offset,
	}: {
		/**
		 * Maximum number of log entries to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of log entries to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserSecurityLog> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/security/logs',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List OAuth accounts
	 * Returns all linked OAuth/third-party login accounts for the authenticated user.
	 * Accounts are sorted by link date (most recent first).
	 * Includes provider information, usernames, and token expiry status.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserOAuthInfo OAuth accounts listed successfully. Returns array of linked OAuth accounts with provider details.
	 * @throws ApiError
	 */
	public static userListOAuthAccounts({
		limit,
		offset,
	}: {
		limit?: number | null,
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserOAuthInfo> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/security/oauth',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Unlink an OAuth account
	 * Removes a linked OAuth/third-party login account from the authenticated user.
	 * Requires authentication.
	 *
	 * Preconditions:
	 * - User must have at least one remaining login method (password or another OAuth account)
	 *
	 * Effects:
	 * - OAuth account link is permanently removed
	 * - User can no longer log in with this OAuth provider unless re-linked
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String OAuth account unlinked successfully.
	 * @throws ApiError
	 */
	public static userUnlinkOAuth({
		oauthId,
	}: {
		/**
		 * OAuth account ID (UUID)
		 */
		oauthId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/security/oauth/{oauth_id}',
			path: {
				'oauth_id': oauthId,
			},
			errors: {
				400: `Cannot unlink: this is the last login method (set a password first)`,
				401: `Authentication required or session expired`,
				404: `OAuth account not found`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List user sessions
	 * Returns a paginated list of all active and recently-expired sessions for the authenticated user.
	 * Sessions are sorted by last activity (most recent first).
	 * Includes session metadata such as IP address, user agent, and expiration time.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserSessionInfo Sessions listed successfully. Returns array of session objects with metadata.
	 * @throws ApiError
	 */
	public static userListSessions({
		limit,
		offset,
	}: {
		/**
		 * Maximum number of sessions to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of sessions to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserSessionInfo> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/security/sessions',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Revoke a user session
	 * Immediately terminates a specific session belonging to the authenticated user.
	 * Requires authentication.
	 *
	 * Effects:
	 * - Session is marked as revoked
	 * - Session can no longer be used for authentication
	 * - Active connections using this session are disconnected
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Session revoked successfully.
	 * @throws ApiError
	 */
	public static userRevokeSession({
		sessionId,
	}: {
		/**
		 * Session ID (UUID)
		 */
		sessionId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/security/sessions/{session_id}',
			path: {
				'session_id': sessionId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Session not found or already revoked`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * List personal access tokens
	 * Returns a paginated list of all personal access tokens (PATs) for the authenticated user.
	 * Tokens are sorted by creation date (newest first).
	 * Includes token names, scopes, last used timestamps, and expiry status.
	 * Note: Token values are never returned after creation for security reasons.
	 * Requires authentication.
	 * @returns ApiResponse_Vec_UserPersonalAccessTokenInfo Personal access tokens listed successfully. Returns array of token metadata objects (token values are never exposed).
	 * @throws ApiError
	 */
	public static userListTokens({
		limit,
		offset,
	}: {
		/**
		 * Maximum number of tokens to return (default: 50, max: 100)
		 */
		limit?: number | null,
		/**
		 * Number of tokens to skip for pagination (default: 0)
		 */
		offset?: number | null,
	}): CancelablePromise<ApiResponse_Vec_UserPersonalAccessTokenInfo> {
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/v1/user/security/tokens',
			query: {
				'limit': limit,
				'offset': offset,
			},
			errors: {
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Create a personal access token
	 * Creates a new personal access token (PAT) for the authenticated user.
	 * The full token value is returned in the response — this is the ONLY time it will be shown.
	 * Store it securely; it cannot be retrieved again.
	 * Requires authentication.
	 * @returns ApiResponse_CreatePersonalAccessTokenResponse Personal access token created successfully. The raw token value is included in the response and will never be shown again.
	 * @throws ApiError
	 */
	public static userCreateToken({
		name,
		scopes,
		expiresAt,
		requestBody,
	}: {
		/**
		 * Display name for the token (e.g., "My CLI Token")
		 */
		name: string,
		/**
		 * List of permission scopes assigned to the token
		 */
		scopes: Array<Scope>,
		/**
		 * Optional expiration date (UTC). If not set, the token never expires.
		 */
		expiresAt: string | null,
		requestBody: CreateTokenBody,
	}): CancelablePromise<ApiResponse_CreatePersonalAccessTokenResponse> {
		return __request(OpenAPI, {
			method: 'POST',
			url: '/api/v1/user/security/tokens',
			path: {
				'name': name,
				'scopes': scopes,
				'expires_at': expiresAt,
			},
			body: requestBody,
			mediaType: 'application/json',
			errors: {
				400: `Invalid request body (e.g., missing name or scopes)`,
				401: `Authentication required or session expired`,
				500: `Internal server error`,
			},
		});
	}
	/**
	 * Revoke a personal access token
	 * Immediately revokes a personal access token belonging to the authenticated user.
	 * Requires authentication.
	 *
	 * Effects:
	 * - Token is marked as revoked and can no longer be used
	 * - All API calls using this token will fail with 401 Unauthorized
	 * - Revoked tokens remain visible in token list for audit purposes
	 *
	 * Returns success message on completion.
	 * @returns ApiResponse_String Personal access token revoked successfully.
	 * @throws ApiError
	 */
	public static userRevokeToken({
		tokenId,
	}: {
		/**
		 * Token ID (UUID)
		 */
		tokenId: string,
	}): CancelablePromise<ApiResponse_String> {
		return __request(OpenAPI, {
			method: 'DELETE',
			url: '/api/v1/user/security/tokens/{token_id}',
			path: {
				'token_id': tokenId,
			},
			errors: {
				401: `Authentication required or session expired`,
				404: `Token not found or already revoked`,
				500: `Internal server error`,
			},
		});
	}
}
