// @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
// @generated from file api/v1/user_service.proto (package memos.api.v1, syntax proto3)
/* eslint-disable */

import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
import type { State } from "./common_pb";
import { file_api_v1_common } from "./common_pb";
import { file_google_api_annotations } from "../../google/api/annotations_pb";
import { file_google_api_client } from "../../google/api/client_pb";
import { file_google_api_field_behavior } from "../../google/api/field_behavior_pb";
import { file_google_api_resource } from "../../google/api/resource_pb";
import type { EmptySchema, FieldMask, Timestamp } from "@bufbuild/protobuf/wkt";
import { file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file api/v1/user_service.proto.
 */
export const file_api_v1_user_service: GenFile = /*@__PURE__*/
  fileDesc(" ", [file_api_v1_common, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp]);

/**
 * @generated from message memos.api.v1.User
 */
export type User = Message<"memos.api.v1.User"> & {
  /**
   * The resource name of the user.
   * Format: users/{user}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * The role of the user.
   *
   * @generated from field: memos.api.v1.User.Role role = 2;
   */
  role: User_Role;

  /**
   * Required. The unique username for login.
   *
   * @generated from field: string username = 3;
   */
  username: string;

  /**
   * Optional. The email address of the user.
   *
   * @generated from field: string email = 4;
   */
  email: string;

  /**
   * Optional. The display name of the user.
   *
   * @generated from field: string display_name = 5;
   */
  displayName: string;

  /**
   * Optional. The avatar URL of the user.
   *
   * @generated from field: string avatar_url = 6;
   */
  avatarUrl: string;

  /**
   * Optional. The description of the user.
   *
   * @generated from field: string description = 7;
   */
  description: string;

  /**
   * Input only. The password for the user.
   *
   * @generated from field: string password = 8;
   */
  password: string;

  /**
   * The state of the user.
   *
   * @generated from field: memos.api.v1.State state = 9;
   */
  state: State;

  /**
   * Output only. The creation timestamp.
   *
   * @generated from field: google.protobuf.Timestamp create_time = 10;
   */
  createTime?: Timestamp;

  /**
   * Output only. The last update timestamp.
   *
   * @generated from field: google.protobuf.Timestamp update_time = 11;
   */
  updateTime?: Timestamp;
};

/**
 * Describes the message memos.api.v1.User.
 * Use `create(UserSchema)` to create a new message.
 */
export const UserSchema: GenMessage<User> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 0);

/**
 * User role enumeration.
 *
 * @generated from enum memos.api.v1.User.Role
 */
export enum User_Role {
  /**
   * @generated from enum value: ROLE_UNSPECIFIED = 0;
   */
  ROLE_UNSPECIFIED = 0,

  /**
   * Admin role with system access.
   *
   * @generated from enum value: ADMIN = 2;
   */
  ADMIN = 2,

  /**
   * User role with limited access.
   *
   * @generated from enum value: USER = 3;
   */
  USER = 3,
}

/**
 * Describes the enum memos.api.v1.User.Role.
 */
export const User_RoleSchema: GenEnum<User_Role> = /*@__PURE__*/
  enumDesc(file_api_v1_user_service, 0, 0);

/**
 * @generated from message memos.api.v1.ListUsersRequest
 */
export type ListUsersRequest = Message<"memos.api.v1.ListUsersRequest"> & {
  /**
   * Optional. The maximum number of users to return.
   * The service may return fewer than this value.
   * If unspecified, at most 50 users will be returned.
   * The maximum value is 1000; values above 1000 will be coerced to 1000.
   *
   * @generated from field: int32 page_size = 1;
   */
  pageSize: number;

  /**
   * Optional. A page token, received from a previous `ListUsers` call.
   * Provide this to retrieve the subsequent page.
   *
   * @generated from field: string page_token = 2;
   */
  pageToken: string;

  /**
   * Optional. Filter to apply to the list results.
   * Example: "username == 'steven'"
   * Supported operators: ==
   * Supported fields: username
   *
   * @generated from field: string filter = 3;
   */
  filter: string;

  /**
   * Optional. If true, show deleted users in the response.
   *
   * @generated from field: bool show_deleted = 4;
   */
  showDeleted: boolean;
};

/**
 * Describes the message memos.api.v1.ListUsersRequest.
 * Use `create(ListUsersRequestSchema)` to create a new message.
 */
export const ListUsersRequestSchema: GenMessage<ListUsersRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 1);

/**
 * @generated from message memos.api.v1.ListUsersResponse
 */
export type ListUsersResponse = Message<"memos.api.v1.ListUsersResponse"> & {
  /**
   * The list of users.
   *
   * @generated from field: repeated memos.api.v1.User users = 1;
   */
  users: User[];

  /**
   * A token that can be sent as `page_token` to retrieve the next page.
   * If this field is omitted, there are no subsequent pages.
   *
   * @generated from field: string next_page_token = 2;
   */
  nextPageToken: string;

  /**
   * The total count of users (may be approximate).
   *
   * @generated from field: int32 total_size = 3;
   */
  totalSize: number;
};

/**
 * Describes the message memos.api.v1.ListUsersResponse.
 * Use `create(ListUsersResponseSchema)` to create a new message.
 */
export const ListUsersResponseSchema: GenMessage<ListUsersResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 2);

/**
 * @generated from message memos.api.v1.BatchGetUsersRequest
 */
export type BatchGetUsersRequest = Message<"memos.api.v1.BatchGetUsersRequest"> & {
  /**
   * @generated from field: repeated string usernames = 1;
   */
  usernames: string[];
};

/**
 * Describes the message memos.api.v1.BatchGetUsersRequest.
 * Use `create(BatchGetUsersRequestSchema)` to create a new message.
 */
