github.com/kubearmor/cilium@v1.6.12/api/v1/models/endpoint_state.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 // EndpointState State of endpoint 18 // swagger:model EndpointState 19 type EndpointState string 20 21 const ( 22 23 // EndpointStateCreating captures enum value "creating" 24 EndpointStateCreating EndpointState = "creating" 25 26 // EndpointStateWaitingForIdentity captures enum value "waiting-for-identity" 27 EndpointStateWaitingForIdentity EndpointState = "waiting-for-identity" 28 29 // EndpointStateNotReady captures enum value "not-ready" 30 EndpointStateNotReady EndpointState = "not-ready" 31 32 // EndpointStateWaitingToRegenerate captures enum value "waiting-to-regenerate" 33 EndpointStateWaitingToRegenerate EndpointState = "waiting-to-regenerate" 34 35 // EndpointStateRegenerating captures enum value "regenerating" 36 EndpointStateRegenerating EndpointState = "regenerating" 37 38 // EndpointStateRestoring captures enum value "restoring" 39 EndpointStateRestoring EndpointState = "restoring" 40 41 // EndpointStateReady captures enum value "ready" 42 EndpointStateReady EndpointState = "ready" 43 44 // EndpointStateDisconnecting captures enum value "disconnecting" 45 EndpointStateDisconnecting EndpointState = "disconnecting" 46 47 // EndpointStateDisconnected captures enum value "disconnected" 48 EndpointStateDisconnected EndpointState = "disconnected" 49 50 // EndpointStateInvalid captures enum value "invalid" 51 EndpointStateInvalid EndpointState = "invalid" 52 ) 53 54 // for schema 55 var endpointStateEnum []interface{} 56 57 func init() { 58 var res []EndpointState 59 if err := json.Unmarshal([]byte(`["creating","waiting-for-identity","not-ready","waiting-to-regenerate","regenerating","restoring","ready","disconnecting","disconnected","invalid"]`), &res); err != nil { 60 panic(err) 61 } 62 for _, v := range res { 63 endpointStateEnum = append(endpointStateEnum, v) 64 } 65 } 66 67 func (m EndpointState) validateEndpointStateEnum(path, location string, value EndpointState) error { 68 if err := validate.Enum(path, location, value, endpointStateEnum); err != nil { 69 return err 70 } 71 return nil 72 } 73 74 // Validate validates this endpoint state 75 func (m EndpointState) Validate(formats strfmt.Registry) error { 76 var res []error 77 78 // value enum 79 if err := m.validateEndpointStateEnum("", "body", m); err != nil { 80 return err 81 } 82 83 if len(res) > 0 { 84 return errors.CompositeValidationError(res...) 85 } 86 return nil 87 }