284 lines
5.4 KiB
Go
284 lines
5.4 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package openapi
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func (s *ErrorStatusCode) Error() string {
|
|
return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response)
|
|
}
|
|
|
|
// Ref: #/components/schemas/Error
|
|
type Error struct {
|
|
Message string `json:"message"`
|
|
Code int `json:"code"`
|
|
}
|
|
|
|
// GetMessage returns the value of Message.
|
|
func (s *Error) GetMessage() string {
|
|
return s.Message
|
|
}
|
|
|
|
// GetCode returns the value of Code.
|
|
func (s *Error) GetCode() int {
|
|
return s.Code
|
|
}
|
|
|
|
// SetMessage sets the value of Message.
|
|
func (s *Error) SetMessage(val string) {
|
|
s.Message = val
|
|
}
|
|
|
|
// SetCode sets the value of Code.
|
|
func (s *Error) SetCode(val int) {
|
|
s.Code = val
|
|
}
|
|
|
|
func (*Error) groupsIDDeleteRes() {}
|
|
func (*Error) groupsIDGetRes() {}
|
|
func (*Error) groupsIDPutRes() {}
|
|
func (*Error) usersIDDeleteRes() {}
|
|
func (*Error) usersIDGetRes() {}
|
|
func (*Error) usersIDGroupPutRes() {}
|
|
func (*Error) usersIDPutRes() {}
|
|
|
|
// 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 {
|
|
ID ID `json:"id"`
|
|
Name string `json:"name"`
|
|
Users []User `json:"users"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Group) GetID() ID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *Group) GetName() string {
|
|
return s.Name
|
|
}
|
|
|
|
// GetUsers returns the value of Users.
|
|
func (s *Group) GetUsers() []User {
|
|
return s.Users
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Group) SetID(val ID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *Group) SetName(val string) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetUsers sets the value of Users.
|
|
func (s *Group) SetUsers(val []User) {
|
|
s.Users = val
|
|
}
|
|
|
|
func (*Group) groupsIDGetRes() {}
|
|
func (*Group) groupsIDPutRes() {}
|
|
|
|
// Ref: #/components/schemas/GroupUpdate
|
|
type GroupUpdate struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *GroupUpdate) GetName() string {
|
|
return s.Name
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *GroupUpdate) SetName(val string) {
|
|
s.Name = val
|
|
}
|
|
|
|
type ID int64
|
|
|
|
// Ref: #/components/schemas/Ok
|
|
type Ok struct {
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
// GetMessage returns the value of Message.
|
|
func (s *Ok) GetMessage() string {
|
|
return s.Message
|
|
}
|
|
|
|
// SetMessage sets the value of Message.
|
|
func (s *Ok) SetMessage(val string) {
|
|
s.Message = val
|
|
}
|
|
|
|
func (*Ok) groupsIDDeleteRes() {}
|
|
func (*Ok) usersIDDeleteRes() {}
|
|
|
|
// NewOptID returns new OptID with value set to v.
|
|
func NewOptID(v ID) OptID {
|
|
return OptID{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptID is optional ID.
|
|
type OptID struct {
|
|
Value ID
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptID was set.
|
|
func (o OptID) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptID) Reset() {
|
|
var v ID
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptID) SetTo(v ID) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptID) Get() (v ID, ok bool) {
|
|
if !o.Set {
|
|
return v, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// Or returns value if set, or given parameter if does not.
|
|
func (o OptID) Or(d ID) ID {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// Ref: #/components/schemas/User
|
|
type User struct {
|
|
ID ID `json:"id"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
Group Group `json:"group"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *User) GetID() ID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *User) GetName() string {
|
|
return s.Name
|
|
}
|
|
|
|
// GetEmail returns the value of Email.
|
|
func (s *User) GetEmail() string {
|
|
return s.Email
|
|
}
|
|
|
|
// GetGroup returns the value of Group.
|
|
func (s *User) GetGroup() Group {
|
|
return s.Group
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *User) SetID(val ID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *User) SetName(val string) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetEmail sets the value of Email.
|
|
func (s *User) SetEmail(val string) {
|
|
s.Email = val
|
|
}
|
|
|
|
// SetGroup sets the value of Group.
|
|
func (s *User) SetGroup(val Group) {
|
|
s.Group = val
|
|
}
|
|
|
|
func (*User) usersIDGetRes() {}
|
|
func (*User) usersIDGroupPutRes() {}
|
|
func (*User) usersIDPutRes() {}
|
|
|
|
// Ref: #/components/schemas/UserUpdate
|
|
type UserUpdate struct {
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *UserUpdate) GetName() string {
|
|
return s.Name
|
|
}
|
|
|
|
// GetEmail returns the value of Email.
|
|
func (s *UserUpdate) GetEmail() string {
|
|
return s.Email
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *UserUpdate) SetName(val string) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetEmail sets the value of Email.
|
|
func (s *UserUpdate) SetEmail(val string) {
|
|
s.Email = val
|
|
}
|
|
|
|
type UsersIDGroupPutReq struct {
|
|
Group OptID `json:"group"`
|
|
}
|
|
|
|
// GetGroup returns the value of Group.
|
|
func (s *UsersIDGroupPutReq) GetGroup() OptID {
|
|
return s.Group
|
|
}
|
|
|
|
// SetGroup sets the value of Group.
|
|
func (s *UsersIDGroupPutReq) SetGroup(val OptID) {
|
|
s.Group = val
|
|
}
|