export const BatchGetUsersRequestSchema: GenMessage<BatchGetUsersRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 3);

/**
 * @generated from message memos.api.v1.BatchGetUsersResponse
 */
export type BatchGetUsersResponse = Message<"memos.api.v1.BatchGetUsersResponse"> & {
  /**
   * @generated from field: repeated memos.api.v1.User users = 1;
   */
  users: User[];
};

/**
 * Describes the message memos.api.v1.BatchGetUsersResponse.
 * Use `create(BatchGetUsersResponseSchema)` to create a new message.
 */
export const BatchGetUsersResponseSchema: GenMessage<BatchGetUsersResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 4);

/**
 * @generated from message memos.api.v1.GetUserRequest
 */
export type GetUserRequest = Message<"memos.api.v1.GetUserRequest"> & {
  /**
   * Required. The resource name of the user.
   * Format: users/{username}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * Optional. The fields to return in the response.
   * If not specified, all fields are returned.
   *
   * @generated from field: google.protobuf.FieldMask read_mask = 2;
   */
  readMask?: FieldMask;
};

/**
 * Describes the message memos.api.v1.GetUserRequest.
 * Use `create(GetUserRequestSchema)` to create a new message.
 */
export const GetUserRequestSchema: GenMessage<GetUserRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 5);

/**
 * @generated from message memos.api.v1.CreateUserRequest
 */
export type CreateUserRequest = Message<"memos.api.v1.CreateUserRequest"> & {
  /**
   * Required. The user to create.
   *
   * @generated from field: memos.api.v1.User user = 1;
   */
  user?: User;

  /**
   * Optional. The user ID to use for this user.
   * If empty, a unique ID will be generated.
   * Must match the pattern [a-z0-9-]+
   *
   * @generated from field: string user_id = 2;
   */
  userId: string;

  /**
   * Optional. If set, validate the request but don't actually create the user.
   *
   * @generated from field: bool validate_only = 3;
   */
  validateOnly: boolean;

  /**
   * Optional. An idempotency token that can be used to ensure that multiple
   * requests to create a user have the same result.
   *
   * @generated from field: string request_id = 4;
   */
  requestId: string;
};

/**
 * Describes the message memos.api.v1.CreateUserRequest.
 * Use `create(CreateUserRequestSchema)` to create a new message.
 */
export const CreateUserRequestSchema: GenMessage<CreateUserRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 6);

/**
 * @generated from message memos.api.v1.UpdateUserRequest
 */
export type UpdateUserRequest = Message<"memos.api.v1.UpdateUserRequest"> & {
  /**
   * Required. The user to update.
   *
   * @generated from field: memos.api.v1.User user = 1;
   */
  user?: User;

  /**
   * Required. The list of fields to update.
   *
   * @generated from field: google.protobuf.FieldMask update_mask = 2;
   */
  updateMask?: FieldMask;

  /**
   * Optional. If set to true, allows updating sensitive fields.
   *
   * @generated from field: bool allow_missing = 3;
   */
  allowMissing: boolean;
};

/**
 * Describes the message memos.api.v1.UpdateUserRequest.
 * Use `create(UpdateUserRequestSchema)` to create a new message.
 */
export const UpdateUserRequestSchema: GenMessage<UpdateUserRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 7);

/**
 * @generated from message memos.api.v1.DeleteUserRequest
 */
export type DeleteUserRequest = Message<"memos.api.v1.DeleteUserRequest"> & {
  /**
   * Required. The resource name of the user to delete.
   * Format: users/{user}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * Optional. If set to true, the user will be deleted even if they have associated data.
   *
   * @generated from field: bool force = 2;
   */
  force: boolean;
};

/**
 * Describes the message memos.api.v1.DeleteUserRequest.
 * Use `create(DeleteUserRequestSchema)` to create a new message.
 */
export const DeleteUserRequestSchema: GenMessage<DeleteUserRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 8);

/**
 * User statistics messages
 *
 * @generated from message memos.api.v1.UserStats
 */
export type UserStats = Message<"memos.api.v1.UserStats"> & {
  /**
   * The resource name of the user whose stats these are.
   * Format: users/{user}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * The timestamps when the memos were displayed.
   *
   * @generated from field: repeated google.protobuf.Timestamp memo_display_timestamps = 2;
   */
  memoDisplayTimestamps: Timestamp[];

  /**
   * The stats of memo types.
   *
   * @generated from field: memos.api.v1.UserStats.MemoTypeStats memo_type_stats = 3;
   */
  memoTypeStats?: UserStats_MemoTypeStats;

  /**
   * The count of tags.
   *
   * @generated from field: map<string, int32> tag_count = 4;
   */
  tagCount: { [key: string]: number };

  /**
   * The pinned memos of the user.
   *
   * @generated from field: repeated string pinned_memos = 5;
   */
  pinnedMemos: string[];

  /**
   * Total memo count.
   *
   * @generated from field: int32 total_memo_count = 6;
   */
  totalMemoCount: number;
};

/**
 * Describes the message memos.api.v1.UserStats.
 * Use `create(UserStatsSchema)` to create a new message.
 */
export const UserStatsSchema: GenMessage<UserStats> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 9);

/**
 * Memo type statistics.
 *
 * @generated from message memos.api.v1.UserStats.MemoTypeStats
 */
export type UserStats_MemoTypeStats = Message<"memos.api.v1.UserStats.MemoTypeStats"> & {
  /**
   * @generated from field: int32 link_count = 1;
   */
  linkCount: number;

  /**
   * @generated from field: int32 code_count = 2;
   */
  codeCount: number;

  /**
   * @generated from field: int32 todo_count = 3;
   */
  todoCount: number;

  /**
   * @generated from field: int32 undo_count = 4;
   */
  undoCount: number;
};

