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
1415 lines
32 KiB
Go
1415 lines
32 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"
|
|
stderrors "errors"
|
|
"strconv"
|
|
|
|
"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"`
|
|
|
|
// auth policy
|
|
// Required: true
|
|
AuthPolicy *EntityRef `json:"authPolicy"`
|
|
|
|
// auth policy Id
|
|
// Required: true
|
|
AuthPolicyID *string `json:"authPolicyId"`
|
|
|
|
// authenticators
|
|
// Required: true
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
// default hosting cost
|
|
// Required: true
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
// default hosting precedence
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
// disabled
|
|
// Required: true
|
|
Disabled *bool `json:"disabled"`
|
|
|
|
// disabled at
|
|
// Format: date-time
|
|
DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"`
|
|
|
|
// disabled until
|
|
// Format: date-time
|
|
DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"`
|
|
|
|
// edge router connection status
|
|
// Required: true
|
|
// Enum: ["online","offline","unknown"]
|
|
EdgeRouterConnectionStatus *string `json:"edgeRouterConnectionStatus"`
|
|
|
|
// enrollment
|
|
// Required: true
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
// env info
|
|
// Required: true
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
// external Id
|
|
// Required: true
|
|
ExternalID *string `json:"externalId"`
|
|
|
|
// has Api session
|
|
// Required: true
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
// has edge router connection
|
|
// Required: true
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
// interfaces
|
|
Interfaces []*Interface `json:"interfaces"`
|
|
|
|
// 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"`
|
|
|
|
// permissions
|
|
// Required: true
|
|
Permissions *Permissions `json:"permissions"`
|
|
|
|
// 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"`
|
|
|
|
AuthPolicy *EntityRef `json:"authPolicy"`
|
|
|
|
AuthPolicyID *string `json:"authPolicyId"`
|
|
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
Disabled *bool `json:"disabled"`
|
|
|
|
DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"`
|
|
|
|
DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"`
|
|
|
|
EdgeRouterConnectionStatus *string `json:"edgeRouterConnectionStatus"`
|
|
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
ExternalID *string `json:"externalId"`
|
|
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
Interfaces []*Interface `json:"interfaces"`
|
|
|
|
IsAdmin *bool `json:"isAdmin"`
|
|
|
|
IsDefaultAdmin *bool `json:"isDefaultAdmin"`
|
|
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
|
|
Name *string `json:"name"`
|
|
|
|
Permissions *Permissions `json:"permissions"`
|
|
|
|
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.AuthPolicy = dataAO1.AuthPolicy
|
|
|
|
m.AuthPolicyID = dataAO1.AuthPolicyID
|
|
|
|
m.Authenticators = dataAO1.Authenticators
|
|
|
|
m.DefaultHostingCost = dataAO1.DefaultHostingCost
|
|
|
|
m.DefaultHostingPrecedence = dataAO1.DefaultHostingPrecedence
|
|
|
|
m.Disabled = dataAO1.Disabled
|
|
|
|
m.DisabledAt = dataAO1.DisabledAt
|
|
|
|
m.DisabledUntil = dataAO1.DisabledUntil
|
|
|
|
m.EdgeRouterConnectionStatus = dataAO1.EdgeRouterConnectionStatus
|
|
|
|
m.Enrollment = dataAO1.Enrollment
|
|
|
|
m.EnvInfo = dataAO1.EnvInfo
|
|
|
|
m.ExternalID = dataAO1.ExternalID
|
|
|
|
m.HasAPISession = dataAO1.HasAPISession
|
|
|
|
m.HasEdgeRouterConnection = dataAO1.HasEdgeRouterConnection
|
|
|
|
m.Interfaces = dataAO1.Interfaces
|
|
|
|
m.IsAdmin = dataAO1.IsAdmin
|
|
|
|
m.IsDefaultAdmin = dataAO1.IsDefaultAdmin
|
|
|
|
m.IsMfaEnabled = dataAO1.IsMfaEnabled
|
|
|
|
m.Name = dataAO1.Name
|
|
|
|
m.Permissions = dataAO1.Permissions
|
|
|
|
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"`
|
|
|
|
AuthPolicy *EntityRef `json:"authPolicy"`
|
|
|
|
AuthPolicyID *string `json:"authPolicyId"`
|
|
|
|
Authenticators *IdentityAuthenticators `json:"authenticators"`
|
|
|
|
DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"`
|
|
|
|
DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"`
|
|
|
|
Disabled *bool `json:"disabled"`
|
|
|
|
DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"`
|
|
|
|
DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"`
|
|
|
|
EdgeRouterConnectionStatus *string `json:"edgeRouterConnectionStatus"`
|
|
|
|
Enrollment *IdentityEnrollments `json:"enrollment"`
|
|
|
|
EnvInfo *EnvInfo `json:"envInfo"`
|
|
|
|
ExternalID *string `json:"externalId"`
|
|
|
|
HasAPISession *bool `json:"hasApiSession"`
|
|
|
|
HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"`
|
|
|
|
Interfaces []*Interface `json:"interfaces"`
|
|
|
|
IsAdmin *bool `json:"isAdmin"`
|
|
|
|
IsDefaultAdmin *bool `json:"isDefaultAdmin"`
|
|
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
|
|
Name *string `json:"name"`
|
|
|
|
Permissions *Permissions `json:"permissions"`
|
|
|
|
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.AuthPolicy = m.AuthPolicy
|
|
|
|
dataAO1.AuthPolicyID = m.AuthPolicyID
|
|
|
|
dataAO1.Authenticators = m.Authenticators
|
|
|
|
dataAO1.DefaultHostingCost = m.DefaultHostingCost
|
|
|
|
dataAO1.DefaultHostingPrecedence = m.DefaultHostingPrecedence
|
|
|
|
dataAO1.Disabled = m.Disabled
|
|
|
|
dataAO1.DisabledAt = m.DisabledAt
|
|
|
|
dataAO1.DisabledUntil = m.DisabledUntil
|
|
|
|
dataAO1.EdgeRouterConnectionStatus = m.EdgeRouterConnectionStatus
|
|
|
|
dataAO1.Enrollment = m.Enrollment
|
|
|
|
dataAO1.EnvInfo = m.EnvInfo
|
|
|
|
dataAO1.ExternalID = m.ExternalID
|
|
|
|
dataAO1.HasAPISession = m.HasAPISession
|
|
|
|
dataAO1.HasEdgeRouterConnection = m.HasEdgeRouterConnection
|
|
|
|
dataAO1.Interfaces = m.Interfaces
|
|
|
|
dataAO1.IsAdmin = m.IsAdmin
|
|
|
|
dataAO1.IsDefaultAdmin = m.IsDefaultAdmin
|
|
|
|
dataAO1.IsMfaEnabled = m.IsMfaEnabled
|
|
|
|
dataAO1.Name = m.Name
|
|
|
|
dataAO1.Permissions = m.Permissions
|
|
|
|
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.validateAuthPolicy(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateAuthPolicyID(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.validateDisabled(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateDisabledAt(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateDisabledUntil(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateEdgeRouterConnectionStatus(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.validateExternalID(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.validateInterfaces(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.validatePermissions(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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("appData")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("appData")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateAuthPolicy(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("authPolicy", "body", m.AuthPolicy); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.AuthPolicy != nil {
|
|
if err := m.AuthPolicy.Validate(formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("authPolicy")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("authPolicy")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateAuthPolicyID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("authPolicyId", "body", m.AuthPolicyID); err != nil {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("authenticators")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("defaultHostingCost")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateDisabled(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("disabled", "body", m.Disabled); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateDisabledAt(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.DisabledAt) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := validate.FormatOf("disabledAt", "body", "date-time", m.DisabledAt.String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateDisabledUntil(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.DisabledUntil) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := validate.FormatOf("disabledUntil", "body", "date-time", m.DisabledUntil.String(), formats); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var identityDetailTypeEdgeRouterConnectionStatusPropEnum []any
|
|
|
|
func init() {
|
|
var res []string
|
|
if err := json.Unmarshal([]byte(`["online","offline","unknown"]`), &res); err != nil {
|
|
panic(err)
|
|
}
|
|
for _, v := range res {
|
|
identityDetailTypeEdgeRouterConnectionStatusPropEnum = append(identityDetailTypeEdgeRouterConnectionStatusPropEnum, v)
|
|
}
|
|
}
|
|
|
|
// property enum
|
|
func (m *IdentityDetail) validateEdgeRouterConnectionStatusEnum(path, location string, value string) error {
|
|
if err := validate.EnumCase(path, location, value, identityDetailTypeEdgeRouterConnectionStatusPropEnum, true); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateEdgeRouterConnectionStatus(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("edgeRouterConnectionStatus", "body", m.EdgeRouterConnectionStatus); err != nil {
|
|
return err
|
|
}
|
|
|
|
// value enum
|
|
if err := m.validateEdgeRouterConnectionStatusEnum("edgeRouterConnectionStatus", "body", *m.EdgeRouterConnectionStatus); err != nil {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("enrollment")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("envInfo")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("envInfo")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) validateExternalID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("externalId", "body", m.ExternalID); err != nil {
|
|
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) validateInterfaces(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.Interfaces) { // not required
|
|
return nil
|
|
}
|
|
|
|
for i := 0; i < len(m.Interfaces); i++ {
|
|
if swag.IsZero(m.Interfaces[i]) { // not required
|
|
continue
|
|
}
|
|
|
|
if m.Interfaces[i] != nil {
|
|
if err := m.Interfaces[i].Validate(formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("interfaces" + "." + strconv.Itoa(i))
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("interfaces" + "." + strconv.Itoa(i))
|
|
}
|
|
|
|
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) validatePermissions(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("permissions", "body", m.Permissions); err != nil {
|
|
return err
|
|
}
|
|
|
|
if m.Permissions != nil {
|
|
if err := m.Permissions.Validate(formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("permissions")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("permissions")
|
|
}
|
|
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("roleAttributes")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("sdkInfo")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("serviceHostingCosts")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("type")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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.contextValidateAuthPolicy(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.contextValidateInterfaces(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.contextValidatePermissions(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 swag.IsZero(m.AppData) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.AppData.ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("appData")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("appData")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateAuthPolicy(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.AuthPolicy != nil {
|
|
|
|
if err := m.AuthPolicy.ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("authPolicy")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("authPolicy")
|
|
}
|
|
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("authenticators")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("defaultHostingCost")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("defaultHostingCost")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.DefaultHostingPrecedence) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("defaultHostingPrecedence")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("enrollment")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("envInfo")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("envInfo")
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidateInterfaces(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
for i := 0; i < len(m.Interfaces); i++ {
|
|
|
|
if m.Interfaces[i] != nil {
|
|
|
|
if swag.IsZero(m.Interfaces[i]) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := m.Interfaces[i].ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("interfaces" + "." + strconv.Itoa(i))
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("interfaces" + "." + strconv.Itoa(i))
|
|
}
|
|
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *IdentityDetail) contextValidatePermissions(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
if m.Permissions != nil {
|
|
if err := m.Permissions.ContextValidate(ctx, formats); err != nil {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("permissions")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
return ce.ValidateName("permissions")
|
|
}
|
|
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("roleAttributes")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("sdkInfo")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("serviceHostingCosts")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("serviceHostingPrecedences")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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 {
|
|
ve := new(errors.Validation)
|
|
if stderrors.As(err, &ve) {
|
|
return ve.ValidateName("type")
|
|
}
|
|
ce := new(errors.CompositeError)
|
|
if stderrors.As(err, &ce) {
|
|
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
|
|
}
|