frostfs-rest-gw/gen/models/search_match.go

85 lines
2.1 KiB
Go
Raw Normal View History

// 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
}