/**
 * Describes the message memos.api.v1.UserStats.MemoTypeStats.
 * Use `create(UserStats_MemoTypeStatsSchema)` to create a new message.
 */
export const UserStats_MemoTypeStatsSchema: GenMessage<UserStats_MemoTypeStats> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 9, 0);

/**
 * @generated from message memos.api.v1.GetUserStatsRequest
 */
export type GetUserStatsRequest = Message<"memos.api.v1.GetUserStatsRequest"> & {
  /**
   * Required. The resource name of the user.
   * Format: users/{user}
   *
   * @generated from field: string name = 1;
   */
  name: string;
};

/**
 * Describes the message memos.api.v1.GetUserStatsRequest.
 * Use `create(GetUserStatsRequestSchema)` to create a new message.
 */
export const GetUserStatsRequestSchema: GenMessage<GetUserStatsRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 10);

/**
 * This endpoint doesn't take any parameters.
 *
 * @generated from message memos.api.v1.ListAllUserStatsRequest
 */
export type ListAllUserStatsRequest = Message<"memos.api.v1.ListAllUserStatsRequest"> & {
};

/**
 * Describes the message memos.api.v1.ListAllUserStatsRequest.
 * Use `create(ListAllUserStatsRequestSchema)` to create a new message.
 */
export const ListAllUserStatsRequestSchema: GenMessage<ListAllUserStatsRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 11);

/**
 * @generated from message memos.api.v1.ListAllUserStatsResponse
 */
export type ListAllUserStatsResponse = Message<"memos.api.v1.ListAllUserStatsResponse"> & {
  /**
   * The list of user statistics.
   *
   * @generated from field: repeated memos.api.v1.UserStats stats = 1;
   */
  stats: UserStats[];
};

/**
 * Describes the message memos.api.v1.ListAllUserStatsResponse.
 * Use `create(ListAllUserStatsResponseSchema)` to create a new message.
 */
export const ListAllUserStatsResponseSchema: GenMessage<ListAllUserStatsResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 12);

/**
 * User settings message
 *
 * @generated from message memos.api.v1.UserSetting
 */
export type UserSetting = Message<"memos.api.v1.UserSetting"> & {
  /**
   * The name of the user setting.
   * Format: users/{username}/settings/{setting}, {setting} is the key for the setting.
   * For example, "users/steven/settings/GENERAL" for general settings.
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * @generated from oneof memos.api.v1.UserSetting.value
   */
  value: {
    /**
     * @generated from field: memos.api.v1.UserSetting.GeneralSetting general_setting = 2;
     */
    value: UserSetting_GeneralSetting;
    case: "generalSetting";
  } | {
    /**
     * @generated from field: memos.api.v1.UserSetting.WebhooksSetting webhooks_setting = 5;
     */
    value: UserSetting_WebhooksSetting;
    case: "webhooksSetting";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message memos.api.v1.UserSetting.
 * Use `create(UserSettingSchema)` to create a new message.
 */
export const UserSettingSchema: GenMessage<UserSetting> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 13);

/**
 * General user settings configuration.
 *
 * @generated from message memos.api.v1.UserSetting.GeneralSetting
 */
export type UserSetting_GeneralSetting = Message<"memos.api.v1.UserSetting.GeneralSetting"> & {
  /**
   * The preferred locale of the user.
   *
   * @generated from field: string locale = 1;
   */
  locale: string;

  /**
   * The default visibility of the memo.
   *
   * @generated from field: string memo_visibility = 3;
   */
  memoVisibility: string;

  /**
   * The preferred theme of the user.
   * This references a CSS file in the web/public/themes/ directory.
   * If not set, the default theme will be used.
   *
   * @generated from field: string theme = 4;
   */
  theme: string;
};

/**
 * Describes the message memos.api.v1.UserSetting.GeneralSetting.
 * Use `create(UserSetting_GeneralSettingSchema)` to create a new message.
 */
export const UserSetting_GeneralSettingSchema: GenMessage<UserSetting_GeneralSetting> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 13, 0);

/**
 * User webhooks configuration.
 *
 * @generated from message memos.api.v1.UserSetting.WebhooksSetting
 */
export type UserSetting_WebhooksSetting = Message<"memos.api.v1.UserSetting.WebhooksSetting"> & {
  /**
   * List of user webhooks.
   *
   * @generated from field: repeated memos.api.v1.UserWebhook webhooks = 1;
   */
  webhooks: UserWebhook[];
};

/**
 * Describes the message memos.api.v1.UserSetting.WebhooksSetting.
 * Use `create(UserSetting_WebhooksSettingSchema)` to create a new message.
 */
export const UserSetting_WebhooksSettingSchema: GenMessage<UserSetting_WebhooksSetting> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 13, 1);

/**
 * Enumeration of user setting keys.
 *
 * @generated from enum memos.api.v1.UserSetting.Key
 */
export enum UserSetting_Key {
  /**
   * @generated from enum value: KEY_UNSPECIFIED = 0;
   */
  KEY_UNSPECIFIED = 0,

  /**
   * GENERAL is the key for general user settings.
   *
   * @generated from enum value: GENERAL = 1;
   */
  GENERAL = 1,

  /**
   * WEBHOOKS is the key for user webhooks.
   *
   * @generated from enum value: WEBHOOKS = 4;
   */
  WEBHOOKS = 4,
}

/**
 * Describes the enum memos.api.v1.UserSetting.Key.
 */
export const UserSetting_KeySchema: GenEnum<UserSetting_Key> = /*@__PURE__*/
  enumDesc(file_api_v1_user_service, 13, 0);

/**
 * @generated from message memos.api.v1.GetUserSettingRequest
 */
