// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: api/v1/user_service.proto

package apiv1connect

import (
	connect "connectrpc.com/connect"
	context "context"
	errors "errors"
	v1 "github.com/usememos/memos/proto/gen/api/v1"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
	http "net/http"
	strings "strings"
)

// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0

const (
	// UserServiceName is the fully-qualified name of the UserService service.
	UserServiceName = "memos.api.v1.UserService"
)

// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
	// UserServiceListUsersProcedure is the fully-qualified name of the UserService's ListUsers RPC.
	UserServiceListUsersProcedure = "/memos.api.v1.UserService/ListUsers"
	// UserServiceGetUserProcedure is the fully-qualified name of the UserService's GetUser RPC.
	UserServiceGetUserProcedure = "/memos.api.v1.UserService/GetUser"
	// UserServiceCreateUserProcedure is the fully-qualified name of the UserService's CreateUser RPC.
	UserServiceCreateUserProcedure = "/memos.api.v1.UserService/CreateUser"
	// UserServiceUpdateUserProcedure is the fully-qualified name of the UserService's UpdateUser RPC.
	UserServiceUpdateUserProcedure = "/memos.api.v1.UserService/UpdateUser"
	// UserServiceDeleteUserProcedure is the fully-qualified name of the UserService's DeleteUser RPC.
	UserServiceDeleteUserProcedure = "/memos.api.v1.UserService/DeleteUser"
	// UserServiceListAllUserStatsProcedure is the fully-qualified name of the UserService's
	// ListAllUserStats RPC.
	UserServiceListAllUserStatsProcedure = "/memos.api.v1.UserService/ListAllUserStats"
	// UserServiceGetUserStatsProcedure is the fully-qualified name of the UserService's GetUserStats
	// RPC.
	UserServiceGetUserStatsProcedure = "/memos.api.v1.UserService/GetUserStats"
	// UserServiceGetUserSettingProcedure is the fully-qualified name of the UserService's
	// GetUserSetting RPC.
	UserServiceGetUserSettingProcedure = "/memos.api.v1.UserService/GetUserSetting"
	// UserServiceUpdateUserSettingProcedure is the fully-qualified name of the UserService's
	// UpdateUserSetting RPC.
	UserServiceUpdateUserSettingProcedure = "/memos.api.v1.UserService/UpdateUserSetting"
	// UserServiceListUserSettingsProcedure is the fully-qualified name of the UserService's
	// ListUserSettings RPC.
	UserServiceListUserSettingsProcedure = "/memos.api.v1.UserService/ListUserSettings"
	// UserServiceListPersonalAccessTokensProcedure is the fully-qualified name of the UserService's
	// ListPersonalAccessTokens RPC.
	UserServiceListPersonalAccessTokensProcedure = "/memos.api.v1.UserService/ListPersonalAccessTokens"
	// UserServiceCreatePersonalAccessTokenProcedure is the fully-qualified name of the UserService's
	// CreatePersonalAccessToken RPC.
	UserServiceCreatePersonalAccessTokenProcedure = "/memos.api.v1.UserService/CreatePersonalAccessToken"
	// UserServiceDeletePersonalAccessTokenProcedure is the fully-qualified name of the UserService's
	// DeletePersonalAccessToken RPC.
	UserServiceDeletePersonalAccessTokenProcedure = "/memos.api.v1.UserService/DeletePersonalAccessToken"
	// UserServiceListUserWebhooksProcedure is the fully-qualified name of the UserService's
	// ListUserWebhooks RPC.
	UserServiceListUserWebhooksProcedure = "/memos.api.v1.UserService/ListUserWebhooks"
	// UserServiceCreateUserWebhookProcedure is the fully-qualified name of the UserService's
	// CreateUserWebhook RPC.
	UserServiceCreateUserWebhookProcedure = "/memos.api.v1.UserService/CreateUserWebhook"
	// UserServiceUpdateUserWebhookProcedure is the fully-qualified name of the UserService's
	// UpdateUserWebhook RPC.
	UserServiceUpdateUserWebhookProcedure = "/memos.api.v1.UserService/UpdateUserWebhook"
	// UserServiceDeleteUserWebhookProcedure is the fully-qualified name of the UserService's
	// DeleteUserWebhook RPC.
	UserServiceDeleteUserWebhookProcedure = "/memos.api.v1.UserService/DeleteUserWebhook"
	// UserServiceListUserNotificationsProcedure is the fully-qualified name of the UserService's
	// ListUserNotifications RPC.
	UserServiceListUserNotificationsProcedure = "/memos.api.v1.UserService/ListUserNotifications"
	// UserServiceUpdateUserNotificationProcedure is the fully-qualified name of the UserService's
	// UpdateUserNotification RPC.
	UserServiceUpdateUserNotificationProcedure = "/memos.api.v1.UserService/UpdateUserNotification"
	// UserServiceDeleteUserNotificationProcedure is the fully-qualified name of the UserService's
	// DeleteUserNotification RPC.
	UserServiceDeleteUserNotificationProcedure = "/memos.api.v1.UserService/DeleteUserNotification"
)

