feat: init
This commit is contained in:
parent
7688020b52
commit
6302dd62d6
33 changed files with 6027 additions and 0 deletions
519
pkg/rest/oas_schemas_gen.go
Normal file
519
pkg/rest/oas_schemas_gen.go
Normal file
|
|
@ -0,0 +1,519 @@
|
|||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package gsn
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func (s *ErrorStatusCode) Error() string {
|
||||
return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response)
|
||||
}
|
||||
|
||||
// Ref: #/components/schemas/Error
|
||||
type Error struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// GetCode returns the value of Code.
|
||||
func (s *Error) GetCode() int {
|
||||
return s.Code
|
||||
}
|
||||
|
||||
// GetMessage returns the value of Message.
|
||||
func (s *Error) GetMessage() string {
|
||||
return s.Message
|
||||
}
|
||||
|
||||
// SetCode sets the value of Code.
|
||||
func (s *Error) SetCode(val int) {
|
||||
s.Code = val
|
||||
}
|
||||
|
||||
// SetMessage sets the value of Message.
|
||||
func (s *Error) SetMessage(val string) {
|
||||
s.Message = val
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
type GetSatellitesOK struct {
|
||||
Satellites []GetSatellitesOKSatellitesItem `json:"satellites"`
|
||||
}
|
||||
|
||||
// GetSatellites returns the value of Satellites.
|
||||
func (s *GetSatellitesOK) GetSatellites() []GetSatellitesOKSatellitesItem {
|
||||
return s.Satellites
|
||||
}
|
||||
|
||||
// SetSatellites sets the value of Satellites.
|
||||
func (s *GetSatellitesOK) SetSatellites(val []GetSatellitesOKSatellitesItem) {
|
||||
s.Satellites = val
|
||||
}
|
||||
|
||||
type GetSatellitesOKSatellitesItem struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Status GetSatellitesOKSatellitesItemStatus `json:"status"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *GetSatellitesOKSatellitesItem) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// GetDisplayName returns the value of DisplayName.
|
||||
func (s *GetSatellitesOKSatellitesItem) GetDisplayName() string {
|
||||
return s.DisplayName
|
||||
}
|
||||
|
||||
// GetStatus returns the value of Status.
|
||||
func (s *GetSatellitesOKSatellitesItem) GetStatus() GetSatellitesOKSatellitesItemStatus {
|
||||
return s.Status
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *GetSatellitesOKSatellitesItem) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// SetDisplayName sets the value of DisplayName.
|
||||
func (s *GetSatellitesOKSatellitesItem) SetDisplayName(val string) {
|
||||
s.DisplayName = val
|
||||
}
|
||||
|
||||
// SetStatus sets the value of Status.
|
||||
func (s *GetSatellitesOKSatellitesItem) SetStatus(val GetSatellitesOKSatellitesItemStatus) {
|
||||
s.Status = val
|
||||
}
|
||||
|
||||
type GetSatellitesOKSatellitesItemStatus string
|
||||
|
||||
const (
|
||||
GetSatellitesOKSatellitesItemStatusActive GetSatellitesOKSatellitesItemStatus = "active"
|
||||
GetSatellitesOKSatellitesItemStatusOffline GetSatellitesOKSatellitesItemStatus = "offline"
|
||||
GetSatellitesOKSatellitesItemStatusBusy GetSatellitesOKSatellitesItemStatus = "busy"
|
||||
)
|
||||
|
||||
// AllValues returns all GetSatellitesOKSatellitesItemStatus values.
|
||||
func (GetSatellitesOKSatellitesItemStatus) AllValues() []GetSatellitesOKSatellitesItemStatus {
|
||||
return []GetSatellitesOKSatellitesItemStatus{
|
||||
GetSatellitesOKSatellitesItemStatusActive,
|
||||
GetSatellitesOKSatellitesItemStatusOffline,
|
||||
GetSatellitesOKSatellitesItemStatusBusy,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s GetSatellitesOKSatellitesItemStatus) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case GetSatellitesOKSatellitesItemStatusActive:
|
||||
return []byte(s), nil
|
||||
case GetSatellitesOKSatellitesItemStatusOffline:
|
||||
return []byte(s), nil
|
||||
case GetSatellitesOKSatellitesItemStatusBusy:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *GetSatellitesOKSatellitesItemStatus) UnmarshalText(data []byte) error {
|
||||
switch GetSatellitesOKSatellitesItemStatus(data) {
|
||||
case GetSatellitesOKSatellitesItemStatusActive:
|
||||
*s = GetSatellitesOKSatellitesItemStatusActive
|
||||
return nil
|
||||
case GetSatellitesOKSatellitesItemStatusOffline:
|
||||
*s = GetSatellitesOKSatellitesItemStatusOffline
|
||||
return nil
|
||||
case GetSatellitesOKSatellitesItemStatusBusy:
|
||||
*s = GetSatellitesOKSatellitesItemStatusBusy
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type GetStationsOK struct {
|
||||
Stations []GetStationsOKStationsItem `json:"stations"`
|
||||
}
|
||||
|
||||
// GetStations returns the value of Stations.
|
||||
func (s *GetStationsOK) GetStations() []GetStationsOKStationsItem {
|
||||
return s.Stations
|
||||
}
|
||||
|
||||
// SetStations sets the value of Stations.
|
||||
func (s *GetStationsOK) SetStations(val []GetStationsOKStationsItem) {
|
||||
s.Stations = val
|
||||
}
|
||||
|
||||
type GetStationsOKStationsItem struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Status GetStationsOKStationsItemStatus `json:"status"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *GetStationsOKStationsItem) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// GetSlug returns the value of Slug.
|
||||
func (s *GetStationsOKStationsItem) GetSlug() string {
|
||||
return s.Slug
|
||||
}
|
||||
|
||||
// GetStatus returns the value of Status.
|
||||
func (s *GetStationsOKStationsItem) GetStatus() GetStationsOKStationsItemStatus {
|
||||
return s.Status
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *GetStationsOKStationsItem) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// SetSlug sets the value of Slug.
|
||||
func (s *GetStationsOKStationsItem) SetSlug(val string) {
|
||||
s.Slug = val
|
||||
}
|
||||
|
||||
// SetStatus sets the value of Status.
|
||||
func (s *GetStationsOKStationsItem) SetStatus(val GetStationsOKStationsItemStatus) {
|
||||
s.Status = val
|
||||
}
|
||||
|
||||
type GetStationsOKStationsItemStatus string
|
||||
|
||||
const (
|
||||
GetStationsOKStationsItemStatusActive GetStationsOKStationsItemStatus = "active"
|
||||
GetStationsOKStationsItemStatusOffline GetStationsOKStationsItemStatus = "offline"
|
||||
GetStationsOKStationsItemStatusBusy GetStationsOKStationsItemStatus = "busy"
|
||||
)
|
||||
|
||||
// AllValues returns all GetStationsOKStationsItemStatus values.
|
||||
func (GetStationsOKStationsItemStatus) AllValues() []GetStationsOKStationsItemStatus {
|
||||
return []GetStationsOKStationsItemStatus{
|
||||
GetStationsOKStationsItemStatusActive,
|
||||
GetStationsOKStationsItemStatusOffline,
|
||||
GetStationsOKStationsItemStatusBusy,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s GetStationsOKStationsItemStatus) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case GetStationsOKStationsItemStatusActive:
|
||||
return []byte(s), nil
|
||||
case GetStationsOKStationsItemStatusOffline:
|
||||
return []byte(s), nil
|
||||
case GetStationsOKStationsItemStatusBusy:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *GetStationsOKStationsItemStatus) UnmarshalText(data []byte) error {
|
||||
switch GetStationsOKStationsItemStatus(data) {
|
||||
case GetStationsOKStationsItemStatusActive:
|
||||
*s = GetStationsOKStationsItemStatusActive
|
||||
return nil
|
||||
case GetStationsOKStationsItemStatusOffline:
|
||||
*s = GetStationsOKStationsItemStatusOffline
|
||||
return nil
|
||||
case GetStationsOKStationsItemStatusBusy:
|
||||
*s = GetStationsOKStationsItemStatusBusy
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type GetSubscriptionsOK struct {
|
||||
Subscriptions []GetSubscriptionsOKSubscriptionsItem `json:"subscriptions"`
|
||||
}
|
||||
|
||||
// GetSubscriptions returns the value of Subscriptions.
|
||||
func (s *GetSubscriptionsOK) GetSubscriptions() []GetSubscriptionsOKSubscriptionsItem {
|
||||
return s.Subscriptions
|
||||
}
|
||||
|
||||
// SetSubscriptions sets the value of Subscriptions.
|
||||
func (s *GetSubscriptionsOK) SetSubscriptions(val []GetSubscriptionsOKSubscriptionsItem) {
|
||||
s.Subscriptions = val
|
||||
}
|
||||
|
||||
type GetSubscriptionsOKSubscriptionsItem struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Type GetSubscriptionsOKSubscriptionsItemType `json:"type"`
|
||||
Status GetSubscriptionsOKSubscriptionsItemStatus `json:"status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// GetType returns the value of Type.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) GetType() GetSubscriptionsOKSubscriptionsItemType {
|
||||
return s.Type
|
||||
}
|
||||
|
||||
// GetStatus returns the value of Status.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) GetStatus() GetSubscriptionsOKSubscriptionsItemStatus {
|
||||
return s.Status
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the value of CreatedAt.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) GetCreatedAt() time.Time {
|
||||
return s.CreatedAt
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// SetType sets the value of Type.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) SetType(val GetSubscriptionsOKSubscriptionsItemType) {
|
||||
s.Type = val
|
||||
}
|
||||
|
||||
// SetStatus sets the value of Status.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) SetStatus(val GetSubscriptionsOKSubscriptionsItemStatus) {
|
||||
s.Status = val
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the value of CreatedAt.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItem) SetCreatedAt(val time.Time) {
|
||||
s.CreatedAt = val
|
||||
}
|
||||
|
||||
type GetSubscriptionsOKSubscriptionsItemStatus string
|
||||
|
||||
const (
|
||||
GetSubscriptionsOKSubscriptionsItemStatusActive GetSubscriptionsOKSubscriptionsItemStatus = "active"
|
||||
GetSubscriptionsOKSubscriptionsItemStatusOffline GetSubscriptionsOKSubscriptionsItemStatus = "offline"
|
||||
GetSubscriptionsOKSubscriptionsItemStatusBusy GetSubscriptionsOKSubscriptionsItemStatus = "busy"
|
||||
)
|
||||
|
||||
// AllValues returns all GetSubscriptionsOKSubscriptionsItemStatus values.
|
||||
func (GetSubscriptionsOKSubscriptionsItemStatus) AllValues() []GetSubscriptionsOKSubscriptionsItemStatus {
|
||||
return []GetSubscriptionsOKSubscriptionsItemStatus{
|
||||
GetSubscriptionsOKSubscriptionsItemStatusActive,
|
||||
GetSubscriptionsOKSubscriptionsItemStatusOffline,
|
||||
GetSubscriptionsOKSubscriptionsItemStatusBusy,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s GetSubscriptionsOKSubscriptionsItemStatus) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusActive:
|
||||
return []byte(s), nil
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusOffline:
|
||||
return []byte(s), nil
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusBusy:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItemStatus) UnmarshalText(data []byte) error {
|
||||
switch GetSubscriptionsOKSubscriptionsItemStatus(data) {
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusActive:
|
||||
*s = GetSubscriptionsOKSubscriptionsItemStatusActive
|
||||
return nil
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusOffline:
|
||||
*s = GetSubscriptionsOKSubscriptionsItemStatusOffline
|
||||
return nil
|
||||
case GetSubscriptionsOKSubscriptionsItemStatusBusy:
|
||||
*s = GetSubscriptionsOKSubscriptionsItemStatusBusy
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
type GetSubscriptionsOKSubscriptionsItemType string
|
||||
|
||||
const (
|
||||
GetSubscriptionsOKSubscriptionsItemTypeStation GetSubscriptionsOKSubscriptionsItemType = "station"
|
||||
GetSubscriptionsOKSubscriptionsItemTypeSatellite GetSubscriptionsOKSubscriptionsItemType = "satellite"
|
||||
)
|
||||
|
||||
// AllValues returns all GetSubscriptionsOKSubscriptionsItemType values.
|
||||
func (GetSubscriptionsOKSubscriptionsItemType) AllValues() []GetSubscriptionsOKSubscriptionsItemType {
|
||||
return []GetSubscriptionsOKSubscriptionsItemType{
|
||||
GetSubscriptionsOKSubscriptionsItemTypeStation,
|
||||
GetSubscriptionsOKSubscriptionsItemTypeSatellite,
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalText implements encoding.TextMarshaler.
|
||||
func (s GetSubscriptionsOKSubscriptionsItemType) MarshalText() ([]byte, error) {
|
||||
switch s {
|
||||
case GetSubscriptionsOKSubscriptionsItemTypeStation:
|
||||
return []byte(s), nil
|
||||
case GetSubscriptionsOKSubscriptionsItemTypeSatellite:
|
||||
return []byte(s), nil
|
||||
default:
|
||||
return nil, errors.Errorf("invalid value: %q", s)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (s *GetSubscriptionsOKSubscriptionsItemType) UnmarshalText(data []byte) error {
|
||||
switch GetSubscriptionsOKSubscriptionsItemType(data) {
|
||||
case GetSubscriptionsOKSubscriptionsItemTypeStation:
|
||||
*s = GetSubscriptionsOKSubscriptionsItemTypeStation
|
||||
return nil
|
||||
case GetSubscriptionsOKSubscriptionsItemTypeSatellite:
|
||||
*s = GetSubscriptionsOKSubscriptionsItemTypeSatellite
|
||||
return nil
|
||||
default:
|
||||
return errors.Errorf("invalid value: %q", data)
|
||||
}
|
||||
}
|
||||
|
||||
// NewOptUUID returns new OptUUID with value set to v.
|
||||
func NewOptUUID(v uuid.UUID) OptUUID {
|
||||
return OptUUID{
|
||||
Value: v,
|
||||
Set: true,
|
||||
}
|
||||
}
|
||||
|
||||
// OptUUID is optional uuid.UUID.
|
||||
type OptUUID struct {
|
||||
Value uuid.UUID
|
||||
Set bool
|
||||
}
|
||||
|
||||
// IsSet returns true if OptUUID was set.
|
||||
func (o OptUUID) IsSet() bool { return o.Set }
|
||||
|
||||
// Reset unsets value.
|
||||
func (o *OptUUID) Reset() {
|
||||
var v uuid.UUID
|
||||
o.Value = v
|
||||
o.Set = false
|
||||
}
|
||||
|
||||
// SetTo sets value to v.
|
||||
func (o *OptUUID) SetTo(v uuid.UUID) {
|
||||
o.Set = true
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// Get returns value and boolean that denotes whether value was set.
|
||||
func (o OptUUID) Get() (v uuid.UUID, 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 OptUUID) Or(d uuid.UUID) uuid.UUID {
|
||||
if v, ok := o.Get(); ok {
|
||||
return v
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
type SubscribeSatelliteOK struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *SubscribeSatelliteOK) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *SubscribeSatelliteOK) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
type SubscribeSatelliteReq struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *SubscribeSatelliteReq) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *SubscribeSatelliteReq) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
type SubscribeStationOK struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *SubscribeStationOK) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *SubscribeStationOK) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
type SubscribeStationReq struct {
|
||||
// Subscription ID.
|
||||
ID uuid.UUID `json:"id"`
|
||||
}
|
||||
|
||||
// GetID returns the value of ID.
|
||||
func (s *SubscribeStationReq) GetID() uuid.UUID {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
// SetID sets the value of ID.
|
||||
func (s *SubscribeStationReq) SetID(val uuid.UUID) {
|
||||
s.ID = val
|
||||
}
|
||||
|
||||
// UnsubscribeOK is response for Unsubscribe operation.
|
||||
type UnsubscribeOK struct{}
|
||||
Loading…
Add table
Add a link
Reference in a new issue