export type GetUserSettingRequest = Message<"memos.api.v1.GetUserSettingRequest"> & {
  /**
   * Required. The resource name of the user setting.
   * Format: users/{user}/settings/{setting}
   *
   * @generated from field: string name = 1;
   */
  name: string;
};

/**
 * Describes the message memos.api.v1.GetUserSettingRequest.
 * Use `create(GetUserSettingRequestSchema)` to create a new message.
 */
export const GetUserSettingRequestSchema: GenMessage<GetUserSettingRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 14);

/**
 * @generated from message memos.api.v1.UpdateUserSettingRequest
 */
export type UpdateUserSettingRequest = Message<"memos.api.v1.UpdateUserSettingRequest"> & {
  /**
   * Required. The user setting to update.
   *
   * @generated from field: memos.api.v1.UserSetting setting = 1;
   */
  setting?: UserSetting;

  /**
   * Required. The list of fields to update.
   *
   * @generated from field: google.protobuf.FieldMask update_mask = 2;
   */
  updateMask?: FieldMask;
};

/**
 * Describes the message memos.api.v1.UpdateUserSettingRequest.
 * Use `create(UpdateUserSettingRequestSchema)` to create a new message.
 */
export const UpdateUserSettingRequestSchema: GenMessage<UpdateUserSettingRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 15);

/**
 * Request message for ListUserSettings method.
 *
 * @generated from message memos.api.v1.ListUserSettingsRequest
 */
export type ListUserSettingsRequest = Message<"memos.api.v1.ListUserSettingsRequest"> & {
  /**
   * Required. The parent resource whose settings will be listed.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;

  /**
   * Optional. The maximum number of settings to return.
   * The service may return fewer than this value.
   * If unspecified, at most 50 settings will be returned.
   * The maximum value is 1000; values above 1000 will be coerced to 1000.
   *
   * @generated from field: int32 page_size = 2;
   */
  pageSize: number;

  /**
   * Optional. A page token, received from a previous `ListUserSettings` call.
   * Provide this to retrieve the subsequent page.
   *
   * @generated from field: string page_token = 3;
   */
  pageToken: string;
};

/**
 * Describes the message memos.api.v1.ListUserSettingsRequest.
 * Use `create(ListUserSettingsRequestSchema)` to create a new message.
 */
export const ListUserSettingsRequestSchema: GenMessage<ListUserSettingsRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 16);

/**
 * Response message for ListUserSettings method.
 *
 * @generated from message memos.api.v1.ListUserSettingsResponse
 */
export type ListUserSettingsResponse = Message<"memos.api.v1.ListUserSettingsResponse"> & {
  /**
   * The list of user settings.
   *
   * @generated from field: repeated memos.api.v1.UserSetting settings = 1;
   */
  settings: UserSetting[];

  /**
   * A token that can be sent as `page_token` to retrieve the next page.
   * If this field is omitted, there are no subsequent pages.
   *
   * @generated from field: string next_page_token = 2;
   */
  nextPageToken: string;

  /**
   * The total count of settings (may be approximate).
   *
   * @generated from field: int32 total_size = 3;
   */
  totalSize: number;
};

/**
 * Describes the message memos.api.v1.ListUserSettingsResponse.
 * Use `create(ListUserSettingsResponseSchema)` to create a new message.
 */
export const ListUserSettingsResponseSchema: GenMessage<ListUserSettingsResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 17);

/**
 * PersonalAccessToken represents a long-lived token for API/script access.
 * PATs are distinct from short-lived JWT access tokens used for session authentication.
 *
 * @generated from message memos.api.v1.PersonalAccessToken
 */
export type PersonalAccessToken = Message<"memos.api.v1.PersonalAccessToken"> & {
  /**
   * The resource name of the personal access token.
   * Format: users/{user}/personalAccessTokens/{personal_access_token}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * The description of the token.
   *
   * @generated from field: string description = 2;
   */
  description: string;

  /**
   * Output only. The creation timestamp.
   *
   * @generated from field: google.protobuf.Timestamp created_at = 3;
   */
  createdAt?: Timestamp;

  /**
   * Optional. The expiration timestamp.
   *
   * @generated from field: google.protobuf.Timestamp expires_at = 4;
   */
  expiresAt?: Timestamp;

  /**
   * Output only. The last used timestamp.
   *
   * @generated from field: google.protobuf.Timestamp last_used_at = 5;
   */
  lastUsedAt?: Timestamp;
};

/**
 * Describes the message memos.api.v1.PersonalAccessToken.
 * Use `create(PersonalAccessTokenSchema)` to create a new message.
 */
export const PersonalAccessTokenSchema: GenMessage<PersonalAccessToken> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 18);

/**
 * @generated from message memos.api.v1.ListPersonalAccessTokensRequest
 */
export type ListPersonalAccessTokensRequest = Message<"memos.api.v1.ListPersonalAccessTokensRequest"> & {
  /**
   * Required. The parent resource whose personal access tokens will be listed.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;

  /**
   * Optional. The maximum number of tokens to return.
   *
   * @generated from field: int32 page_size = 2;
   */
  pageSize: number;

  /**
   * Optional. A page token for pagination.
   *
   * @generated from field: string page_token = 3;
   */
  pageToken: string;
};

/**
 * Describes the message memos.api.v1.ListPersonalAccessTokensRequest.
 * Use `create(ListPersonalAccessTokensRequestSchema)` to create a new message.
 */
export const ListPersonalAccessTokensRequestSchema: GenMessage<ListPersonalAccessTokensRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 19);

/**
 * @generated from message memos.api.v1.ListPersonalAccessTokensResponse
 */
