forked from TrueCloudLab/frostfs-rest-gw
parent
c7c570fd10
commit
dc1926f9c6
18 changed files with 1837 additions and 126 deletions
89
gen/models/address.go
Normal file
89
gen/models/address.go
Normal file
|
@ -0,0 +1,89 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// Address address
|
||||
// Example: {"containerId":"5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv","objectId":"8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd"}
|
||||
//
|
||||
// swagger:model Address
|
||||
type Address struct {
|
||||
|
||||
// container Id
|
||||
// Required: true
|
||||
ContainerID *string `json:"containerId"`
|
||||
|
||||
// object Id
|
||||
// Required: true
|
||||
ObjectID *string `json:"objectId"`
|
||||
}
|
||||
|
||||
// Validate validates this address
|
||||
func (m *Address) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateContainerID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateObjectID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Address) validateContainerID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("containerId", "body", m.ContainerID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Address) validateObjectID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("objectId", "body", m.ObjectID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this address based on context it is used
|
||||
func (m *Address) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Address) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Address) UnmarshalBinary(b []byte) error {
|
||||
var res Address
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
110
gen/models/object_base_info.go
Normal file
110
gen/models/object_base_info.go
Normal file
|
@ -0,0 +1,110 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// ObjectBaseInfo object base info
|
||||
//
|
||||
// swagger:model ObjectBaseInfo
|
||||
type ObjectBaseInfo struct {
|
||||
|
||||
// address
|
||||
// Required: true
|
||||
Address *Address `json:"address"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this object base info
|
||||
func (m *ObjectBaseInfo) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAddress(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ObjectBaseInfo) validateAddress(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("address", "body", m.Address); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("address")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this object base info based on the context it is used
|
||||
func (m *ObjectBaseInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateAddress(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ObjectBaseInfo) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("address")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ObjectBaseInfo) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ObjectBaseInfo) UnmarshalBinary(b []byte) error {
|
||||
var res ObjectBaseInfo
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
136
gen/models/object_list.go
Normal file
136
gen/models/object_list.go
Normal file
|
@ -0,0 +1,136 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// ObjectList object list
|
||||
//
|
||||
// swagger:model ObjectList
|
||||
type ObjectList struct {
|
||||
|
||||
// objects
|
||||
// Required: true
|
||||
Objects []*ObjectBaseInfo `json:"objects"`
|
||||
|
||||
// size
|
||||
// Required: true
|
||||
Size *int64 `json:"size"`
|
||||
}
|
||||
|
||||
// Validate validates this object list
|
||||
func (m *ObjectList) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateObjects(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateSize(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ObjectList) validateObjects(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("objects", "body", m.Objects); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Objects); i++ {
|
||||
if swag.IsZero(m.Objects[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Objects[i] != nil {
|
||||
if err := m.Objects[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ObjectList) validateSize(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("size", "body", m.Size); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this object list based on the context it is used
|
||||
func (m *ObjectList) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateObjects(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ObjectList) contextValidateObjects(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Objects); i++ {
|
||||
|
||||
if m.Objects[i] != nil {
|
||||
if err := m.Objects[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ObjectList) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ObjectList) UnmarshalBinary(b []byte) error {
|
||||
var res ObjectList
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
145
gen/models/search_filter.go
Normal file
145
gen/models/search_filter.go
Normal file
|
@ -0,0 +1,145 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// SearchFilter search filter
|
||||
//
|
||||
// swagger:model SearchFilter
|
||||
type SearchFilter struct {
|
||||
|
||||
// key
|
||||
// Required: true
|
||||
Key *string `json:"key"`
|
||||
|
||||
// match
|
||||
// Required: true
|
||||
Match *SearchMatch `json:"match"`
|
||||
|
||||
// value
|
||||
// Required: true
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
// Validate validates this search filter
|
||||
func (m *SearchFilter) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateKey(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMatch(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateValue(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilter) validateKey(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("key", "body", m.Key); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilter) validateMatch(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("match", "body", m.Match); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.Required("match", "body", m.Match); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Match != nil {
|
||||
if err := m.Match.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("match")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("match")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilter) validateValue(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("value", "body", m.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this search filter based on the context it is used
|
||||
func (m *SearchFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateMatch(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilter) contextValidateMatch(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Match != nil {
|
||||
if err := m.Match.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("match")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("match")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *SearchFilter) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *SearchFilter) UnmarshalBinary(b []byte) error {
|
||||
var res SearchFilter
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
119
gen/models/search_filters.go
Normal file
119
gen/models/search_filters.go
Normal file
|
@ -0,0 +1,119 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// SearchFilters search filters
|
||||
//
|
||||
// swagger:model SearchFilters
|
||||
type SearchFilters struct {
|
||||
|
||||
// filters
|
||||
// Required: true
|
||||
Filters []*SearchFilter `json:"filters"`
|
||||
}
|
||||
|
||||
// Validate validates this search filters
|
||||
func (m *SearchFilters) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateFilters(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilters) validateFilters(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("filters", "body", m.Filters); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Filters); i++ {
|
||||
if swag.IsZero(m.Filters[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Filters[i] != nil {
|
||||
if err := m.Filters[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("filters" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("filters" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this search filters based on the context it is used
|
||||
func (m *SearchFilters) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateFilters(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SearchFilters) contextValidateFilters(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Filters); i++ {
|
||||
|
||||
if m.Filters[i] != nil {
|
||||
if err := m.Filters[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("filters" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("filters" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *SearchFilters) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *SearchFilters) UnmarshalBinary(b []byte) error {
|
||||
var res SearchFilters
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
84
gen/models/search_match.go
Normal file
84
gen/models/search_match.go
Normal file
|
@ -0,0 +1,84 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// SearchMatch search match
|
||||
//
|
||||
// swagger:model SearchMatch
|
||||
type SearchMatch string
|
||||
|
||||
func NewSearchMatch(value SearchMatch) *SearchMatch {
|
||||
return &value
|
||||
}
|
||||
|
||||
// Pointer returns a pointer to a freshly-allocated SearchMatch.
|
||||
func (m SearchMatch) Pointer() *SearchMatch {
|
||||
return &m
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
// SearchMatchMatchStringEqual captures enum value "MatchStringEqual"
|
||||
SearchMatchMatchStringEqual SearchMatch = "MatchStringEqual"
|
||||
|
||||
// SearchMatchMatchStringNotEqual captures enum value "MatchStringNotEqual"
|
||||
SearchMatchMatchStringNotEqual SearchMatch = "MatchStringNotEqual"
|
||||
|
||||
// SearchMatchMatchNotPresent captures enum value "MatchNotPresent"
|
||||
SearchMatchMatchNotPresent SearchMatch = "MatchNotPresent"
|
||||
|
||||
// SearchMatchMatchCommonPrefix captures enum value "MatchCommonPrefix"
|
||||
SearchMatchMatchCommonPrefix SearchMatch = "MatchCommonPrefix"
|
||||
)
|
||||
|
||||
// for schema
|
||||
var searchMatchEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []SearchMatch
|
||||
if err := json.Unmarshal([]byte(`["MatchStringEqual","MatchStringNotEqual","MatchNotPresent","MatchCommonPrefix"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
searchMatchEnum = append(searchMatchEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
func (m SearchMatch) validateSearchMatchEnum(path, location string, value SearchMatch) error {
|
||||
if err := validate.EnumCase(path, location, value, searchMatchEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate validates this search match
|
||||
func (m SearchMatch) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// value enum
|
||||
if err := m.validateSearchMatchEnum("", "body", m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this search match based on context it is used
|
||||
func (m SearchMatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue