This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/pkg/openapi/oas_schemas_gen.go

234 lines
4.5 KiB
Go
Raw Normal View History

2024-02-01 18:57:25 +00:00
// Code generated by ogen, DO NOT EDIT.
2024-02-01 22:09:09 +00:00
package openapi
2024-02-01 18:57:25 +00:00
import (
"fmt"
)
func (s *ErrorStatusCode) Error() string {
return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response)
}
// Ref: #/components/schemas/Error
type Error struct {
2024-02-01 22:09:09 +00:00
Message string `json:"message"`
Code int `json:"code"`
2024-02-01 18:57:25 +00:00
}
// GetMessage returns the value of Message.
2024-02-01 22:09:09 +00:00
func (s *Error) GetMessage() string {
2024-02-01 18:57:25 +00:00
return s.Message
}
// GetCode returns the value of Code.
2024-02-01 22:09:09 +00:00
func (s *Error) GetCode() int {
2024-02-01 18:57:25 +00:00
return s.Code
}
// SetMessage sets the value of Message.
2024-02-01 22:09:09 +00:00
func (s *Error) SetMessage(val string) {
2024-02-01 18:57:25 +00:00
s.Message = val
}
// SetCode sets the value of Code.
2024-02-01 22:09:09 +00:00
func (s *Error) SetCode(val int) {
2024-02-01 18:57:25 +00:00
s.Code = val
}
2024-02-02 14:39:13 +00:00
func (*Error) groupsIDDeleteRes() {}
func (*Error) groupsIDGetRes() {}
func (*Error) groupsIDPutRes() {}
func (*Error) usersIDDeleteRes() {}
func (*Error) usersIDGetRes() {}
func (*Error) usersIDPutRes() {}
2024-02-01 18:57:25 +00:00
// ErrorStatusCode wraps Error with StatusCode.
type ErrorStatusCode struct {
StatusCode int
Response Error
}
// GetStatusCode returns the value of StatusCode.
func (s *ErrorStatusCode) GetStatusCode() int {
return s.StatusCode
}
// GetResponse returns the value of Response.
func (s *ErrorStatusCode) GetResponse() Error {
return s.Response
}
// SetStatusCode sets the value of StatusCode.
func (s *ErrorStatusCode) SetStatusCode(val int) {
s.StatusCode = val
}
// SetResponse sets the value of Response.
func (s *ErrorStatusCode) SetResponse(val Error) {
s.Response = val
}
// Ref: #/components/schemas/Group
type Group struct {
2024-02-02 14:39:13 +00:00
ID ID `json:"id"`
Name string `json:"name"`
UserIds []ID `json:"user_ids"`
2024-02-01 18:57:25 +00:00
}
// GetID returns the value of ID.
2024-02-01 22:09:09 +00:00
func (s *Group) GetID() ID {
2024-02-01 18:57:25 +00:00
return s.ID
}
// GetName returns the value of Name.
2024-02-01 22:09:09 +00:00
func (s *Group) GetName() string {
2024-02-01 18:57:25 +00:00
return s.Name
}
2024-02-02 14:39:13 +00:00
// GetUserIds returns the value of UserIds.
func (s *Group) GetUserIds() []ID {
return s.UserIds
2024-02-01 18:57:25 +00:00
}
// SetID sets the value of ID.
2024-02-01 22:09:09 +00:00
func (s *Group) SetID(val ID) {
2024-02-01 18:57:25 +00:00
s.ID = val
}
// SetName sets the value of Name.
2024-02-01 22:09:09 +00:00
func (s *Group) SetName(val string) {
2024-02-01 18:57:25 +00:00
s.Name = val
}
2024-02-02 14:39:13 +00:00
// SetUserIds sets the value of UserIds.
func (s *Group) SetUserIds(val []ID) {
s.UserIds = val
2024-02-01 18:57:25 +00:00
}
func (*Group) groupsIDGetRes() {}
func (*Group) groupsIDPutRes() {}
// Ref: #/components/schemas/GroupUpdate
type GroupUpdate struct {
2024-02-01 22:09:09 +00:00
Name string `json:"name"`
2024-02-01 18:57:25 +00:00
}
// GetName returns the value of Name.
2024-02-01 22:09:09 +00:00
func (s *GroupUpdate) GetName() string {
2024-02-01 18:57:25 +00:00
return s.Name
}
// SetName sets the value of Name.
2024-02-01 22:09:09 +00:00
func (s *GroupUpdate) SetName(val string) {
2024-02-01 18:57:25 +00:00
s.Name = val
}
type ID int64
// Ref: #/components/schemas/Ok
type Ok struct {
2024-02-01 22:09:09 +00:00
Message string `json:"message"`
2024-02-01 18:57:25 +00:00
}
// GetMessage returns the value of Message.
2024-02-01 22:09:09 +00:00
func (s *Ok) GetMessage() string {
2024-02-01 18:57:25 +00:00
return s.Message
}
// SetMessage sets the value of Message.
2024-02-01 22:09:09 +00:00
func (s *Ok) SetMessage(val string) {
2024-02-01 18:57:25 +00:00
s.Message = val
}
func (*Ok) groupsIDDeleteRes() {}
func (*Ok) usersIDDeleteRes() {}
// Ref: #/components/schemas/User
type User struct {
2024-02-02 14:39:13 +00:00
ID ID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
GroupID ID `json:"group_id"`
2024-02-01 18:57:25 +00:00
}
// GetID returns the value of ID.
2024-02-01 22:09:09 +00:00
func (s *User) GetID() ID {
2024-02-01 18:57:25 +00:00
return s.ID
}
// GetName returns the value of Name.
2024-02-01 22:09:09 +00:00
func (s *User) GetName() string {
2024-02-01 18:57:25 +00:00
return s.Name
}
// GetEmail returns the value of Email.
2024-02-01 22:09:09 +00:00
func (s *User) GetEmail() string {
2024-02-01 18:57:25 +00:00
return s.Email
}
2024-02-02 14:39:13 +00:00
// GetGroupID returns the value of GroupID.
func (s *User) GetGroupID() ID {
return s.GroupID
2024-02-01 18:57:25 +00:00
}
// SetID sets the value of ID.
2024-02-01 22:09:09 +00:00
func (s *User) SetID(val ID) {
2024-02-01 18:57:25 +00:00
s.ID = val
}
// SetName sets the value of Name.
2024-02-01 22:09:09 +00:00
func (s *User) SetName(val string) {
2024-02-01 18:57:25 +00:00
s.Name = val
}
// SetEmail sets the value of Email.
2024-02-01 22:09:09 +00:00
func (s *User) SetEmail(val string) {
2024-02-01 18:57:25 +00:00
s.Email = val
}
2024-02-02 14:39:13 +00:00
// SetGroupID sets the value of GroupID.
func (s *User) SetGroupID(val ID) {
s.GroupID = val
2024-02-01 18:57:25 +00:00
}
2024-02-02 14:39:13 +00:00
func (*User) usersIDGetRes() {}
func (*User) usersIDPutRes() {}
2024-02-01 18:57:25 +00:00
// Ref: #/components/schemas/UserUpdate
type UserUpdate struct {
2024-02-02 14:39:13 +00:00
Name string `json:"name"`
Email string `json:"email"`
GroupID ID `json:"group_id"`
2024-02-01 18:57:25 +00:00
}
// GetName returns the value of Name.
2024-02-01 22:09:09 +00:00
func (s *UserUpdate) GetName() string {
2024-02-01 18:57:25 +00:00
return s.Name
}
// GetEmail returns the value of Email.
2024-02-01 22:09:09 +00:00
func (s *UserUpdate) GetEmail() string {
2024-02-01 18:57:25 +00:00
return s.Email
}
2024-02-02 14:39:13 +00:00
// GetGroupID returns the value of GroupID.
func (s *UserUpdate) GetGroupID() ID {
return s.GroupID
}
2024-02-01 18:57:25 +00:00
// SetName sets the value of Name.
2024-02-01 22:09:09 +00:00
func (s *UserUpdate) SetName(val string) {
2024-02-01 18:57:25 +00:00
s.Name = val
}
// SetEmail sets the value of Email.
2024-02-01 22:09:09 +00:00
func (s *UserUpdate) SetEmail(val string) {
2024-02-01 18:57:25 +00:00
s.Email = val
}
2024-02-02 14:39:13 +00:00
// SetGroupID sets the value of GroupID.
func (s *UserUpdate) SetGroupID(val ID) {
s.GroupID = val
2024-02-01 18:57:25 +00:00
}