422 lines
7.9 KiB
Go
422 lines
7.9 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package api
|
|
|
|
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 OptString `json:"message"`
|
|
Code OptInt `json:"code"`
|
|
}
|
|
|
|
// GetMessage returns the value of Message.
|
|
func (s *Error) GetMessage() OptString {
|
|
return s.Message
|
|
}
|
|
|
|
// GetCode returns the value of Code.
|
|
func (s *Error) GetCode() OptInt {
|
|
return s.Code
|
|
}
|
|
|
|
// SetMessage sets the value of Message.
|
|
func (s *Error) SetMessage(val OptString) {
|
|
s.Message = val
|
|
}
|
|
|
|
// SetCode sets the value of Code.
|
|
func (s *Error) SetCode(val OptInt) {
|
|
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 OptID `json:"id"`
|
|
Name OptString `json:"name"`
|
|
Users []User `json:"users"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Group) GetID() OptID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *Group) GetName() OptString {
|
|
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 OptID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *Group) SetName(val OptString) {
|
|
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 OptString `json:"name"`
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *GroupUpdate) GetName() OptString {
|
|
return s.Name
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *GroupUpdate) SetName(val OptString) {
|
|
s.Name = val
|
|
}
|
|
|
|
type ID int64
|
|
|
|
// Ref: #/components/schemas/Ok
|
|
type Ok struct {
|
|
Message OptString `json:"message"`
|
|
}
|
|
|
|
// GetMessage returns the value of Message.
|
|
func (s *Ok) GetMessage() OptString {
|
|
return s.Message
|
|
}
|
|
|
|
// SetMessage sets the value of Message.
|
|
func (s *Ok) SetMessage(val OptString) {
|
|
s.Message = val
|
|
}
|
|
|
|
func (*Ok) groupsIDDeleteRes() {}
|
|
func (*Ok) usersIDDeleteRes() {}
|
|
|
|
// NewOptGroup returns new OptGroup with value set to v.
|
|
func NewOptGroup(v Group) OptGroup {
|
|
return OptGroup{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptGroup is optional Group.
|
|
type OptGroup struct {
|
|
Value Group
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptGroup was set.
|
|
func (o OptGroup) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptGroup) Reset() {
|
|
var v Group
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptGroup) SetTo(v Group) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptGroup) Get() (v Group, 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 OptGroup) Or(d Group) Group {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewOptInt returns new OptInt with value set to v.
|
|
func NewOptInt(v int) OptInt {
|
|
return OptInt{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptInt is optional int.
|
|
type OptInt struct {
|
|
Value int
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptInt was set.
|
|
func (o OptInt) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptInt) Reset() {
|
|
var v int
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptInt) SetTo(v int) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptInt) Get() (v int, 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 OptInt) Or(d int) int {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// NewOptString returns new OptString with value set to v.
|
|
func NewOptString(v string) OptString {
|
|
return OptString{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptString is optional string.
|
|
type OptString struct {
|
|
Value string
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptString was set.
|
|
func (o OptString) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptString) Reset() {
|
|
var v string
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptString) SetTo(v string) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptString) Get() (v string, 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 OptString) Or(d string) string {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// Ref: #/components/schemas/User
|
|
type User struct {
|
|
ID OptID `json:"id"`
|
|
Name OptString `json:"name"`
|
|
Email OptString `json:"email"`
|
|
Group OptGroup `json:"group"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *User) GetID() OptID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *User) GetName() OptString {
|
|
return s.Name
|
|
}
|
|
|
|
// GetEmail returns the value of Email.
|
|
func (s *User) GetEmail() OptString {
|
|
return s.Email
|
|
}
|
|
|
|
// GetGroup returns the value of Group.
|
|
func (s *User) GetGroup() OptGroup {
|
|
return s.Group
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *User) SetID(val OptID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *User) SetName(val OptString) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetEmail sets the value of Email.
|
|
func (s *User) SetEmail(val OptString) {
|
|
s.Email = val
|
|
}
|
|
|
|
// SetGroup sets the value of Group.
|
|
func (s *User) SetGroup(val OptGroup) {
|
|
s.Group = val
|
|
}
|
|
|
|
func (*User) usersIDGetRes() {}
|
|
func (*User) usersIDGroupPutRes() {}
|
|
func (*User) usersIDPutRes() {}
|
|
|
|
// Ref: #/components/schemas/UserUpdate
|
|
type UserUpdate struct {
|
|
Name OptString `json:"name"`
|
|
Email OptString `json:"email"`
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *UserUpdate) GetName() OptString {
|
|
return s.Name
|
|
}
|
|
|
|
// GetEmail returns the value of Email.
|
|
func (s *UserUpdate) GetEmail() OptString {
|
|
return s.Email
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *UserUpdate) SetName(val OptString) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetEmail sets the value of Email.
|
|
func (s *UserUpdate) SetEmail(val OptString) {
|
|
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
|
|
}
|