// Code generated by go-swagger; DO NOT EDIT. // This file is part of MinIO Console Server // Copyright (c) 2022 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // DescribePodWrapper describe pod wrapper // // swagger:model describePodWrapper type DescribePodWrapper struct { // annotations Annotations []*Annotation `json:"annotations"` // conditions Conditions []*Condition `json:"conditions"` // containers Containers []*Container `json:"containers"` // controller ref ControllerRef string `json:"controllerRef,omitempty"` // deletion grace period seconds DeletionGracePeriodSeconds int64 `json:"deletionGracePeriodSeconds,omitempty"` // deletion timestamp DeletionTimestamp string `json:"deletionTimestamp,omitempty"` // labels Labels []*Label `json:"labels"` // message Message string `json:"message,omitempty"` // name Name string `json:"name,omitempty"` // namespace Namespace string `json:"namespace,omitempty"` // node name NodeName string `json:"nodeName,omitempty"` // node selector NodeSelector []*NodeSelector `json:"nodeSelector"` // phase Phase string `json:"phase,omitempty"` // pod IP PodIP string `json:"podIP,omitempty"` // priority Priority int64 `json:"priority,omitempty"` // priority class name PriorityClassName string `json:"priorityClassName,omitempty"` // qos class QosClass string `json:"qosClass,omitempty"` // reason Reason string `json:"reason,omitempty"` // start time StartTime string `json:"startTime,omitempty"` // tolerations Tolerations []*Toleration `json:"tolerations"` // volumes Volumes []*Volume `json:"volumes"` } // Validate validates this describe pod wrapper func (m *DescribePodWrapper) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAnnotations(formats); err != nil { res = append(res, err) } if err := m.validateConditions(formats); err != nil { res = append(res, err) } if err := m.validateContainers(formats); err != nil { res = append(res, err) } if err := m.validateLabels(formats); err != nil { res = append(res, err) } if err := m.validateNodeSelector(formats); err != nil { res = append(res, err) } if err := m.validateTolerations(formats); err != nil { res = append(res, err) } if err := m.validateVolumes(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *DescribePodWrapper) validateAnnotations(formats strfmt.Registry) error { if swag.IsZero(m.Annotations) { // not required return nil } for i := 0; i < len(m.Annotations); i++ { if swag.IsZero(m.Annotations[i]) { // not required continue } if m.Annotations[i] != nil { if err := m.Annotations[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("annotations" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("annotations" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateConditions(formats strfmt.Registry) error { if swag.IsZero(m.Conditions) { // not required return nil } for i := 0; i < len(m.Conditions); i++ { if swag.IsZero(m.Conditions[i]) { // not required continue } if m.Conditions[i] != nil { if err := m.Conditions[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateContainers(formats strfmt.Registry) error { if swag.IsZero(m.Containers) { // not required return nil } for i := 0; i < len(m.Containers); i++ { if swag.IsZero(m.Containers[i]) { // not required continue } if m.Containers[i] != nil { if err := m.Containers[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("containers" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("containers" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateLabels(formats strfmt.Registry) error { if swag.IsZero(m.Labels) { // not required return nil } for i := 0; i < len(m.Labels); i++ { if swag.IsZero(m.Labels[i]) { // not required continue } if m.Labels[i] != nil { if err := m.Labels[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("labels" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("labels" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateNodeSelector(formats strfmt.Registry) error { if swag.IsZero(m.NodeSelector) { // not required return nil } for i := 0; i < len(m.NodeSelector); i++ { if swag.IsZero(m.NodeSelector[i]) { // not required continue } if m.NodeSelector[i] != nil { if err := m.NodeSelector[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodeSelector" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("nodeSelector" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateTolerations(formats strfmt.Registry) error { if swag.IsZero(m.Tolerations) { // not required return nil } for i := 0; i < len(m.Tolerations); i++ { if swag.IsZero(m.Tolerations[i]) { // not required continue } if m.Tolerations[i] != nil { if err := m.Tolerations[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tolerations" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("tolerations" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) validateVolumes(formats strfmt.Registry) error { if swag.IsZero(m.Volumes) { // not required return nil } for i := 0; i < len(m.Volumes); i++ { if swag.IsZero(m.Volumes[i]) { // not required continue } if m.Volumes[i] != nil { if err := m.Volumes[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } return err } } } return nil } // ContextValidate validate this describe pod wrapper based on the context it is used func (m *DescribePodWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateAnnotations(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateConditions(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateContainers(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateLabels(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateNodeSelector(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateTolerations(ctx, formats); err != nil { res = append(res, err) } if err := m.contextValidateVolumes(ctx, formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *DescribePodWrapper) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Annotations); i++ { if m.Annotations[i] != nil { if err := m.Annotations[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("annotations" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("annotations" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Conditions); i++ { if m.Conditions[i] != nil { if err := m.Conditions[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateContainers(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Containers); i++ { if m.Containers[i] != nil { if err := m.Containers[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("containers" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("containers" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Labels); i++ { if m.Labels[i] != nil { if err := m.Labels[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("labels" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("labels" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateNodeSelector(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.NodeSelector); i++ { if m.NodeSelector[i] != nil { if err := m.NodeSelector[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodeSelector" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("nodeSelector" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateTolerations(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tolerations); i++ { if m.Tolerations[i] != nil { if err := m.Tolerations[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tolerations" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("tolerations" + "." + strconv.Itoa(i)) } return err } } } return nil } func (m *DescribePodWrapper) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Volumes); i++ { if m.Volumes[i] != nil { if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } return err } } } return nil } // MarshalBinary interface implementation func (m *DescribePodWrapper) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *DescribePodWrapper) UnmarshalBinary(b []byte) error { var res DescribePodWrapper if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }