mirror of
https://github.com/openziti/ziti.git
synced 2026-10-14 08:10:17 +00:00
917 lines
22 KiB
Go
917 lines
22 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"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
// IdentityDetail Detail of a specific identity
|
|
//
|
|
// swagger:model identityDetail
|
|
type IdentityDetail struct {
|
|
BaseEntity
|
|
|
|
// app data
|
|
AppData *Tags `json:"appData,omitempty"`
|
|
|
|
// authenticators
|
|
// Required: true
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
// default hosting cost
|
|
// Required: true
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
// default hosting precedence
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
// enrollment
|
|
// Required: true
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
// env info
|
|
// Required: true
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
// has Api session
|
|
// Required: true
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
// has edge router connection
|
|
// Required: true
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
// is admin
|
|
// Required: true
|
|
IsAdmin *bool `json:"isAdmin"`
|
|
|
|
// is default admin
|
|
// Required: true
|
|
IsDefaultAdmin *bool `json:"isDefaultAdmin"`
|
|
|
|
// is mfa enabled
|
|
// Required: true
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
|
|
// name
|
|
// Required: true
|
|
Name *string `json:"name"`
|
|
|
|
// role attributes
|
|
// Required: true
|
|
RoleAttributes *Attributes `json:"roleAttributes"`
|
|
|
|
// sdk info
|
|
// Required: true
|
|
SdkInfo *SdkInfo `json:"sdkInfo"`
|
|
|
|
// service hosting costs
|
|
// Required: true
|
|
ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"`
|
|
|
|
// service hosting precedences
|
|
// Required: true
|
|
ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"`
|
|
|
|
// type
|
|
// Required: true
|
|
Type *EntityRef `json:"type"`
|
|
|
|
// type Id
|
|
// Required: true
|
|
TypeID *string `json:"typeId"`
|
|
}
|
|
|
|
// UnmarshalJSON unmarshals this object from a JSON structure
|
|
func (m *IdentityDetail) UnmarshalJSON(raw []byte) error {
|
|
// AO0
|
|
var aO0 BaseEntity
|
|
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
|
return err
|
|
}
|
|
m.BaseEntity = aO0
|
|
|
|
// AO1
|
|
var dataAO1 struct {
|
|
AppData *Tags `json:"appData,omitempty"`
|
|
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
IsAdmin *bool `json:"isAdmin"`
|
|
|
|
IsDefaultAdmin *bool `json:"isDefaultAdmin"`
|
|
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
|
|
Name *string `json:"name"`
|
|
|
|
RoleAttributes *Attributes `json:"roleAttributes"`
|
|
|
|
SdkInfo *SdkInfo `json:"sdkInfo"`
|
|
|
|
ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"`
|
|
|
|
ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"`
|
|
|
|
Type *EntityRef `json:"type"`
|
|
|
|
TypeID *string `json:"typeId"`
|
|
}
|
|
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
|
return err
|
|
}
|
|
|
|
m.AppData = dataAO1.AppData
|
|
|
|
m.Authenticators = dataAO1.Authenticators
|
|
|
|
m.DefaultHostingCost = dataAO1.DefaultHostingCost
|
|
|
|
m.DefaultHostingPrecedence = dataAO1.DefaultHostingPrecedence
|
|
|
|
m.Enrollment = dataAO1.Enrollment
|
|
|
|
m.EnvInfo = dataAO1.EnvInfo
|
|
|
|
m.HasAPISession = dataAO1.HasAPISession
|
|
|
|
m.HasEdgeRouterConnection = dataAO1.HasEdgeRouterConnection
|
|
|
|
m.IsAdmin = dataAO1.IsAdmin
|
|
|
|
m.IsDefaultAdmin = dataAO1.IsDefaultAdmin
|
|
|
|
m.IsMfaEnabled = dataAO1.IsMfaEnabled
|
|
|
|
m.Name = dataAO1.Name
|
|
|
|
m.RoleAttributes = dataAO1.RoleAttributes
|
|
|
|
m.SdkInfo = dataAO1.SdkInfo
|
|
|
|
m.ServiceHostingCosts = dataAO1.ServiceHostingCosts
|
|
|
|
m.ServiceHostingPrecedences = dataAO1.ServiceHostingPrecedences
|
|
|
|
m.Type = dataAO1.Type
|
|
|
|
m.TypeID = dataAO1.TypeID
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalJSON marshals this object to a JSON structure
|
|
func (m IdentityDetail) MarshalJSON() ([]byte, error) {
|
|
_parts := make([][]byte, 0, 2)
|
|
|
|
aO0, err := swag.WriteJSON(m.BaseEntity)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
_parts = append(_parts, aO0)
|
|
var dataAO1 struct {
|
|
AppData *Tags `json:"appData,omitempty"`
|
|
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
IsAdmin *bool `json:"isAdmin"`
|
|
|
|
IsDefaultAdmin *bool `json:"isDefaultAdmin"`
|
|
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
|
|
Name *string `json:"name"`
|
|
|
|
RoleAttributes *Attributes `json:"roleAttributes"`
|
|
|
|
SdkInfo *SdkInfo `json:"sdkInfo"`
|
|
|
|
ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"`
|
|
|
|
ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"`
|
|
|
|
Type *EntityRef `json:"type"`
|
|
|
|
TypeID *string `json:"typeId"`
|
|
}
|
|
|
|
dataAO1.AppData = m.AppData
|
|
|
|
dataAO1.Authenticators = m.Authenticators
|
|
|
|
dataAO1.DefaultHostingCost = m.DefaultHostingCost
|
|
|
|
dataAO1.DefaultHostingPrecedence = m.DefaultHostingPrecedence
|
|
|
|
dataAO1.Enrollment = m.Enrollment
|
|
|
|
dataAO1.EnvInfo = m.EnvInfo
|
|
|
|
dataAO1.HasAPISession = m.HasAPISession
|
|
|
|
dataAO1.HasEdgeRouterConnection = m.HasEdgeRouterConnection
|
|
|
|
dataAO1.IsAdmin = m.IsAdmin
|
|
|
|
dataAO1.IsDefaultAdmin = m.IsDefaultAdmin
|
|
|
|
dataAO1.IsMfaEnabled = m.IsMfaEnabled
|
|
|
|
dataAO1.Name = m.Name
|
|
|
|
dataAO1.RoleAttributes = m.RoleAttributes
|
|
|
|
dataAO1.SdkInfo = m.SdkInfo
|
|
|
|
dataAO1.ServiceHostingCosts = m.ServiceHostingCosts
|
|
|
|
dataAO1.ServiceHostingPrecedences = m.ServiceHostingPrecedences
|
|
|
|
dataAO1.Type = m.Type
|
|
|
|
dataAO1.TypeID = m.TypeID
|
|
|
|
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
|
if errAO1 != nil {
|
|
return nil, errAO1
|
|
}
|
|
_parts = append(_parts, jsonDataAO1)
|
|
return swag.ConcatJSON(_parts...), nil
|
|
}
|
|
|
|
// Validate validates this identity detail
|
|
func (m *IdentityDetail) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
// validation for a type composition with BaseEntity
|
|
if err := m.BaseEntity.Validate(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateAppData(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateAuthenticators(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.validateEnrollment(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateEnvInfo(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateHasAPISession(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateHasEdgeRouterConnection(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateIsAdmin(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateIsDefaultAdmin(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateIsMfaEnabled(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateName(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateRoleAttributes(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateSdkInfo(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.validateType(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateTypeID(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("appData")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateAuthenticators(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("authenticators", "body", m.Authenticators); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.Authenticators != nil {
|
|
if err := m.Authenticators.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("authenticators")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("authenticators")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateDefaultHostingCost(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("defaultHostingCost", "body", m.DefaultHostingCost); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := validate.Required("defaultHostingCost", "body", m.DefaultHostingCost); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.DefaultHostingCost != nil {
|
|
if err := m.DefaultHostingCost.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("defaultHostingCost")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("defaultHostingCost")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateEnrollment(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("enrollment", "body", m.Enrollment); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.Enrollment != nil {
|
|
if err := m.Enrollment.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("enrollment")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("enrollment")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateEnvInfo(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("envInfo", "body", m.EnvInfo); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.EnvInfo != nil {
|
|
if err := m.EnvInfo.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("envInfo")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("envInfo")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateHasAPISession(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("hasApiSession", "body", m.HasAPISession); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateHasEdgeRouterConnection(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("hasEdgeRouterConnection", "body", m.HasEdgeRouterConnection); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateIsAdmin(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("isAdmin", "body", m.IsAdmin); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateIsDefaultAdmin(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("isDefaultAdmin", "body", m.IsDefaultAdmin); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateIsMfaEnabled(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("isMfaEnabled", "body", m.IsMfaEnabled); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateName(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("name", "body", m.Name); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateRoleAttributes(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("roleAttributes", "body", m.RoleAttributes); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.RoleAttributes != nil {
|
|
if err := m.RoleAttributes.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("roleAttributes")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("roleAttributes")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateSdkInfo(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("sdkInfo", "body", m.SdkInfo); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.SdkInfo != nil {
|
|
if err := m.SdkInfo.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("sdkInfo")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("sdkInfo")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateServiceHostingCosts(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("serviceHostingCosts", "body", m.ServiceHostingCosts); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.ServiceHostingCosts != nil {
|
|
if err := m.ServiceHostingCosts.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingCosts")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("serviceHostingCosts")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateServiceHostingPrecedences(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("serviceHostingPrecedences", "body", m.ServiceHostingPrecedences); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.ServiceHostingPrecedences != nil {
|
|
if err := m.ServiceHostingPrecedences.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("serviceHostingPrecedences")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateType(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("type", "body", m.Type); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.Type != nil {
|
|
if err := m.Type.Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("type")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("type")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateTypeID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("typeId", "body", m.TypeID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this identity detail based on the context it is used
|
|
func (m *IdentityDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
// validation for a type composition with BaseEntity
|
|
if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateAppData(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateAuthenticators(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.contextValidateEnrollment(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateEnvInfo(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateRoleAttributes(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidateSdkInfo(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.contextValidateType(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("appData")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateAuthenticators(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Authenticators != nil {
|
|
if err := m.Authenticators.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("authenticators")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("authenticators")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("defaultHostingCost")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateEnrollment(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Enrollment != nil {
|
|
if err := m.Enrollment.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("enrollment")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("enrollment")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateEnvInfo(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.EnvInfo != nil {
|
|
if err := m.EnvInfo.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("envInfo")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("envInfo")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("roleAttributes")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateSdkInfo(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.SdkInfo != nil {
|
|
if err := m.SdkInfo.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("sdkInfo")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("sdkInfo")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("serviceHostingCosts")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) 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")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Type != nil {
|
|
if err := m.Type.ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("type")
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("type")
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *IdentityDetail) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *IdentityDetail) UnmarshalBinary(b []byte) error {
|
|
var res IdentityDetail
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|