// UserServiceClient is a client for the memos.api.v1.UserService service.
type UserServiceClient interface {
	// ListUsers returns a list of users.
	ListUsers(context.Context, *connect.Request[v1.ListUsersRequest]) (*connect.Response[v1.ListUsersResponse], error)
	// GetUser gets a user by ID or username.
	// Supports both numeric IDs and username strings:
	//   - users/{id}       (e.g., users/101)
	//   - users/{username} (e.g., users/steven)
	GetUser(context.Context, *connect.Request[v1.GetUserRequest]) (*connect.Response[v1.User], error)
	// CreateUser creates a new user.
	CreateUser(context.Context, *connect.Request[v1.CreateUserRequest]) (*connect.Response[v1.User], error)
	// UpdateUser updates a user.
	UpdateUser(context.Context, *connect.Request[v1.UpdateUserRequest]) (*connect.Response[v1.User], error)
	// DeleteUser deletes a user.
	DeleteUser(context.Context, *connect.Request[v1.DeleteUserRequest]) (*connect.Response[emptypb.Empty], error)
	// ListAllUserStats returns statistics for all users.
	ListAllUserStats(context.Context, *connect.Request[v1.ListAllUserStatsRequest]) (*connect.Response[v1.ListAllUserStatsResponse], error)
	// GetUserStats returns statistics for a specific user.
	GetUserStats(context.Context, *connect.Request[v1.GetUserStatsRequest]) (*connect.Response[v1.UserStats], error)
	// GetUserSetting returns the user setting.
	GetUserSetting(context.Context, *connect.Request[v1.GetUserSettingRequest]) (*connect.Response[v1.UserSetting], error)
	// UpdateUserSetting updates the user setting.
	UpdateUserSetting(context.Context, *connect.Request[v1.UpdateUserSettingRequest]) (*connect.Response[v1.UserSetting], error)
	// ListUserSettings returns a list of user settings.
	ListUserSettings(context.Context, *connect.Request[v1.ListUserSettingsRequest]) (*connect.Response[v1.ListUserSettingsResponse], error)
	// 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.
	ListPersonalAccessTokens(context.Context, *connect.Request[v1.ListPersonalAccessTokensRequest]) (*connect.Response[v1.ListPersonalAccessTokensResponse], error)
	// CreatePersonalAccessToken creates a new Personal Access Token for a user.
	// The token value is only returned once upon creation.
	CreatePersonalAccessToken(context.Context, *connect.Request[v1.CreatePersonalAccessTokenRequest]) (*connect.Response[v1.CreatePersonalAccessTokenResponse], error)
	// DeletePersonalAccessToken deletes a Personal Access Token.
	DeletePersonalAccessToken(context.Context, *connect.Request[v1.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error)
	// ListUserWebhooks returns a list of webhooks for a user.
	ListUserWebhooks(context.Context, *connect.Request[v1.ListUserWebhooksRequest]) (*connect.Response[v1.ListUserWebhooksResponse], error)
	// CreateUserWebhook creates a new webhook for a user.
	CreateUserWebhook(context.Context, *connect.Request[v1.CreateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error)
	// UpdateUserWebhook updates an existing webhook for a user.
	UpdateUserWebhook(context.Context, *connect.Request[v1.UpdateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error)
	// DeleteUserWebhook deletes a webhook for a user.
	DeleteUserWebhook(context.Context, *connect.Request[v1.DeleteUserWebhookRequest]) (*connect.Response[emptypb.Empty], error)
	// ListUserNotifications lists notifications for a user.
	ListUserNotifications(context.Context, *connect.Request[v1.ListUserNotificationsRequest]) (*connect.Response[v1.ListUserNotificationsResponse], error)
	// UpdateUserNotification updates a notification.
	UpdateUserNotification(context.Context, *connect.Request[v1.UpdateUserNotificationRequest]) (*connect.Response[v1.UserNotification], error)
	// DeleteUserNotification deletes a notification.
	DeleteUserNotification(context.Context, *connect.Request[v1.DeleteUserNotificationRequest]) (*connect.Response[emptypb.Empty], error)
}

// NewUserServiceClient constructs a client for the memos.api.v1.UserService service. By default, it
// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) UserServiceClient {
	baseURL = strings.TrimRight(baseURL, "/")
	userServiceMethods := v1.File_api_v1_user_service_proto.Services().ByName("UserService").Methods()
	return &userServiceClient{
		listUsers: connect.NewClient[v1.ListUsersRequest, v1.ListUsersResponse](
			httpClient,
			baseURL+UserServiceListUsersProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListUsers")),
			connect.WithClientOptions(opts...),
		),
		getUser: connect.NewClient[v1.GetUserRequest, v1.User](
			httpClient,
			baseURL+UserServiceGetUserProcedure,
			connect.WithSchema(userServiceMethods.ByName("GetUser")),
			connect.WithClientOptions(opts...),
		),
		createUser: connect.NewClient[v1.CreateUserRequest, v1.User](
			httpClient,
			baseURL+UserServiceCreateUserProcedure,
			connect.WithSchema(userServiceMethods.ByName("CreateUser")),
			connect.WithClientOptions(opts...),
		),
		updateUser: connect.NewClient[v1.UpdateUserRequest, v1.User](
			httpClient,
			baseURL+UserServiceUpdateUserProcedure,
			connect.WithSchema(userServiceMethods.ByName("UpdateUser")),
			connect.WithClientOptions(opts...),
		),
		deleteUser: connect.NewClient[v1.DeleteUserRequest, emptypb.Empty](
			httpClient,
			baseURL+UserServiceDeleteUserProcedure,
			connect.WithSchema(userServiceMethods.ByName("DeleteUser")),
			connect.WithClientOptions(opts...),
		),
		listAllUserStats: connect.NewClient[v1.ListAllUserStatsRequest, v1.ListAllUserStatsResponse](
			httpClient,
			baseURL+UserServiceListAllUserStatsProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListAllUserStats")),
			connect.WithClientOptions(opts...),
		),
		getUserStats: connect.NewClient[v1.GetUserStatsRequest, v1.UserStats](
			httpClient,
			baseURL+UserServiceGetUserStatsProcedure,
			connect.WithSchema(userServiceMethods.ByName("GetUserStats")),
			connect.WithClientOptions(opts...),
		),
		getUserSetting: connect.NewClient[v1.GetUserSettingRequest, v1.UserSetting](
			httpClient,
			baseURL+UserServiceGetUserSettingProcedure,
			connect.WithSchema(userServiceMethods.ByName("GetUserSetting")),
			connect.WithClientOptions(opts...),
		),
		updateUserSetting: connect.NewClient[v1.UpdateUserSettingRequest, v1.UserSetting](
			httpClient,
			baseURL+UserServiceUpdateUserSettingProcedure,
			connect.WithSchema(userServiceMethods.ByName("UpdateUserSetting")),
			connect.WithClientOptions(opts...),
		),
		listUserSettings: connect.NewClient[v1.ListUserSettingsRequest, v1.ListUserSettingsResponse](
			httpClient,
			baseURL+UserServiceListUserSettingsProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListUserSettings")),
			connect.WithClientOptions(opts...),
		),
		listPersonalAccessTokens: connect.NewClient[v1.ListPersonalAccessTokensRequest, v1.ListPersonalAccessTokensResponse](
			httpClient,
			baseURL+UserServiceListPersonalAccessTokensProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListPersonalAccessTokens")),
			connect.WithClientOptions(opts...),
		),
		createPersonalAccessToken: connect.NewClient[v1.CreatePersonalAccessTokenRequest, v1.CreatePersonalAccessTokenResponse](
			httpClient,
			baseURL+UserServiceCreatePersonalAccessTokenProcedure,
			connect.WithSchema(userServiceMethods.ByName("CreatePersonalAccessToken")),
			connect.WithClientOptions(opts...),
		),
		deletePersonalAccessToken: connect.NewClient[v1.DeletePersonalAccessTokenRequest, emptypb.Empty](
			httpClient,
			baseURL+UserServiceDeletePersonalAccessTokenProcedure,
			connect.WithSchema(userServiceMethods.ByName("DeletePersonalAccessToken")),
			connect.WithClientOptions(opts...),
		),
		listUserWebhooks: connect.NewClient[v1.ListUserWebhooksRequest, v1.ListUserWebhooksResponse](
			httpClient,
			baseURL+UserServiceListUserWebhooksProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListUserWebhooks")),
			connect.WithClientOptions(opts...),
		),
		createUserWebhook: connect.NewClient[v1.CreateUserWebhookRequest, v1.UserWebhook](
			httpClient,
			baseURL+UserServiceCreateUserWebhookProcedure,
			connect.WithSchema(userServiceMethods.ByName("CreateUserWebhook")),
			connect.WithClientOptions(opts...),
		),
		updateUserWebhook: connect.NewClient[v1.UpdateUserWebhookRequest, v1.UserWebhook](
			httpClient,
			baseURL+UserServiceUpdateUserWebhookProcedure,
			connect.WithSchema(userServiceMethods.ByName("UpdateUserWebhook")),
			connect.WithClientOptions(opts...),
		),
		deleteUserWebhook: connect.NewClient[v1.DeleteUserWebhookRequest, emptypb.Empty](
			httpClient,
			baseURL+UserServiceDeleteUserWebhookProcedure,
			connect.WithSchema(userServiceMethods.ByName("DeleteUserWebhook")),
			connect.WithClientOptions(opts...),
		),
		listUserNotifications: connect.NewClient[v1.ListUserNotificationsRequest, v1.ListUserNotificationsResponse](
			httpClient,
			baseURL+UserServiceListUserNotificationsProcedure,
			connect.WithSchema(userServiceMethods.ByName("ListUserNotifications")),
			connect.WithClientOptions(opts...),
		),
		updateUserNotification: connect.NewClient[v1.UpdateUserNotificationRequest, v1.UserNotification](
			httpClient,
			baseURL+UserServiceUpdateUserNotificationProcedure,
			connect.WithSchema(userServiceMethods.ByName("UpdateUserNotification")),
			connect.WithClientOptions(opts...),
		),
		deleteUserNotification: connect.NewClient[v1.DeleteUserNotificationRequest, emptypb.Empty](
			httpClient,
			baseURL+UserServiceDeleteUserNotificationProcedure,
			connect.WithSchema(userServiceMethods.ByName("DeleteUserNotification")),
			connect.WithClientOptions(opts...),
		),
	}
}

// userServiceClient implements UserServiceClient.
type userServiceClient struct {
	listUsers                 *connect.Client[v1.ListUsersRequest, v1.ListUsersResponse]
	getUser                   *connect.Client[v1.GetUserRequest, v1.User]
	createUser                *connect.Client[v1.CreateUserRequest, v1.User]
	updateUser                *connect.Client[v1.UpdateUserRequest, v1.User]
	deleteUser                *connect.Client[v1.DeleteUserRequest, emptypb.Empty]
	listAllUserStats          *connect.Client[v1.ListAllUserStatsRequest, v1.ListAllUserStatsResponse]
	getUserStats              *connect.Client[v1.GetUserStatsRequest, v1.UserStats]
	getUserSetting            *connect.Client[v1.GetUserSettingRequest, v1.UserSetting]
	updateUserSetting         *connect.Client[v1.UpdateUserSettingRequest, v1.UserSetting]
	listUserSettings          *connect.Client[v1.ListUserSettingsRequest, v1.ListUserSettingsResponse]
	listPersonalAccessTokens  *connect.Client[v1.ListPersonalAccessTokensRequest, v1.ListPersonalAccessTokensResponse]
	createPersonalAccessToken *connect.Client[v1.CreatePersonalAccessTokenRequest, v1.CreatePersonalAccessTokenResponse]
	deletePersonalAccessToken *connect.Client[v1.DeletePersonalAccessTokenRequest, emptypb.Empty]
	listUserWebhooks          *connect.Client[v1.ListUserWebhooksRequest, v1.ListUserWebhooksResponse]
	createUserWebhook         *connect.Client[v1.CreateUserWebhookRequest, v1.UserWebhook]
	updateUserWebhook         *connect.Client[v1.UpdateUserWebhookRequest, v1.UserWebhook]
	deleteUserWebhook         *connect.Client[v1.DeleteUserWebhookRequest, emptypb.Empty]
	listUserNotifications     *connect.Client[v1.ListUserNotificationsRequest, v1.ListUserNotificationsResponse]
	updateUserNotification    *connect.Client[v1.UpdateUserNotificationRequest, v1.UserNotification]
	deleteUserNotification    *connect.Client[v1.DeleteUserNotificationRequest, emptypb.Empty]
}

// ListUsers calls memos.api.v1.UserService.ListUsers.
func (c *userServiceClient) ListUsers(ctx context.Context, req *connect.Request[v1.ListUsersRequest]) (*connect.Response[v1.ListUsersResponse], error) {
	return c.listUsers.CallUnary(ctx, req)
}

// GetUser calls memos.api.v1.UserService.GetUser.
func (c *userServiceClient) GetUser(ctx context.Context, req *connect.Request[v1.GetUserRequest]) (*connect.Response[v1.User], error) {
	return c.getUser.CallUnary(ctx, req)
}

// CreateUser calls memos.api.v1.UserService.CreateUser.
func (c *userServiceClient) CreateUser(ctx context.Context, req *connect.Request[v1.CreateUserRequest]) (*connect.Response[v1.User], error) {
	return c.createUser.CallUnary(ctx, req)
}

// UpdateUser calls memos.api.v1.UserService.UpdateUser.
func (c *userServiceClient) UpdateUser(ctx context.Context, req *connect.Request[v1.UpdateUserRequest]) (*connect.Response[v1.User], error) {
	return c.updateUser.CallUnary(ctx, req)
}

// DeleteUser calls memos.api.v1.UserService.DeleteUser.
func (c *userServiceClient) DeleteUser(ctx context.Context, req *connect.Request[v1.DeleteUserRequest]) (*connect.Response[emptypb.Empty], error) {
	return c.deleteUser.CallUnary(ctx, req)
}

// ListAllUserStats calls memos.api.v1.UserService.ListAllUserStats.
func (c *userServiceClient) ListAllUserStats(ctx context.Context, req *connect.Request[v1.ListAllUserStatsRequest]) (*connect.Response[v1.ListAllUserStatsResponse], error) {
	return c.listAllUserStats.CallUnary(ctx, req)
}

// GetUserStats calls memos.api.v1.UserService.GetUserStats.
func (c *userServiceClient) GetUserStats(ctx context.Context, req *connect.Request[v1.GetUserStatsRequest]) (*connect.Response[v1.UserStats], error) {
	return c.getUserStats.CallUnary(ctx, req)
}

// GetUserSetting calls memos.api.v1.UserService.GetUserSetting.
func (c *userServiceClient) GetUserSetting(ctx context.Context, req *connect.Request[v1.GetUserSettingRequest]) (*connect.Response[v1.UserSetting], error) {
	return c.getUserSetting.CallUnary(ctx, req)
}

// UpdateUserSetting calls memos.api.v1.UserService.UpdateUserSetting.
func (c *userServiceClient) UpdateUserSetting(ctx context.Context, req *connect.Request[v1.UpdateUserSettingRequest]) (*connect.Response[v1.UserSetting], error) {
	return c.updateUserSetting.CallUnary(ctx, req)
}

// ListUserSettings calls memos.api.v1.UserService.ListUserSettings.
func (c *userServiceClient) ListUserSettings(ctx context.Context, req *connect.Request[v1.ListUserSettingsRequest]) (*connect.Response[v1.ListUserSettingsResponse], error) {
	return c.listUserSettings.CallUnary(ctx, req)
}

// ListPersonalAccessTokens calls memos.api.v1.UserService.ListPersonalAccessTokens.
func (c *userServiceClient) ListPersonalAccessTokens(ctx context.Context, req *connect.Request[v1.ListPersonalAccessTokensRequest]) (*connect.Response[v1.ListPersonalAccessTokensResponse], error) {
	return c.listPersonalAccessTokens.CallUnary(ctx, req)
}

// CreatePersonalAccessToken calls memos.api.v1.UserService.CreatePersonalAccessToken.
func (c *userServiceClient) CreatePersonalAccessToken(ctx context.Context, req *connect.Request[v1.CreatePersonalAccessTokenRequest]) (*connect.Response[v1.CreatePersonalAccessTokenResponse], error) {
	return c.createPersonalAccessToken.CallUnary(ctx, req)
}

// DeletePersonalAccessToken calls memos.api.v1.UserService.DeletePersonalAccessToken.
func (c *userServiceClient) DeletePersonalAccessToken(ctx context.Context, req *connect.Request[v1.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error) {
	return c.deletePersonalAccessToken.CallUnary(ctx, req)
}

// ListUserWebhooks calls memos.api.v1.UserService.ListUserWebhooks.
func (c *userServiceClient) ListUserWebhooks(ctx context.Context, req *connect.Request[v1.ListUserWebhooksRequest]) (*connect.Response[v1.ListUserWebhooksResponse], error) {
	return c.listUserWebhooks.CallUnary(ctx, req)
}

// CreateUserWebhook calls memos.api.v1.UserService.CreateUserWebhook.
func (c *userServiceClient) CreateUserWebhook(ctx context.Context, req *connect.Request[v1.CreateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error) {
	return c.createUserWebhook.CallUnary(ctx, req)
}

// UpdateUserWebhook calls memos.api.v1.UserService.UpdateUserWebhook.
func (c *userServiceClient) UpdateUserWebhook(ctx context.Context, req *connect.Request[v1.UpdateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error) {
	return c.updateUserWebhook.CallUnary(ctx, req)
}

// DeleteUserWebhook calls memos.api.v1.UserService.DeleteUserWebhook.
func (c *userServiceClient) DeleteUserWebhook(ctx context.Context, req *connect.Request[v1.DeleteUserWebhookRequest]) (*connect.Response[emptypb.Empty], error) {
	return c.deleteUserWebhook.CallUnary(ctx, req)
}

// ListUserNotifications calls memos.api.v1.UserService.ListUserNotifications.
func (c *userServiceClient) ListUserNotifications(ctx context.Context, req *connect.Request[v1.ListUserNotificationsRequest]) (*connect.Response[v1.ListUserNotificationsResponse], error) {
	return c.listUserNotifications.CallUnary(ctx, req)
}

// UpdateUserNotification calls memos.api.v1.UserService.UpdateUserNotification.
func (c *userServiceClient) UpdateUserNotification(ctx context.Context, req *connect.Request[v1.UpdateUserNotificationRequest]) (*connect.Response[v1.UserNotification], error) {
	return c.updateUserNotification.CallUnary(ctx, req)
}

// DeleteUserNotification calls memos.api.v1.UserService.DeleteUserNotification.
func (c *userServiceClient) DeleteUserNotification(ctx context.Context, req *connect.Request[v1.DeleteUserNotificationRequest]) (*connect.Response[emptypb.Empty], error) {
	return c.deleteUserNotification.CallUnary(ctx, req)
}

// UserServiceHandler is an implementation of the memos.api.v1.UserService service.
type UserServiceHandler interface {
	// ListUsers returns a list of users.
	ListUsers(context.Context, *connect.Request[v1.ListUsersRequest]) (*connect.Response[v1.ListUsersResponse], error)
	// GetUser gets a user by ID or username.
	// Supports both numeric IDs and username strings:
	//   - users/{id}       (e.g., users/101)
	//   - users/{username} (e.g., users/steven)
	GetUser(context.Context, *connect.Request[v1.GetUserRequest]) (*connect.Response[v1.User], error)
	// CreateUser creates a new user.
	CreateUser(context.Context, *connect.Request[v1.CreateUserRequest]) (*connect.Response[v1.User], error)
	// UpdateUser updates a user.
	UpdateUser(context.Context, *connect.Request[v1.UpdateUserRequest]) (*connect.Response[v1.User], error)
	// DeleteUser deletes a user.
	DeleteUser(context.Context, *connect.Request[v1.DeleteUserRequest]) (*connect.Response[emptypb.Empty], error)
	// ListAllUserStats returns statistics for all users.
	ListAllUserStats(context.Context, *connect.Request[v1.ListAllUserStatsRequest]) (*connect.Response[v1.ListAllUserStatsResponse], error)
	// GetUserStats returns statistics for a specific user.
	GetUserStats(context.Context, *connect.Request[v1.GetUserStatsRequest]) (*connect.Response[v1.UserStats], error)
	// GetUserSetting returns the user setting.
	GetUserSetting(context.Context, *connect.Request[v1.GetUserSettingRequest]) (*connect.Response[v1.UserSetting], error)
	// UpdateUserSetting updates the user setting.
	UpdateUserSetting(context.Context, *connect.Request[v1.UpdateUserSettingRequest]) (*connect.Response[v1.UserSetting], error)
	// ListUserSettings returns a list of user settings.
	ListUserSettings(context.Context, *connect.Request[v1.ListUserSettingsRequest]) (*connect.Response[v1.ListUserSettingsResponse], error)
	// 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.
	ListPersonalAccessTokens(context.Context, *connect.Request[v1.ListPersonalAccessTokensRequest]) (*connect.Response[v1.ListPersonalAccessTokensResponse], error)
	// CreatePersonalAccessToken creates a new Personal Access Token for a user.
	// The token value is only returned once upon creation.
	CreatePersonalAccessToken(context.Context, *connect.Request[v1.CreatePersonalAccessTokenRequest]) (*connect.Response[v1.CreatePersonalAccessTokenResponse], error)
	// DeletePersonalAccessToken deletes a Personal Access Token.
	DeletePersonalAccessToken(context.Context, *connect.Request[v1.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error)
	// ListUserWebhooks returns a list of webhooks for a user.
	ListUserWebhooks(context.Context, *connect.Request[v1.ListUserWebhooksRequest]) (*connect.Response[v1.ListUserWebhooksResponse], error)
	// CreateUserWebhook creates a new webhook for a user.
	CreateUserWebhook(context.Context, *connect.Request[v1.CreateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error)
	// UpdateUserWebhook updates an existing webhook for a user.
	UpdateUserWebhook(context.Context, *connect.Request[v1.UpdateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error)
	// DeleteUserWebhook deletes a webhook for a user.
	DeleteUserWebhook(context.Context, *connect.Request[v1.DeleteUserWebhookRequest]) (*connect.Response[emptypb.Empty], error)
	// ListUserNotifications lists notifications for a user.
	ListUserNotifications(context.Context, *connect.Request[v1.ListUserNotificationsRequest]) (*connect.Response[v1.ListUserNotificationsResponse], error)
	// UpdateUserNotification updates a notification.
	UpdateUserNotification(context.Context, *connect.Request[v1.UpdateUserNotificationRequest]) (*connect.Response[v1.UserNotification], error)
	// DeleteUserNotification deletes a notification.
	DeleteUserNotification(context.Context, *connect.Request[v1.DeleteUserNotificationRequest]) (*connect.Response[emptypb.Empty], error)
}

// NewUserServiceHandler builds an HTTP handler from the service implementation. It returns the path
// on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
	userServiceMethods := v1.File_api_v1_user_service_proto.Services().ByName("UserService").Methods()
	userServiceListUsersHandler := connect.NewUnaryHandler(
		UserServiceListUsersProcedure,
		svc.ListUsers,
		connect.WithSchema(userServiceMethods.ByName("ListUsers")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceGetUserHandler := connect.NewUnaryHandler(
		UserServiceGetUserProcedure,
		svc.GetUser,
		connect.WithSchema(userServiceMethods.ByName("GetUser")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceCreateUserHandler := connect.NewUnaryHandler(
		UserServiceCreateUserProcedure,
		svc.CreateUser,
		connect.WithSchema(userServiceMethods.ByName("CreateUser")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceUpdateUserHandler := connect.NewUnaryHandler(
		UserServiceUpdateUserProcedure,
		svc.UpdateUser,
		connect.WithSchema(userServiceMethods.ByName("UpdateUser")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceDeleteUserHandler := connect.NewUnaryHandler(
		UserServiceDeleteUserProcedure,
		svc.DeleteUser,
		connect.WithSchema(userServiceMethods.ByName("DeleteUser")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceListAllUserStatsHandler := connect.NewUnaryHandler(
		UserServiceListAllUserStatsProcedure,
		svc.ListAllUserStats,
		connect.WithSchema(userServiceMethods.ByName("ListAllUserStats")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceGetUserStatsHandler := connect.NewUnaryHandler(
		UserServiceGetUserStatsProcedure,
		svc.GetUserStats,
		connect.WithSchema(userServiceMethods.ByName("GetUserStats")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceGetUserSettingHandler := connect.NewUnaryHandler(
		UserServiceGetUserSettingProcedure,
		svc.GetUserSetting,
		connect.WithSchema(userServiceMethods.ByName("GetUserSetting")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceUpdateUserSettingHandler := connect.NewUnaryHandler(
		UserServiceUpdateUserSettingProcedure,
		svc.UpdateUserSetting,
		connect.WithSchema(userServiceMethods.ByName("UpdateUserSetting")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceListUserSettingsHandler := connect.NewUnaryHandler(
		UserServiceListUserSettingsProcedure,
		svc.ListUserSettings,
		connect.WithSchema(userServiceMethods.ByName("ListUserSettings")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceListPersonalAccessTokensHandler := connect.NewUnaryHandler(
		UserServiceListPersonalAccessTokensProcedure,
		svc.ListPersonalAccessTokens,
		connect.WithSchema(userServiceMethods.ByName("ListPersonalAccessTokens")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceCreatePersonalAccessTokenHandler := connect.NewUnaryHandler(
		UserServiceCreatePersonalAccessTokenProcedure,
		svc.CreatePersonalAccessToken,
		connect.WithSchema(userServiceMethods.ByName("CreatePersonalAccessToken")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceDeletePersonalAccessTokenHandler := connect.NewUnaryHandler(
		UserServiceDeletePersonalAccessTokenProcedure,
		svc.DeletePersonalAccessToken,
		connect.WithSchema(userServiceMethods.ByName("DeletePersonalAccessToken")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceListUserWebhooksHandler := connect.NewUnaryHandler(
		UserServiceListUserWebhooksProcedure,
		svc.ListUserWebhooks,
		connect.WithSchema(userServiceMethods.ByName("ListUserWebhooks")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceCreateUserWebhookHandler := connect.NewUnaryHandler(
		UserServiceCreateUserWebhookProcedure,
		svc.CreateUserWebhook,
		connect.WithSchema(userServiceMethods.ByName("CreateUserWebhook")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceUpdateUserWebhookHandler := connect.NewUnaryHandler(
		UserServiceUpdateUserWebhookProcedure,
		svc.UpdateUserWebhook,
		connect.WithSchema(userServiceMethods.ByName("UpdateUserWebhook")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceDeleteUserWebhookHandler := connect.NewUnaryHandler(
		UserServiceDeleteUserWebhookProcedure,
		svc.DeleteUserWebhook,
		connect.WithSchema(userServiceMethods.ByName("DeleteUserWebhook")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceListUserNotificationsHandler := connect.NewUnaryHandler(
		UserServiceListUserNotificationsProcedure,
		svc.ListUserNotifications,
		connect.WithSchema(userServiceMethods.ByName("ListUserNotifications")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceUpdateUserNotificationHandler := connect.NewUnaryHandler(
		UserServiceUpdateUserNotificationProcedure,
		svc.UpdateUserNotification,
		connect.WithSchema(userServiceMethods.ByName("UpdateUserNotification")),
		connect.WithHandlerOptions(opts...),
	)
	userServiceDeleteUserNotificationHandler := connect.NewUnaryHandler(
		UserServiceDeleteUserNotificationProcedure,
		svc.DeleteUserNotification,
		connect.WithSchema(userServiceMethods.ByName("DeleteUserNotification")),
		connect.WithHandlerOptions(opts...),
	)
	return "/memos.api.v1.UserService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case UserServiceListUsersProcedure:
			userServiceListUsersHandler.ServeHTTP(w, r)
		case UserServiceGetUserProcedure:
			userServiceGetUserHandler.ServeHTTP(w, r)
		case UserServiceCreateUserProcedure:
			userServiceCreateUserHandler.ServeHTTP(w, r)
		case UserServiceUpdateUserProcedure:
			userServiceUpdateUserHandler.ServeHTTP(w, r)
		case UserServiceDeleteUserProcedure:
			userServiceDeleteUserHandler.ServeHTTP(w, r)
		case UserServiceListAllUserStatsProcedure:
			userServiceListAllUserStatsHandler.ServeHTTP(w, r)
		case UserServiceGetUserStatsProcedure:
			userServiceGetUserStatsHandler.ServeHTTP(w, r)
		case UserServiceGetUserSettingProcedure:
			userServiceGetUserSettingHandler.ServeHTTP(w, r)
		case UserServiceUpdateUserSettingProcedure:
			userServiceUpdateUserSettingHandler.ServeHTTP(w, r)
		case UserServiceListUserSettingsProcedure:
			userServiceListUserSettingsHandler.ServeHTTP(w, r)
		case UserServiceListPersonalAccessTokensProcedure:
			userServiceListPersonalAccessTokensHandler.ServeHTTP(w, r)
		case UserServiceCreatePersonalAccessTokenProcedure:
			userServiceCreatePersonalAccessTokenHandler.ServeHTTP(w, r)
		case UserServiceDeletePersonalAccessTokenProcedure:
			userServiceDeletePersonalAccessTokenHandler.ServeHTTP(w, r)
		case UserServiceListUserWebhooksProcedure:
			userServiceListUserWebhooksHandler.ServeHTTP(w, r)
		case UserServiceCreateUserWebhookProcedure:
			userServiceCreateUserWebhookHandler.ServeHTTP(w, r)
		case UserServiceUpdateUserWebhookProcedure:
			userServiceUpdateUserWebhookHandler.ServeHTTP(w, r)
		case UserServiceDeleteUserWebhookProcedure:
			userServiceDeleteUserWebhookHandler.ServeHTTP(w, r)
		case UserServiceListUserNotificationsProcedure:
			userServiceListUserNotificationsHandler.ServeHTTP(w, r)
		case UserServiceUpdateUserNotificationProcedure:
			userServiceUpdateUserNotificationHandler.ServeHTTP(w, r)
		case UserServiceDeleteUserNotificationProcedure:
			userServiceDeleteUserNotificationHandler.ServeHTTP(w, r)
		default:
			http.NotFound(w, r)
		}
	})
}

// UnimplementedUserServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedUserServiceHandler struct{}

func (UnimplementedUserServiceHandler) ListUsers(context.Context, *connect.Request[v1.ListUsersRequest]) (*connect.Response[v1.ListUsersResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListUsers is not implemented"))
}

func (UnimplementedUserServiceHandler) GetUser(context.Context, *connect.Request[v1.GetUserRequest]) (*connect.Response[v1.User], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.GetUser is not implemented"))
}

func (UnimplementedUserServiceHandler) CreateUser(context.Context, *connect.Request[v1.CreateUserRequest]) (*connect.Response[v1.User], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.CreateUser is not implemented"))
}

func (UnimplementedUserServiceHandler) UpdateUser(context.Context, *connect.Request[v1.UpdateUserRequest]) (*connect.Response[v1.User], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.UpdateUser is not implemented"))
}

func (UnimplementedUserServiceHandler) DeleteUser(context.Context, *connect.Request[v1.DeleteUserRequest]) (*connect.Response[emptypb.Empty], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.DeleteUser is not implemented"))
}

func (UnimplementedUserServiceHandler) ListAllUserStats(context.Context, *connect.Request[v1.ListAllUserStatsRequest]) (*connect.Response[v1.ListAllUserStatsResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListAllUserStats is not implemented"))
}

func (UnimplementedUserServiceHandler) GetUserStats(context.Context, *connect.Request[v1.GetUserStatsRequest]) (*connect.Response[v1.UserStats], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.GetUserStats is not implemented"))
}

func (UnimplementedUserServiceHandler) GetUserSetting(context.Context, *connect.Request[v1.GetUserSettingRequest]) (*connect.Response[v1.UserSetting], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.GetUserSetting is not implemented"))
}

func (UnimplementedUserServiceHandler) UpdateUserSetting(context.Context, *connect.Request[v1.UpdateUserSettingRequest]) (*connect.Response[v1.UserSetting], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.UpdateUserSetting is not implemented"))
}

func (UnimplementedUserServiceHandler) ListUserSettings(context.Context, *connect.Request[v1.ListUserSettingsRequest]) (*connect.Response[v1.ListUserSettingsResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListUserSettings is not implemented"))
}

func (UnimplementedUserServiceHandler) ListPersonalAccessTokens(context.Context, *connect.Request[v1.ListPersonalAccessTokensRequest]) (*connect.Response[v1.ListPersonalAccessTokensResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListPersonalAccessTokens is not implemented"))
}

func (UnimplementedUserServiceHandler) CreatePersonalAccessToken(context.Context, *connect.Request[v1.CreatePersonalAccessTokenRequest]) (*connect.Response[v1.CreatePersonalAccessTokenResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.CreatePersonalAccessToken is not implemented"))
}

func (UnimplementedUserServiceHandler) DeletePersonalAccessToken(context.Context, *connect.Request[v1.DeletePersonalAccessTokenRequest]) (*connect.Response[emptypb.Empty], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.DeletePersonalAccessToken is not implemented"))
}

func (UnimplementedUserServiceHandler) ListUserWebhooks(context.Context, *connect.Request[v1.ListUserWebhooksRequest]) (*connect.Response[v1.ListUserWebhooksResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListUserWebhooks is not implemented"))
}

func (UnimplementedUserServiceHandler) CreateUserWebhook(context.Context, *connect.Request[v1.CreateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.CreateUserWebhook is not implemented"))
}

func (UnimplementedUserServiceHandler) UpdateUserWebhook(context.Context, *connect.Request[v1.UpdateUserWebhookRequest]) (*connect.Response[v1.UserWebhook], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.UpdateUserWebhook is not implemented"))
}

func (UnimplementedUserServiceHandler) DeleteUserWebhook(context.Context, *connect.Request[v1.DeleteUserWebhookRequest]) (*connect.Response[emptypb.Empty], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.DeleteUserWebhook is not implemented"))
}

func (UnimplementedUserServiceHandler) ListUserNotifications(context.Context, *connect.Request[v1.ListUserNotificationsRequest]) (*connect.Response[v1.ListUserNotificationsResponse], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.ListUserNotifications is not implemented"))
}

func (UnimplementedUserServiceHandler) UpdateUserNotification(context.Context, *connect.Request[v1.UpdateUserNotificationRequest]) (*connect.Response[v1.UserNotification], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.UpdateUserNotification is not implemented"))
}

func (UnimplementedUserServiceHandler) DeleteUserNotification(context.Context, *connect.Request[v1.DeleteUserNotificationRequest]) (*connect.Response[emptypb.Empty], error) {
	return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.UserService.DeleteUserNotification is not implemented"))
}
