mirror of
https://github.com/openziti/ziti.git
synced 2026-09-21 01:53:22 +00:00
47499bc4f1
- allow timeouts for MFA posture checks - allow wake/unlocked MFA options - allow legacy toggle for SDKs that don't supply endpoint state - supply timeouts on posture checks - posture data now caches session state
413 lines
9.9 KiB
Go
413 lines
9.9 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"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
)
|
|
|
|
// IdentityPatch identity patch
|
|
//
|
|
// swagger:model identityPatch
|
|
type IdentityPatch struct {
|
|
|
|
// app data
|
|
AppData *Tags `json:"appData,omitempty"`
|
|
|
|
// default hosting cost
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"`
|
|
|
|
// default hosting precedence
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
// is admin
|
|
IsAdmin bool `json:"isAdmin,omitempty"`
|
|
|
|
// name
|
|
Name string `json:"name,omitempty"`
|
|
|
|
// role attributes
|
|
RoleAttributes *Attributes `json:"roleAttributes,omitempty"`
|
|
|
|
// service hosting costs
|
|
ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts,omitempty"`
|
|
|
|
// service hosting precedences
|
|
ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences,omitempty"`
|
|
|
|
// tags
|
|
Tags *Tags `json:"tags,omitempty"`
|
|
|
|
// type
|
|
Type IdentityType `json:"type,omitempty"`
|
|
}
|
|
|
|
// Validate validates this identity patch
|
|
func (m *IdentityPatch) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateAppData(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateDefaultHostingCost(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateDefaultHostingPrecedence(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateRoleAttributes(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateServiceHostingCosts(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateServiceHostingPrecedences(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateTags(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateType(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateAppData(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.AppData) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.AppData != nil {
|
|
if err := m.AppData.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("appData")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateDefaultHostingCost(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.DefaultHostingCost) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.DefaultHostingCost != nil {
|
|
if err := m.DefaultHostingCost.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("defaultHostingCost")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateDefaultHostingPrecedence(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.DefaultHostingPrecedence) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.DefaultHostingPrecedence.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateRoleAttributes(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.RoleAttributes) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.RoleAttributes != nil {
|
|
if err := m.RoleAttributes.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("roleAttributes")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateServiceHostingCosts(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.ServiceHostingCosts) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.ServiceHostingCosts != nil {
|
|
if err := m.ServiceHostingCosts.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingCosts")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateServiceHostingPrecedences(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.ServiceHostingPrecedences) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.ServiceHostingPrecedences != nil {
|
|
if err := m.ServiceHostingPrecedences.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateTags(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.Tags) { // not required
|
|
return nil
|
|
}
|
|
|
|
if m.Tags != nil {
|
|
if err := m.Tags.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("tags")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) validateType(formats strfmt.Registry) error {
|
|
if swag.IsZero(m.Type) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.Type.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("type")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this identity patch based on the context it is used
|
|
func (m *IdentityPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.contextValidateAppData(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateDefaultHostingCost(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateDefaultHostingPrecedence(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateRoleAttributes(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateServiceHostingCosts(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateServiceHostingPrecedences(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateTags(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateType(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.AppData != nil {
|
|
if err := m.AppData.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("appData")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateDefaultHostingCost(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.DefaultHostingCost != nil {
|
|
if err := m.DefaultHostingCost.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("defaultHostingCost")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.RoleAttributes != nil {
|
|
if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("roleAttributes")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateServiceHostingCosts(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if err := m.ServiceHostingCosts.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingCosts")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Tags != nil {
|
|
if err := m.Tags.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("tags")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityPatch) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if err := m.Type.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("type")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *IdentityPatch) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *IdentityPatch) UnmarshalBinary(b []byte) error {
|
|
var res IdentityPatch
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|