Added domains item in create tenant & get tenant requests (#1841)
This commit is contained in:
@@ -57,6 +57,9 @@ type TenantList struct {
|
||||
// deletion date
|
||||
DeletionDate string `json:"deletion_date,omitempty"`
|
||||
|
||||
// domains
|
||||
Domains *DomainsConfiguration `json:"domains,omitempty"`
|
||||
|
||||
// health status
|
||||
HealthStatus string `json:"health_status,omitempty"`
|
||||
|
||||
@@ -86,6 +89,10 @@ type TenantList struct {
|
||||
func (m *TenantList) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateDomains(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTiers(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -96,6 +103,25 @@ func (m *TenantList) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TenantList) validateDomains(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Domains) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Domains != nil {
|
||||
if err := m.Domains.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("domains")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("domains")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TenantList) validateTiers(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Tiers) { // not required
|
||||
return nil
|
||||
@@ -126,6 +152,10 @@ func (m *TenantList) validateTiers(formats strfmt.Registry) error {
|
||||
func (m *TenantList) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateDomains(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateTiers(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -136,6 +166,22 @@ func (m *TenantList) ContextValidate(ctx context.Context, formats strfmt.Registr
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TenantList) contextValidateDomains(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Domains != nil {
|
||||
if err := m.Domains.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("domains")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("domains")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TenantList) contextValidateTiers(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Tiers); i++ {
|
||||
|
||||
Reference in New Issue
Block a user