export type ListPersonalAccessTokensResponse = Message<"memos.api.v1.ListPersonalAccessTokensResponse"> & {
  /**
   * The list of personal access tokens.
   *
   * @generated from field: repeated memos.api.v1.PersonalAccessToken personal_access_tokens = 1;
   */
  personalAccessTokens: PersonalAccessToken[];

  /**
   * A token for the next page of results.
   *
   * @generated from field: string next_page_token = 2;
   */
  nextPageToken: string;

  /**
   * The total count of personal access tokens.
   *
   * @generated from field: int32 total_size = 3;
   */
  totalSize: number;
};

/**
 * Describes the message memos.api.v1.ListPersonalAccessTokensResponse.
 * Use `create(ListPersonalAccessTokensResponseSchema)` to create a new message.
 */
export const ListPersonalAccessTokensResponseSchema: GenMessage<ListPersonalAccessTokensResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 20);

/**
 * @generated from message memos.api.v1.CreatePersonalAccessTokenRequest
 */
export type CreatePersonalAccessTokenRequest = Message<"memos.api.v1.CreatePersonalAccessTokenRequest"> & {
  /**
   * Required. The parent resource where this token will be created.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;

  /**
   * Optional. Description of the personal access token.
   *
   * @generated from field: string description = 2;
   */
  description: string;

  /**
   * Optional. Expiration duration in days (0 = never expires).
   *
   * @generated from field: int32 expires_in_days = 3;
   */
  expiresInDays: number;
};

/**
 * Describes the message memos.api.v1.CreatePersonalAccessTokenRequest.
 * Use `create(CreatePersonalAccessTokenRequestSchema)` to create a new message.
 */
export const CreatePersonalAccessTokenRequestSchema: GenMessage<CreatePersonalAccessTokenRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 21);

/**
 * @generated from message memos.api.v1.CreatePersonalAccessTokenResponse
 */
export type CreatePersonalAccessTokenResponse = Message<"memos.api.v1.CreatePersonalAccessTokenResponse"> & {
  /**
   * The personal access token metadata.
   *
   * @generated from field: memos.api.v1.PersonalAccessToken personal_access_token = 1;
   */
  personalAccessToken?: PersonalAccessToken;

  /**
   * The actual token value - only returned on creation.
   * This is the only time the token value will be visible.
   *
   * @generated from field: string token = 2;
   */
  token: string;
};

/**
 * Describes the message memos.api.v1.CreatePersonalAccessTokenResponse.
 * Use `create(CreatePersonalAccessTokenResponseSchema)` to create a new message.
 */
export const CreatePersonalAccessTokenResponseSchema: GenMessage<CreatePersonalAccessTokenResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 22);

/**
 * @generated from message memos.api.v1.DeletePersonalAccessTokenRequest
 */
export type DeletePersonalAccessTokenRequest = Message<"memos.api.v1.DeletePersonalAccessTokenRequest"> & {
  /**
   * Required. The resource name of the personal access token to delete.
   * Format: users/{user}/personalAccessTokens/{personal_access_token}
   *
   * @generated from field: string name = 1;
   */
  name: string;
};

/**
 * Describes the message memos.api.v1.DeletePersonalAccessTokenRequest.
 * Use `create(DeletePersonalAccessTokenRequestSchema)` to create a new message.
 */
export const DeletePersonalAccessTokenRequestSchema: GenMessage<DeletePersonalAccessTokenRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 23);

/**
 * UserWebhook represents a webhook owned by a user.
 *
 * @generated from message memos.api.v1.UserWebhook
 */
export type UserWebhook = Message<"memos.api.v1.UserWebhook"> & {
  /**
   * The name of the webhook.
   * Format: users/{user}/webhooks/{webhook}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * The URL to send the webhook to.
   *
   * @generated from field: string url = 2;
   */
  url: string;

  /**
   * Optional. Human-readable name for the webhook.
   *
   * @generated from field: string display_name = 3;
   */
  displayName: string;

  /**
   * The creation time of the webhook.
   *
   * @generated from field: google.protobuf.Timestamp create_time = 4;
   */
  createTime?: Timestamp;

  /**
   * The last update time of the webhook.
   *
   * @generated from field: google.protobuf.Timestamp update_time = 5;
   */
  updateTime?: Timestamp;
};

/**
 * Describes the message memos.api.v1.UserWebhook.
 * Use `create(UserWebhookSchema)` to create a new message.
 */
export const UserWebhookSchema: GenMessage<UserWebhook> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 24);

/**
 * @generated from message memos.api.v1.ListUserWebhooksRequest
 */
export type ListUserWebhooksRequest = Message<"memos.api.v1.ListUserWebhooksRequest"> & {
  /**
   * The parent user resource.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;
};

/**
 * Describes the message memos.api.v1.ListUserWebhooksRequest.
 * Use `create(ListUserWebhooksRequestSchema)` to create a new message.
 */
export const ListUserWebhooksRequestSchema: GenMessage<ListUserWebhooksRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 25);

/**
 * @generated from message memos.api.v1.ListUserWebhooksResponse
 */
export type ListUserWebhooksResponse = Message<"memos.api.v1.ListUserWebhooksResponse"> & {
  /**
   * The list of webhooks.
   *
   * @generated from field: repeated memos.api.v1.UserWebhook webhooks = 1;
   */
  webhooks: UserWebhook[];
};

/**
 * Describes the message memos.api.v1.ListUserWebhooksResponse.
 * Use `create(ListUserWebhooksResponseSchema)` to create a new message.
 */
export const ListUserWebhooksResponseSchema: GenMessage<ListUserWebhooksResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 26);

/**
 * @generated from message memos.api.v1.CreateUserWebhookRequest
 */
