github.com/kubearmor/cilium@v1.6.12/api/v1/models/endpoint_health_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  	"encoding/json"
    10  
    11  	strfmt "github.com/go-openapi/strfmt"
    12  
    13  	"github.com/go-openapi/errors"
    14  	"github.com/go-openapi/validate"
    15  )
    16  
    17  // EndpointHealthStatus A common set of statuses for endpoint health * ``OK`` = All components operational * ``Bootstrap`` = This component is being created * ``Pending`` = A change is being processed to be applied * ``Warning`` = This component is not applying up-to-date policies (but is still applying the previous version) * ``Failure`` = An error has occurred and no policy is being applied * ``Disabled`` = This endpoint is disabled and will not handle traffic
    18  //
    19  // swagger:model EndpointHealthStatus
    20  type EndpointHealthStatus string
    21  
    22  const (
    23  
    24  	// EndpointHealthStatusOK captures enum value "OK"
    25  	EndpointHealthStatusOK EndpointHealthStatus = "OK"
    26  
    27  	// EndpointHealthStatusBootstrap captures enum value "Bootstrap"
    28  	EndpointHealthStatusBootstrap EndpointHealthStatus = "Bootstrap"
    29  
    30  	// EndpointHealthStatusPending captures enum value "Pending"
    31  	EndpointHealthStatusPending EndpointHealthStatus = "Pending"
    32  
    33  	// EndpointHealthStatusWarning captures enum value "Warning"
    34  	EndpointHealthStatusWarning EndpointHealthStatus = "Warning"
    35  
    36  	// EndpointHealthStatusFailure captures enum value "Failure"
    37  	EndpointHealthStatusFailure EndpointHealthStatus = "Failure"
    38  
    39  	// EndpointHealthStatusDisabled captures enum value "Disabled"
    40  	EndpointHealthStatusDisabled EndpointHealthStatus = "Disabled"
    41  )
    42  
    43  // for schema
    44  var endpointHealthStatusEnum []interface{}
    45  
    46  func init() {
    47  	var res []EndpointHealthStatus
    48  	if err := json.Unmarshal([]byte(`["OK","Bootstrap","Pending","Warning","Failure","Disabled"]`), &res); err != nil {
    49  		panic(err)
    50  	}
    51  	for _, v := range res {
    52  		endpointHealthStatusEnum = append(endpointHealthStatusEnum, v)
    53  	}
    54  }
    55  
    56  func (m EndpointHealthStatus) validateEndpointHealthStatusEnum(path, location string, value EndpointHealthStatus) error {
    57  	if err := validate.Enum(path, location, value, endpointHealthStatusEnum); err != nil {
    58  		return err
    59  	}
    60  	return nil
    61  }
    62  
    63  // Validate validates this endpoint health status
    64  func (m EndpointHealthStatus) Validate(formats strfmt.Registry) error {
    65  	var res []error
    66  
    67  	// value enum
    68  	if err := m.validateEndpointHealthStatusEnum("", "body", m); err != nil {
    69  		return err
    70  	}
    71  
    72  	if len(res) > 0 {
    73  		return errors.CompositeValidationError(res...)
    74  	}
    75  	return nil
    76  }