2023-05-16 17:51:03 +02:00
|
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
|
|
|
|
package rest_model_zrok
|
|
|
|
|
|
|
|
// This file was generated by the swagger tool.
|
|
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2023-05-17 17:23:16 +02:00
|
|
|
"strconv"
|
2023-05-16 17:51:03 +02:00
|
|
|
|
|
|
|
"github.com/go-openapi/errors"
|
|
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
"github.com/go-openapi/swag"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Overview overview
|
|
|
|
//
|
|
|
|
// swagger:model overview
|
|
|
|
type Overview struct {
|
|
|
|
|
|
|
|
// account limited
|
|
|
|
AccountLimited bool `json:"accountLimited,omitempty"`
|
|
|
|
|
|
|
|
// environments
|
2023-05-17 17:23:16 +02:00
|
|
|
Environments []*EnvironmentAndResources `json:"environments"`
|
2023-05-16 17:51:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Validate validates this overview
|
|
|
|
func (m *Overview) Validate(formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.validateEnvironments(formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Overview) validateEnvironments(formats strfmt.Registry) error {
|
|
|
|
if swag.IsZero(m.Environments) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-17 17:23:16 +02:00
|
|
|
for i := 0; i < len(m.Environments); i++ {
|
|
|
|
if swag.IsZero(m.Environments[i]) { // not required
|
|
|
|
continue
|
2023-05-16 17:51:03 +02:00
|
|
|
}
|
2023-05-17 17:23:16 +02:00
|
|
|
|
|
|
|
if m.Environments[i] != nil {
|
|
|
|
if err := m.Environments[i].Validate(formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("environments" + "." + strconv.Itoa(i))
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("environments" + "." + strconv.Itoa(i))
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-16 17:51:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ContextValidate validate this overview based on the context it is used
|
|
|
|
func (m *Overview) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
var res []error
|
|
|
|
|
|
|
|
if err := m.contextValidateEnvironments(ctx, formats); err != nil {
|
|
|
|
res = append(res, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(res) > 0 {
|
|
|
|
return errors.CompositeValidationError(res...)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Overview) contextValidateEnvironments(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
|
2023-05-17 17:23:16 +02:00
|
|
|
for i := 0; i < len(m.Environments); i++ {
|
|
|
|
|
|
|
|
if m.Environments[i] != nil {
|
2023-12-07 20:26:03 +01:00
|
|
|
|
|
|
|
if swag.IsZero(m.Environments[i]) { // not required
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-17 17:23:16 +02:00
|
|
|
if err := m.Environments[i].ContextValidate(ctx, formats); err != nil {
|
|
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
|
|
return ve.ValidateName("environments" + "." + strconv.Itoa(i))
|
|
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
|
|
return ce.ValidateName("environments" + "." + strconv.Itoa(i))
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|
2023-05-16 17:51:03 +02:00
|
|
|
}
|
2023-05-17 17:23:16 +02:00
|
|
|
|
2023-05-16 17:51:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalBinary interface implementation
|
|
|
|
func (m *Overview) MarshalBinary() ([]byte, error) {
|
|
|
|
if m == nil {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
return swag.WriteJSON(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalBinary interface implementation
|
|
|
|
func (m *Overview) UnmarshalBinary(b []byte) error {
|
|
|
|
var res Overview
|
|
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*m = res
|
|
|
|
return nil
|
|
|
|
}
|