export type CreateUserWebhookRequest = Message<"memos.api.v1.CreateUserWebhookRequest"> & {
  /**
   * The parent user resource.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;

  /**
   * The webhook to create.
   *
   * @generated from field: memos.api.v1.UserWebhook webhook = 2;
   */
  webhook?: UserWebhook;
};

/**
 * Describes the message memos.api.v1.CreateUserWebhookRequest.
 * Use `create(CreateUserWebhookRequestSchema)` to create a new message.
 */
export const CreateUserWebhookRequestSchema: GenMessage<CreateUserWebhookRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 27);

/**
 * @generated from message memos.api.v1.UpdateUserWebhookRequest
 */
export type UpdateUserWebhookRequest = Message<"memos.api.v1.UpdateUserWebhookRequest"> & {
  /**
   * The webhook to update.
   *
   * @generated from field: memos.api.v1.UserWebhook webhook = 1;
   */
  webhook?: UserWebhook;

  /**
   * The list of fields to update.
   *
   * @generated from field: google.protobuf.FieldMask update_mask = 2;
   */
  updateMask?: FieldMask;
};

/**
 * Describes the message memos.api.v1.UpdateUserWebhookRequest.
 * Use `create(UpdateUserWebhookRequestSchema)` to create a new message.
 */
export const UpdateUserWebhookRequestSchema: GenMessage<UpdateUserWebhookRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 28);

/**
 * @generated from message memos.api.v1.DeleteUserWebhookRequest
 */
export type DeleteUserWebhookRequest = Message<"memos.api.v1.DeleteUserWebhookRequest"> & {
  /**
   * The name of the webhook to delete.
   * Format: users/{user}/webhooks/{webhook}
   *
   * @generated from field: string name = 1;
   */
  name: string;
};

/**
 * Describes the message memos.api.v1.DeleteUserWebhookRequest.
 * Use `create(DeleteUserWebhookRequestSchema)` to create a new message.
 */
export const DeleteUserWebhookRequestSchema: GenMessage<DeleteUserWebhookRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 29);

/**
 * @generated from message memos.api.v1.UserNotification
 */
export type UserNotification = Message<"memos.api.v1.UserNotification"> & {
  /**
   * The resource name of the notification.
   * Format: users/{user}/notifications/{notification}
   *
   * @generated from field: string name = 1;
   */
  name: string;

  /**
   * The sender of the notification.
   * Format: users/{user}
   *
   * @generated from field: string sender = 2;
   */
  sender: string;

  /**
   * The sender user details.
   *
   * @generated from field: memos.api.v1.User sender_user = 8;
   */
  senderUser?: User;

  /**
   * The status of the notification.
   *
   * @generated from field: memos.api.v1.UserNotification.Status status = 3;
   */
  status: UserNotification_Status;

  /**
   * The creation timestamp.
   *
   * @generated from field: google.protobuf.Timestamp create_time = 4;
   */
  createTime?: Timestamp;

  /**
   * The type of the notification.
   *
   * @generated from field: memos.api.v1.UserNotification.Type type = 5;
   */
  type: UserNotification_Type;

  /**
   * @generated from oneof memos.api.v1.UserNotification.payload
   */
  payload: {
    /**
     * @generated from field: memos.api.v1.UserNotification.MemoCommentPayload memo_comment = 6;
     */
    value: UserNotification_MemoCommentPayload;
    case: "memoComment";
  } | {
    /**
     * @generated from field: memos.api.v1.UserNotification.MemoMentionPayload memo_mention = 7;
     */
    value: UserNotification_MemoMentionPayload;
    case: "memoMention";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message memos.api.v1.UserNotification.
 * Use `create(UserNotificationSchema)` to create a new message.
 */
export const UserNotificationSchema: GenMessage<UserNotification> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 30);

/**
 * @generated from message memos.api.v1.UserNotification.MemoCommentPayload
 */
export type UserNotification_MemoCommentPayload = Message<"memos.api.v1.UserNotification.MemoCommentPayload"> & {
  /**
   * The memo name of comment.
   * Format: memos/{memo}
   *
   * @generated from field: string memo = 1;
   */
  memo: string;

  /**
   * The name of related memo.
   * Format: memos/{memo}
   *
   * @generated from field: string related_memo = 2;
   */
  relatedMemo: string;

  /**
   * Preview text of the comment memo.
   *
   * @generated from field: string memo_snippet = 3;
   */
  memoSnippet: string;

  /**
   * Preview text of the related memo.
   *
   * @generated from field: string related_memo_snippet = 4;
   */
  relatedMemoSnippet: string;
};

/**
 * Describes the message memos.api.v1.UserNotification.MemoCommentPayload.
 * Use `create(UserNotification_MemoCommentPayloadSchema)` to create a new message.
 */
export const UserNotification_MemoCommentPayloadSchema: GenMessage<UserNotification_MemoCommentPayload> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 30, 0);

/**
 * @generated from message memos.api.v1.UserNotification.MemoMentionPayload
 */
export type UserNotification_MemoMentionPayload = Message<"memos.api.v1.UserNotification.MemoMentionPayload"> & {
  /**
   * The memo that contains the mention.
   * Format: memos/{memo}
   *
   * @generated from field: string memo = 1;
   */
  memo: string;

  /**
   * The related parent memo when the mention was created in a comment.
   * Format: memos/{memo}
   *
   * @generated from field: string related_memo = 2;
   */
  relatedMemo: string;

  /**
   * Preview text of the memo that contains the mention.
   *
   * @generated from field: string memo_snippet = 3;
   */
  memoSnippet: string;

  /**
   * Preview text of the related parent memo.
   *
   * @generated from field: string related_memo_snippet = 4;
   */
  relatedMemoSnippet: string;
};

/**
 * Describes the message memos.api.v1.UserNotification.MemoMentionPayload.
 * Use `create(UserNotification_MemoMentionPayloadSchema)` to create a new message.
 */
