1
0
api/ent/ogent/oas_server_gen.go

235 lines
7.1 KiB
Go
Raw Normal View History

2022-08-31 06:18:14 +00:00
// Code generated by ogen, DO NOT EDIT.
package ogent
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
2022-08-31 07:49:08 +00:00
// CreateCard implements createCard operation.
//
// Creates a new Card and persists it to storage.
//
// POST /cards
CreateCard(ctx context.Context, req *CreateCardReq) (CreateCardRes, error)
// CreateGroup implements createGroup operation.
2022-08-31 06:18:14 +00:00
//
2022-08-31 07:49:08 +00:00
// Creates a new Group and persists it to storage.
//
// POST /groups
CreateGroup(ctx context.Context, req *CreateGroupReq) (CreateGroupRes, error)
2024-04-02 09:57:04 +00:00
// CreateMa implements createMa operation.
//
// Creates a new Ma and persists it to storage.
//
// POST /mas
CreateMa(ctx context.Context, req *CreateMaReq) (CreateMaRes, error)
2024-02-03 06:48:28 +00:00
// CreateUe implements createUe operation.
//
// Creates a new Ue and persists it to storage.
//
// POST /ues
CreateUe(ctx context.Context, req *CreateUeReq) (CreateUeRes, error)
2022-08-31 07:49:08 +00:00
// CreateUser implements createUser operation.
//
// Creates a new User and persists it to storage.
2022-08-31 06:18:14 +00:00
//
// POST /users
2022-08-31 07:49:08 +00:00
CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)
// DeleteCard implements deleteCard operation.
//
// Deletes the Card with the requested ID.
//
// DELETE /cards/{id}
DeleteCard(ctx context.Context, params DeleteCardParams) (DeleteCardRes, error)
// DeleteGroup implements deleteGroup operation.
//
// Deletes the Group with the requested ID.
2022-08-31 06:18:14 +00:00
//
2022-08-31 07:49:08 +00:00
// DELETE /groups/{id}
DeleteGroup(ctx context.Context, params DeleteGroupParams) (DeleteGroupRes, error)
2024-04-02 09:57:04 +00:00
// DeleteMa implements deleteMa operation.
//
// Deletes the Ma with the requested ID.
//
// DELETE /mas/{id}
DeleteMa(ctx context.Context, params DeleteMaParams) (DeleteMaRes, error)
2024-02-03 06:48:28 +00:00
// DeleteUe implements deleteUe operation.
//
// Deletes the Ue with the requested ID.
//
// DELETE /ues/{id}
DeleteUe(ctx context.Context, params DeleteUeParams) (DeleteUeRes, error)
2022-08-31 07:49:08 +00:00
// DeleteUser implements deleteUser operation.
//
// Deletes the User with the requested ID.
2022-08-31 06:18:14 +00:00
//
// DELETE /users/{id}
2022-08-31 07:49:08 +00:00
DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
2022-08-31 06:18:14 +00:00
// DrawDone implements drawDone operation.
//
2022-08-31 07:49:08 +00:00
// Draws a card item as done.
//
// PUT /cards/{id}/d
DrawDone(ctx context.Context, params DrawDoneParams) error
2022-08-31 06:18:14 +00:00
// DrawStart implements drawStart operation.
//
2022-08-31 07:49:08 +00:00
// Draws a card item as done.
//
// PATCH /users/{id}/card/start
DrawStart(ctx context.Context, params DrawStartParams) error
// ListCard implements listCard operation.
//
// List Cards.
//
// GET /cards
ListCard(ctx context.Context, params ListCardParams) (ListCardRes, error)
// ListGroup implements listGroup operation.
//
// List Groups.
//
// GET /groups
ListGroup(ctx context.Context, params ListGroupParams) (ListGroupRes, error)
// ListGroupUsers implements listGroupUsers operation.
//
// List attached Users.
//
// GET /groups/{id}/users
ListGroupUsers(ctx context.Context, params ListGroupUsersParams) (ListGroupUsersRes, error)
2024-04-02 09:57:04 +00:00
// ListMa implements listMa operation.
//
// List Mas.
//
// GET /mas
ListMa(ctx context.Context, params ListMaParams) (ListMaRes, error)
2024-02-03 06:48:28 +00:00
// ListUe implements listUe operation.
//
// List Ues.
//
// GET /ues
ListUe(ctx context.Context, params ListUeParams) (ListUeRes, error)
2022-08-31 07:49:08 +00:00
// ListUser implements listUser operation.
2022-08-31 06:18:14 +00:00
//
// List Users.
//
// GET /users
2022-08-31 07:49:08 +00:00
ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
// ListUserCard implements listUserCard operation.
2022-08-31 06:18:14 +00:00
//
2022-08-31 07:49:08 +00:00
// List attached Cards.
//
// GET /users/{id}/card
ListUserCard(ctx context.Context, params ListUserCardParams) (ListUserCardRes, error)
2024-04-02 09:57:04 +00:00
// ListUserMa implements listUserMa operation.
//
// List attached Mas.
//
// GET /users/{id}/ma
ListUserMa(ctx context.Context, params ListUserMaParams) (ListUserMaRes, error)
2024-02-03 06:48:28 +00:00
// ListUserUe implements listUserUe operation.
//
// List attached Ues.
//
// GET /users/{id}/ue
ListUserUe(ctx context.Context, params ListUserUeParams) (ListUserUeRes, error)
2022-08-31 07:49:08 +00:00
// ReadCard implements readCard operation.
//
// Finds the Card with the requested ID and returns it.
//
// GET /cards/{id}
ReadCard(ctx context.Context, params ReadCardParams) (ReadCardRes, error)
// ReadCardOwner implements readCardOwner operation.
//
// Find the attached User of the Card with the given ID.
//
// GET /cards/{id}/owner
ReadCardOwner(ctx context.Context, params ReadCardOwnerParams) (ReadCardOwnerRes, error)
// ReadGroup implements readGroup operation.
//
// Finds the Group with the requested ID and returns it.
//
// GET /groups/{id}
ReadGroup(ctx context.Context, params ReadGroupParams) (ReadGroupRes, error)
2024-04-02 09:57:04 +00:00
// ReadMa implements readMa operation.
//
// Finds the Ma with the requested ID and returns it.
//
// GET /mas/{id}
ReadMa(ctx context.Context, params ReadMaParams) (ReadMaRes, error)
// ReadMaOwner implements readMaOwner operation.
//
// Find the attached User of the Ma with the given ID.
//
// GET /mas/{id}/owner
ReadMaOwner(ctx context.Context, params ReadMaOwnerParams) (ReadMaOwnerRes, error)
2024-02-03 06:48:28 +00:00
// ReadUe implements readUe operation.
//
// Finds the Ue with the requested ID and returns it.
//
// GET /ues/{id}
ReadUe(ctx context.Context, params ReadUeParams) (ReadUeRes, error)
// ReadUeOwner implements readUeOwner operation.
//
// Find the attached User of the Ue with the given ID.
//
// GET /ues/{id}/owner
ReadUeOwner(ctx context.Context, params ReadUeOwnerParams) (ReadUeOwnerRes, error)
2022-08-31 07:49:08 +00:00
// ReadUser implements readUser operation.
//
// Finds the User with the requested ID and returns it.
2022-08-31 06:18:14 +00:00
//
// GET /users/{id}
2022-08-31 07:49:08 +00:00
ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)
// UpdateCard implements updateCard operation.
//
// Updates a Card and persists changes to storage.
2022-08-31 06:18:14 +00:00
//
2022-08-31 07:49:08 +00:00
// PATCH /cards/{id}
UpdateCard(ctx context.Context, req *UpdateCardReq, params UpdateCardParams) (UpdateCardRes, error)
// UpdateGroup implements updateGroup operation.
//
// Updates a Group and persists changes to storage.
//
// PATCH /groups/{id}
UpdateGroup(ctx context.Context, req *UpdateGroupReq, params UpdateGroupParams) (UpdateGroupRes, error)
2024-04-02 09:57:04 +00:00
// UpdateMa implements updateMa operation.
//
// Updates a Ma and persists changes to storage.
//
// PATCH /mas/{id}
UpdateMa(ctx context.Context, req *UpdateMaReq, params UpdateMaParams) (UpdateMaRes, error)
2024-02-03 06:48:28 +00:00
// UpdateUe implements updateUe operation.
//
// Updates a Ue and persists changes to storage.
//
// PATCH /ues/{id}
UpdateUe(ctx context.Context, req *UpdateUeReq, params UpdateUeParams) (UpdateUeRes, error)
2022-08-31 07:49:08 +00:00
// UpdateUser implements updateUser operation.
//
// Updates a User and persists changes to storage.
2022-08-31 06:18:14 +00:00
//
// PATCH /users/{id}
2022-08-31 07:49:08 +00:00
UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)
2022-08-31 06:18:14 +00:00
}
// Server implements http server based on OpenAPI v3 specification and
// calls Handler to handle requests.
type Server struct {
2022-08-31 07:49:08 +00:00
h Handler
baseServer
2022-08-31 06:18:14 +00:00
}
2022-08-31 07:49:08 +00:00
// NewServer creates new Server.
func NewServer(h Handler, opts ...ServerOption) (*Server, error) {
s, err := newServerConfig(opts...).baseServer()
if err != nil {
2022-08-31 06:18:14 +00:00
return nil, err
}
2022-08-31 07:49:08 +00:00
return &Server{
h: h,
baseServer: s,
}, nil
2022-08-31 06:18:14 +00:00
}