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
89 lines
3.8 KiB
Go
89 lines
3.8 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"
|
|
"strconv"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
// Permissions A set of strings used to define which types of resources this resource can acccess
|
|
//
|
|
// swagger:model permissions
|
|
type Permissions []string
|
|
|
|
var permissionsItemsEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["admin_readonly","auth-policy","auth-policy.read","auth-policy.create","auth-policy.update","auth-policy.delete","ca","ca.read","ca.create","ca.update","ca.delete","config","config.read","config.create","config.update","config.delete","config-type","config-type.read","config-type.create","config-type.update","config-type.delete","edge-router-policy","edge-router-policy.read","edge-router-policy.create","edge-router-policy.update","edge-router-policy.delete","enrollment","enrollment.read","enrollment.create","enrollment.update","enrollment.delete","external-jwt-signer","external-jwt-signer.read","external-jwt-signer.create","external-jwt-signer.update","external-jwt-signer.delete","identity","identity.read","identity.create","identity.update","identity.delete","ops","ops.read","ops.update","ops.delete","posture-check","posture-check.read","posture-check.create","posture-check.update","posture-check.delete","router","router.read","router.create","router.update","router.delete","service","service.read","service.create","service.update","service.delete","service-edge-router-policy","service-edge-router-policy.read","service-edge-router-policy.create","service-edge-router-policy.update","service-edge-router-policy.delete","service-policy","service-policy.read","service-policy.create","service-policy.update","service-policy.delete","terminator","terminator.read","terminator.create","terminator.update","terminator.delete"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
permissionsItemsEnum = append(permissionsItemsEnum, v)
|
|
}
|
|
}
|
|
|
|
func (m *Permissions) validatePermissionsItemsEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, permissionsItemsEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Validate validates this permissions
|
|
func (m Permissions) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
for i := 0; i < len(m); i++ {
|
|
|
|
// value enum
|
|
if err := m.validatePermissionsItemsEnum(strconv.Itoa(i), "body", m[i]); err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this permissions based on context it is used
|
|
func (m Permissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|