export const UserNotification_MemoMentionPayloadSchema: GenMessage<UserNotification_MemoMentionPayload> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 30, 1);

/**
 * @generated from enum memos.api.v1.UserNotification.Status
 */
export enum UserNotification_Status {
  /**
   * @generated from enum value: STATUS_UNSPECIFIED = 0;
   */
  STATUS_UNSPECIFIED = 0,

  /**
   * @generated from enum value: UNREAD = 1;
   */
  UNREAD = 1,

  /**
   * @generated from enum value: ARCHIVED = 2;
   */
  ARCHIVED = 2,
}

/**
 * Describes the enum memos.api.v1.UserNotification.Status.
 */
export const UserNotification_StatusSchema: GenEnum<UserNotification_Status> = /*@__PURE__*/
  enumDesc(file_api_v1_user_service, 30, 0);

/**
 * @generated from enum memos.api.v1.UserNotification.Type
 */
export enum UserNotification_Type {
  /**
   * @generated from enum value: TYPE_UNSPECIFIED = 0;
   */
  TYPE_UNSPECIFIED = 0,

  /**
   * @generated from enum value: MEMO_COMMENT = 1;
   */
  MEMO_COMMENT = 1,

  /**
   * @generated from enum value: MEMO_MENTION = 2;
   */
  MEMO_MENTION = 2,
}

/**
 * Describes the enum memos.api.v1.UserNotification.Type.
 */
export const UserNotification_TypeSchema: GenEnum<UserNotification_Type> = /*@__PURE__*/
  enumDesc(file_api_v1_user_service, 30, 1);

/**
 * @generated from message memos.api.v1.ListUserNotificationsRequest
 */
export type ListUserNotificationsRequest = Message<"memos.api.v1.ListUserNotificationsRequest"> & {
  /**
   * The parent user resource.
   * Format: users/{user}
   *
   * @generated from field: string parent = 1;
   */
  parent: string;

  /**
   * @generated from field: int32 page_size = 2;
   */
  pageSize: number;

  /**
   * @generated from field: string page_token = 3;
   */
  pageToken: string;

  /**
   * @generated from field: string filter = 4;
   */
  filter: string;
};

/**
 * Describes the message memos.api.v1.ListUserNotificationsRequest.
 * Use `create(ListUserNotificationsRequestSchema)` to create a new message.
 */
export const ListUserNotificationsRequestSchema: GenMessage<ListUserNotificationsRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 31);

/**
 * @generated from message memos.api.v1.ListUserNotificationsResponse
 */
export type ListUserNotificationsResponse = Message<"memos.api.v1.ListUserNotificationsResponse"> & {
  /**
   * @generated from field: repeated memos.api.v1.UserNotification notifications = 1;
   */
  notifications: UserNotification[];

  /**
   * @generated from field: string next_page_token = 2;
   */
  nextPageToken: string;
};

/**
 * Describes the message memos.api.v1.ListUserNotificationsResponse.
 * Use `create(ListUserNotificationsResponseSchema)` to create a new message.
 */
export const ListUserNotificationsResponseSchema: GenMessage<ListUserNotificationsResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 32);

/**
 * @generated from message memos.api.v1.UpdateUserNotificationRequest
 */
export type UpdateUserNotificationRequest = Message<"memos.api.v1.UpdateUserNotificationRequest"> & {
  /**
   * @generated from field: memos.api.v1.UserNotification notification = 1;
   */
  notification?: UserNotification;

  /**
   * @generated from field: google.protobuf.FieldMask update_mask = 2;
   */
  updateMask?: FieldMask;
};

/**
 * Describes the message memos.api.v1.UpdateUserNotificationRequest.
 * Use `create(UpdateUserNotificationRequestSchema)` to create a new message.
 */
export const UpdateUserNotificationRequestSchema: GenMessage<UpdateUserNotificationRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 33);

/**
 * @generated from message memos.api.v1.DeleteUserNotificationRequest
 */
export type DeleteUserNotificationRequest = Message<"memos.api.v1.DeleteUserNotificationRequest"> & {
  /**
   * Format: users/{user}/notifications/{notification}
   *
   * @generated from field: string name = 1;
   */
  name: string;
};

/**
 * Describes the message memos.api.v1.DeleteUserNotificationRequest.
 * Use `create(DeleteUserNotificationRequestSchema)` to create a new message.
 */
export const DeleteUserNotificationRequestSchema: GenMessage<DeleteUserNotificationRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_user_service, 34);

/**
 * @generated from service memos.api.v1.UserService
 */
