forked from TrueCloudLab/frostfs-rest-gw
9f752cd756
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
81 lines
1.6 KiB
Go
81 lines
1.6 KiB
Go
// 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"
|
|
)
|
|
|
|
// Verb verb
|
|
//
|
|
// swagger:model Verb
|
|
type Verb string
|
|
|
|
func NewVerb(value Verb) *Verb {
|
|
return &value
|
|
}
|
|
|
|
// Pointer returns a pointer to a freshly-allocated Verb.
|
|
func (m Verb) Pointer() *Verb {
|
|
return &m
|
|
}
|
|
|
|
const (
|
|
|
|
// VerbPUT captures enum value "PUT"
|
|
VerbPUT Verb = "PUT"
|
|
|
|
// VerbDELETE captures enum value "DELETE"
|
|
VerbDELETE Verb = "DELETE"
|
|
|
|
// VerbSETEACL captures enum value "SETEACL"
|
|
VerbSETEACL Verb = "SETEACL"
|
|
)
|
|
|
|
// for schema
|
|
var verbEnum []interface{}
|
|
|
|
func init() {
|
|
var res []Verb
|
|
if err := json.Unmarshal([]byte(`["PUT","DELETE","SETEACL"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
verbEnum = append(verbEnum, v)
|
|
}
|
|
}
|
|
|
|
func (m Verb) validateVerbEnum(path, location string, value Verb) error {
|
|
if err := validate.EnumCase(path, location, value, verbEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Validate validates this verb
|
|
func (m Verb) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
// value enum
|
|
if err := m.validateVerbEnum("", "body", m); err != nil {
|
|
return err
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this verb based on context it is used
|
|
func (m Verb) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|