github.com/kubearmor/cilium@v1.6.12/api/v1/models/label_configuration_status.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	strfmt "github.com/go-openapi/strfmt"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // LabelConfigurationStatus Labels and label configuration of an endpoint
    16  // swagger:model LabelConfigurationStatus
    17  type LabelConfigurationStatus struct {
    18  
    19  	// All labels derived from the orchestration system
    20  	Derived Labels `json:"derived,omitempty"`
    21  
    22  	// Labels derived from orchestration system which have been disabled.
    23  	Disabled Labels `json:"disabled,omitempty"`
    24  
    25  	// The current configuration
    26  	Realized *LabelConfigurationSpec `json:"realized,omitempty"`
    27  
    28  	// Labels derived from orchestration system that are used in computing a security identity
    29  	SecurityRelevant Labels `json:"security-relevant,omitempty"`
    30  }
    31  
    32  // Validate validates this label configuration status
    33  func (m *LabelConfigurationStatus) Validate(formats strfmt.Registry) error {
    34  	var res []error
    35  
    36  	if err := m.validateDerived(formats); err != nil {
    37  		res = append(res, err)
    38  	}
    39  
    40  	if err := m.validateDisabled(formats); err != nil {
    41  		res = append(res, err)
    42  	}
    43  
    44  	if err := m.validateRealized(formats); err != nil {
    45  		res = append(res, err)
    46  	}
    47  
    48  	if err := m.validateSecurityRelevant(formats); err != nil {
    49  		res = append(res, err)
    50  	}
    51  
    52  	if len(res) > 0 {
    53  		return errors.CompositeValidationError(res...)
    54  	}
    55  	return nil
    56  }
    57  
    58  func (m *LabelConfigurationStatus) validateDerived(formats strfmt.Registry) error {
    59  
    60  	if swag.IsZero(m.Derived) { // not required
    61  		return nil
    62  	}
    63  
    64  	if err := m.Derived.Validate(formats); err != nil {
    65  		if ve, ok := err.(*errors.Validation); ok {
    66  			return ve.ValidateName("derived")
    67  		}
    68  		return err
    69  	}
    70  
    71  	return nil
    72  }
    73  
    74  func (m *LabelConfigurationStatus) validateDisabled(formats strfmt.Registry) error {
    75  
    76  	if swag.IsZero(m.Disabled) { // not required
    77  		return nil
    78  	}
    79  
    80  	if err := m.Disabled.Validate(formats); err != nil {
    81  		if ve, ok := err.(*errors.Validation); ok {
    82  			return ve.ValidateName("disabled")
    83  		}
    84  		return err
    85  	}
    86  
    87  	return nil
    88  }
    89  
    90  func (m *LabelConfigurationStatus) validateRealized(formats strfmt.Registry) error {
    91  
    92  	if swag.IsZero(m.Realized) { // not required
    93  		return nil
    94  	}
    95  
    96  	if m.Realized != nil {
    97  		if err := m.Realized.Validate(formats); err != nil {
    98  			if ve, ok := err.(*errors.Validation); ok {
    99  				return ve.ValidateName("realized")
   100  			}
   101  			return err
   102  		}
   103  	}
   104  
   105  	return nil
   106  }
   107  
   108  func (m *LabelConfigurationStatus) validateSecurityRelevant(formats strfmt.Registry) error {
   109  
   110  	if swag.IsZero(m.SecurityRelevant) { // not required
   111  		return nil
   112  	}
   113  
   114  	if err := m.SecurityRelevant.Validate(formats); err != nil {
   115  		if ve, ok := err.(*errors.Validation); ok {
   116  			return ve.ValidateName("security-relevant")
   117  		}
   118  		return err
   119  	}
   120  
   121  	return nil
   122  }
   123  
   124  // MarshalBinary interface implementation
   125  func (m *LabelConfigurationStatus) MarshalBinary() ([]byte, error) {
   126  	if m == nil {
   127  		return nil, nil
   128  	}
   129  	return swag.WriteJSON(m)
   130  }
   131  
   132  // UnmarshalBinary interface implementation
   133  func (m *LabelConfigurationStatus) UnmarshalBinary(b []byte) error {
   134  	var res LabelConfigurationStatus
   135  	if err := swag.ReadJSON(b, &res); err != nil {
   136  		return err
   137  	}
   138  	*m = res
   139  	return nil
   140  }