export const UserService: GenService<{
  /**
   * ListUsers returns a list of users.
   *
   * @generated from rpc memos.api.v1.UserService.ListUsers
   */
  listUsers: {
    methodKind: "unary";
    input: typeof ListUsersRequestSchema;
    output: typeof ListUsersResponseSchema;
  },
  /**
   * BatchGetUsers returns active users by usernames.
   *
   * @generated from rpc memos.api.v1.UserService.BatchGetUsers
   */
  batchGetUsers: {
    methodKind: "unary";
    input: typeof BatchGetUsersRequestSchema;
    output: typeof BatchGetUsersResponseSchema;
  },
  /**
   * GetUser gets a user by username.
   * Format: users/{username} (e.g., users/steven)
   *
   * @generated from rpc memos.api.v1.UserService.GetUser
   */
  getUser: {
    methodKind: "unary";
    input: typeof GetUserRequestSchema;
    output: typeof UserSchema;
  },
  /**
   * CreateUser creates a new user.
   *
   * @generated from rpc memos.api.v1.UserService.CreateUser
   */
  createUser: {
    methodKind: "unary";
    input: typeof CreateUserRequestSchema;
    output: typeof UserSchema;
  },
  /**
   * UpdateUser updates a user.
   *
   * @generated from rpc memos.api.v1.UserService.UpdateUser
   */
  updateUser: {
    methodKind: "unary";
    input: typeof UpdateUserRequestSchema;
    output: typeof UserSchema;
  },
  /**
   * DeleteUser deletes a user.
   *
   * @generated from rpc memos.api.v1.UserService.DeleteUser
   */
  deleteUser: {
    methodKind: "unary";
    input: typeof DeleteUserRequestSchema;
    output: typeof EmptySchema;
  },
  /**
   * ListAllUserStats returns statistics for all users.
   *
   * @generated from rpc memos.api.v1.UserService.ListAllUserStats
   */
  listAllUserStats: {
    methodKind: "unary";
    input: typeof ListAllUserStatsRequestSchema;
    output: typeof ListAllUserStatsResponseSchema;
  },
  /**
   * GetUserStats returns statistics for a specific user.
   *
   * @generated from rpc memos.api.v1.UserService.GetUserStats
   */
  getUserStats: {
    methodKind: "unary";
    input: typeof GetUserStatsRequestSchema;
    output: typeof UserStatsSchema;
  },
  /**
   * GetUserSetting returns the user setting.
   *
   * @generated from rpc memos.api.v1.UserService.GetUserSetting
   */
  getUserSetting: {
    methodKind: "unary";
    input: typeof GetUserSettingRequestSchema;
    output: typeof UserSettingSchema;
  },
  /**
   * UpdateUserSetting updates the user setting.
   *
   * @generated from rpc memos.api.v1.UserService.UpdateUserSetting
   */
  updateUserSetting: {
    methodKind: "unary";
    input: typeof UpdateUserSettingRequestSchema;
    output: typeof UserSettingSchema;
  },
  /**
   * ListUserSettings returns a list of user settings.
   *
   * @generated from rpc memos.api.v1.UserService.ListUserSettings
   */
  listUserSettings: {
    methodKind: "unary";
    input: typeof ListUserSettingsRequestSchema;
    output: typeof ListUserSettingsResponseSchema;
  },
  /**
   * ListPersonalAccessTokens returns a list of Personal Access Tokens (PATs) for a user.
   * PATs are long-lived tokens for API/script access, distinct from short-lived JWT access tokens.
   *
   * @generated from rpc memos.api.v1.UserService.ListPersonalAccessTokens
   */
  listPersonalAccessTokens: {
    methodKind: "unary";
    input: typeof ListPersonalAccessTokensRequestSchema;
    output: typeof ListPersonalAccessTokensResponseSchema;
  },
  /**
   * CreatePersonalAccessToken creates a new Personal Access Token for a user.
   * The token value is only returned once upon creation.
   *
   * @generated from rpc memos.api.v1.UserService.CreatePersonalAccessToken
   */
  createPersonalAccessToken: {
    methodKind: "unary";
    input: typeof CreatePersonalAccessTokenRequestSchema;
    output: typeof CreatePersonalAccessTokenResponseSchema;
  },
  /**
   * DeletePersonalAccessToken deletes a Personal Access Token.
   *
   * @generated from rpc memos.api.v1.UserService.DeletePersonalAccessToken
   */
  deletePersonalAccessToken: {
    methodKind: "unary";
    input: typeof DeletePersonalAccessTokenRequestSchema;
    output: typeof EmptySchema;
  },
  /**
   * ListUserWebhooks returns a list of webhooks for a user.
   *
   * @generated from rpc memos.api.v1.UserService.ListUserWebhooks
   */
  listUserWebhooks: {
    methodKind: "unary";
    input: typeof ListUserWebhooksRequestSchema;
    output: typeof ListUserWebhooksResponseSchema;
  },
  /**
   * CreateUserWebhook creates a new webhook for a user.
   *
   * @generated from rpc memos.api.v1.UserService.CreateUserWebhook
   */
  createUserWebhook: {
    methodKind: "unary";
    input: typeof CreateUserWebhookRequestSchema;
    output: typeof UserWebhookSchema;
  },
  /**
   * UpdateUserWebhook updates an existing webhook for a user.
   *
   * @generated from rpc memos.api.v1.UserService.UpdateUserWebhook
   */
  updateUserWebhook: {
    methodKind: "unary";
    input: typeof UpdateUserWebhookRequestSchema;
    output: typeof UserWebhookSchema;
  },
  /**
   * DeleteUserWebhook deletes a webhook for a user.
   *
   * @generated from rpc memos.api.v1.UserService.DeleteUserWebhook
   */
  deleteUserWebhook: {
    methodKind: "unary";
    input: typeof DeleteUserWebhookRequestSchema;
    output: typeof EmptySchema;
  },
  /**
   * ListUserNotifications lists notifications for a user.
   *
   * @generated from rpc memos.api.v1.UserService.ListUserNotifications
   */
  listUserNotifications: {
    methodKind: "unary";
    input: typeof ListUserNotificationsRequestSchema;
    output: typeof ListUserNotificationsResponseSchema;
  },
  /**
   * UpdateUserNotification updates a notification.
   *
   * @generated from rpc memos.api.v1.UserService.UpdateUserNotification
   */
  updateUserNotification: {
    methodKind: "unary";
    input: typeof UpdateUserNotificationRequestSchema;
    output: typeof UserNotificationSchema;
  },
  /**
   * DeleteUserNotification deletes a notification.
   *
   * @generated from rpc memos.api.v1.UserService.DeleteUserNotification
   */
  deleteUserNotification: {
    methodKind: "unary";
    input: typeof DeleteUserNotificationRequestSchema;
    output: typeof EmptySchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_api_v1_user_service, 0);

