// Code generated by ogen, DO NOT EDIT.

package ogent

import (
	"context"
)

// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
	// CreateAllTypes implements createAllTypes operation.
	//
	// Creates a new AllTypes and persists it to storage.
	//
	// POST /all-types
	CreateAllTypes(ctx context.Context, req *CreateAllTypesReq) (CreateAllTypesRes, error)
	// CreateCategory implements createCategory operation.
	//
	// Creates a new Category and persists it to storage.
	//
	// POST /categories
	CreateCategory(ctx context.Context, req *CreateCategoryReq) (CreateCategoryRes, error)
	// CreateHat implements createHat operation.
	//
	// Creates a new Hat and persists it to storage.
	//
	// POST /hats
	CreateHat(ctx context.Context, req *CreateHatReq) (CreateHatRes, error)
	// CreatePet implements createPet operation.
	//
	// Creates a new Pet and persists it to storage.
	//
	// POST /pets
	CreatePet(ctx context.Context, req *CreatePetReq) (CreatePetRes, error)
	// CreateUser implements createUser operation.
	//
	// Creates a new User and persists it to storage.
	//
	// POST /users
	CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)
	// DeleteAllTypes implements deleteAllTypes operation.
	//
	// Deletes the AllTypes with the requested ID.
	//
	// DELETE /all-types/{id}
	DeleteAllTypes(ctx context.Context, params DeleteAllTypesParams) (DeleteAllTypesRes, error)
	// DeleteCategory implements deleteCategory operation.
	//
	// Deletes the Category with the requested ID.
	//
	// DELETE /categories/{id}
	DeleteCategory(ctx context.Context, params DeleteCategoryParams) (DeleteCategoryRes, error)
	// DeleteHat implements deleteHat operation.
	//
	// Deletes the Hat with the requested ID.
	//
	// DELETE /hats/{id}
	DeleteHat(ctx context.Context, params DeleteHatParams) (DeleteHatRes, error)
	// DeletePet implements deletePet operation.
	//
	// Deletes the Pet with the requested ID.
	//
	// DELETE /pets/{id}
	DeletePet(ctx context.Context, params DeletePetParams) (DeletePetRes, error)
	// DeleteUser implements deleteUser operation.
	//
	// Deletes the User with the requested ID.
	//
	// DELETE /users/{id}
	DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
	// ListAllTypes implements listAllTypes operation.
	//
	// List AllTypes.
	//
	// GET /all-types
	ListAllTypes(ctx context.Context, params ListAllTypesParams) (ListAllTypesRes, error)
	// ListCategory implements listCategory operation.
	//
	// List Categories.
	//
	// GET /categories
	ListCategory(ctx context.Context, params ListCategoryParams) (ListCategoryRes, error)
	// ListCategoryPets implements listCategoryPets operation.
	//
	// List attached Pets.
	//
	// GET /categories/{id}/pets
	ListCategoryPets(ctx context.Context, params ListCategoryPetsParams) (ListCategoryPetsRes, error)
	// ListHat implements listHat operation.
	//
	// List Hats.
	//
	// GET /hats
	ListHat(ctx context.Context, params ListHatParams) (ListHatRes, error)
	// ListPet implements listPet operation.
	//
	// List Pets.
	//
	// GET /pets
	ListPet(ctx context.Context, params ListPetParams) (ListPetRes, error)
	// ListPetCategories implements listPetCategories operation.
	//
	// List attached Categories.
	//
	// GET /pets/{id}/categories
	ListPetCategories(ctx context.Context, params ListPetCategoriesParams) (ListPetCategoriesRes, error)
	// ListPetFriends implements listPetFriends operation.
	//
	// List attached Friends.
	//
	// GET /pets/{id}/friends
	ListPetFriends(ctx context.Context, params ListPetFriendsParams) (ListPetFriendsRes, error)
	// ListPetRescuer implements listPetRescuer operation.
	//
	// List attached Rescuers.
	//
	// GET /pets/{id}/rescuer
	ListPetRescuer(ctx context.Context, params ListPetRescuerParams) (ListPetRescuerRes, error)
	// ListUser implements listUser operation.
	//
	// List Users.
	//
	// GET /users
	ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
	// ListUserAnimalsSaved implements listUserAnimalsSaved operation.
	//
	// List attached AnimalsSaveds.
	//
	// GET /users/{id}/animals-saved
	ListUserAnimalsSaved(ctx context.Context, params ListUserAnimalsSavedParams) (ListUserAnimalsSavedRes, error)
	// ListUserPets implements listUserPets operation.
	//
	// List attached Pets.
	//
	// GET /users/{id}/pets
	ListUserPets(ctx context.Context, params ListUserPetsParams) (ListUserPetsRes, error)
	// ReadAllTypes implements readAllTypes operation.
	//
	// Finds the AllTypes with the requested ID and returns it.
	//
	// GET /all-types/{id}
	ReadAllTypes(ctx context.Context, params ReadAllTypesParams) (ReadAllTypesRes, error)
	// ReadCategory implements readCategory operation.
	//
	// Finds the Category with the requested ID and returns it.
	//
	// GET /categories/{id}
	ReadCategory(ctx context.Context, params ReadCategoryParams) (ReadCategoryRes, error)
	// ReadHat implements readHat operation.
	//
	// Finds the Hat with the requested ID and returns it.
	//
	// GET /hats/{id}
	ReadHat(ctx context.Context, params ReadHatParams) (ReadHatRes, error)
	// ReadHatWearer implements readHatWearer operation.
	//
	// Find the attached User of the Hat with the given ID.
	//
	// GET /hats/{id}/wearer
	ReadHatWearer(ctx context.Context, params ReadHatWearerParams) (ReadHatWearerRes, error)
	// ReadPet implements readPet operation.
	//
	// Finds the Pet with the requested ID and returns it.
	//
	// GET /pets/{id}
	ReadPet(ctx context.Context, params ReadPetParams) (ReadPetRes, error)
	// ReadPetOwner implements readPetOwner operation.
	//
	// Find the attached User of the Pet with the given ID.
	//
	// GET /pets/{id}/owner
	ReadPetOwner(ctx context.Context, params ReadPetOwnerParams) (ReadPetOwnerRes, error)
	// ReadUser implements readUser operation.
	//
	// Finds the User with the requested ID and returns it.
	//
	// GET /users/{id}
	ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)
	// ReadUserBestFriend implements readUserBestFriend operation.
	//
	// Find the attached User of the User with the given ID.
	//
	// GET /users/{id}/best-friend
	ReadUserBestFriend(ctx context.Context, params ReadUserBestFriendParams) (ReadUserBestFriendRes, error)
	// ReadUserFavoriteHat implements readUserFavoriteHat operation.
	//
	// Find the attached Hat of the User with the given ID.
	//
	// GET /users/{id}/favorite-hat
	ReadUserFavoriteHat(ctx context.Context, params ReadUserFavoriteHatParams) (ReadUserFavoriteHatRes, error)
	// UpdateAllTypes implements updateAllTypes operation.
	//
	// Updates a AllTypes and persists changes to storage.
	//
	// PATCH /all-types/{id}
	UpdateAllTypes(ctx context.Context, req *UpdateAllTypesReq, params UpdateAllTypesParams) (UpdateAllTypesRes, error)
	// UpdateCategory implements updateCategory operation.
	//
	// Updates a Category and persists changes to storage.
	//
	// PATCH /categories/{id}
	UpdateCategory(ctx context.Context, req *UpdateCategoryReq, params UpdateCategoryParams) (UpdateCategoryRes, error)
	// UpdateHat implements updateHat operation.
	//
	// Updates a Hat and persists changes to storage.
	//
	// PATCH /hats/{id}
	UpdateHat(ctx context.Context, req *UpdateHatReq, params UpdateHatParams) (UpdateHatRes, error)
	// UpdatePet implements updatePet operation.
	//
	// Updates a Pet and persists changes to storage.
	//
	// PATCH /pets/{id}
	UpdatePet(ctx context.Context, req *UpdatePetReq, params UpdatePetParams) (UpdatePetRes, error)
	// UpdateUser implements updateUser operation.
	//
	// Updates a User and persists changes to storage.
	//
	// PATCH /users/{id}
	UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)
}

// Server implements http server based on OpenAPI v3 specification and
// calls Handler to handle requests.
type Server struct {
	h Handler
	baseServer
}

// NewServer creates new Server.
func NewServer(h Handler, opts ...ServerOption) (*Server, error) {
	s, err := newServerConfig(opts...).baseServer()
	if err != nil {
		return nil, err
	}
	return &Server{
		h:          h,
		baseServer: s,
	}, nil
}
