mirror of
https://github.com/hanzozt/edge-api.git
synced 2026-10-30 14:44:05 +00:00
* for openziti/ziti#3356 add www-authenticate headers - adds www-authenticate headers to all responses - moves to swagger 0.33.1 - updates readme - updates version checking in powershell and bash
296 lines
7.3 KiB
Go
296 lines
7.3 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
//
|
|
// Copyright NetFoundry Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
//
|
|
// __ __ _
|
|
// \ \ / / (_)
|
|
// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _
|
|
// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` |
|
|
// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it.
|
|
// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, |
|
|
// __/ |
|
|
// |___/
|
|
|
|
package rest_model
|
|
|
|
// 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/swag"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
// ExternalIDClaim external Id claim
|
|
//
|
|
// swagger:model externalIdClaim
|
|
type ExternalIDClaim struct {
|
|
|
|
// index
|
|
// Required: true
|
|
Index *int64 `json:"index"`
|
|
|
|
// location
|
|
// Required: true
|
|
// Enum: ["COMMON_NAME","SAN_URI","SAN_EMAIL"]
|
|
Location *string `json:"location"`
|
|
|
|
// matcher
|
|
// Required: true
|
|
// Enum: ["ALL","PREFIX","SUFFIX","SCHEME"]
|
|
Matcher *string `json:"matcher"`
|
|
|
|
// matcher criteria
|
|
// Required: true
|
|
MatcherCriteria *string `json:"matcherCriteria"`
|
|
|
|
// parser
|
|
// Required: true
|
|
// Enum: ["NONE","SPLIT"]
|
|
Parser *string `json:"parser"`
|
|
|
|
// parser criteria
|
|
// Required: true
|
|
ParserCriteria *string `json:"parserCriteria"`
|
|
}
|
|
|
|
// Validate validates this external Id claim
|
|
func (m *ExternalIDClaim) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateIndex(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateLocation(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateMatcher(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateMatcherCriteria(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateParser(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateParserCriteria(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateIndex(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("index", "body", m.Index); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var externalIdClaimTypeLocationPropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["COMMON_NAME","SAN_URI","SAN_EMAIL"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
externalIdClaimTypeLocationPropEnum = append(externalIdClaimTypeLocationPropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// ExternalIDClaimLocationCOMMONNAME captures enum value "COMMON_NAME"
|
|
ExternalIDClaimLocationCOMMONNAME string = "COMMON_NAME"
|
|
|
|
// ExternalIDClaimLocationSANURI captures enum value "SAN_URI"
|
|
ExternalIDClaimLocationSANURI string = "SAN_URI"
|
|
|
|
// ExternalIDClaimLocationSANEMAIL captures enum value "SAN_EMAIL"
|
|
ExternalIDClaimLocationSANEMAIL string = "SAN_EMAIL"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *ExternalIDClaim) validateLocationEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, externalIdClaimTypeLocationPropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateLocation(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("location", "body", m.Location); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateLocationEnum("location", "body", *m.Location); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var externalIdClaimTypeMatcherPropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["ALL","PREFIX","SUFFIX","SCHEME"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
externalIdClaimTypeMatcherPropEnum = append(externalIdClaimTypeMatcherPropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// ExternalIDClaimMatcherALL captures enum value "ALL"
|
|
ExternalIDClaimMatcherALL string = "ALL"
|
|
|
|
// ExternalIDClaimMatcherPREFIX captures enum value "PREFIX"
|
|
ExternalIDClaimMatcherPREFIX string = "PREFIX"
|
|
|
|
// ExternalIDClaimMatcherSUFFIX captures enum value "SUFFIX"
|
|
ExternalIDClaimMatcherSUFFIX string = "SUFFIX"
|
|
|
|
// ExternalIDClaimMatcherSCHEME captures enum value "SCHEME"
|
|
ExternalIDClaimMatcherSCHEME string = "SCHEME"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *ExternalIDClaim) validateMatcherEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, externalIdClaimTypeMatcherPropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateMatcher(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("matcher", "body", m.Matcher); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateMatcherEnum("matcher", "body", *m.Matcher); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateMatcherCriteria(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("matcherCriteria", "body", m.MatcherCriteria); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var externalIdClaimTypeParserPropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["NONE","SPLIT"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
externalIdClaimTypeParserPropEnum = append(externalIdClaimTypeParserPropEnum, v)
|
|
}
|
|
}
|
|
|
|
const (
|
|
|
|
// ExternalIDClaimParserNONE captures enum value "NONE"
|
|
ExternalIDClaimParserNONE string = "NONE"
|
|
|
|
// ExternalIDClaimParserSPLIT captures enum value "SPLIT"
|
|
ExternalIDClaimParserSPLIT string = "SPLIT"
|
|
)
|
|
|
|
// prop value enum
|
|
func (m *ExternalIDClaim) validateParserEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, externalIdClaimTypeParserPropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateParser(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("parser", "body", m.Parser); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateParserEnum("parser", "body", *m.Parser); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *ExternalIDClaim) validateParserCriteria(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("parserCriteria", "body", m.ParserCriteria); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this external Id claim based on context it is used
|
|
func (m *ExternalIDClaim) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *ExternalIDClaim) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *ExternalIDClaim) UnmarshalBinary(b []byte) error {
|
|
var res ExternalIDClaim
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|