github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/get_identity_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package policy 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 "net/http" 10 11 "github.com/go-openapi/runtime" 12 13 models "github.com/cilium/cilium/api/v1/models" 14 ) 15 16 // GetIdentityOKCode is the HTTP code returned for type GetIdentityOK 17 const GetIdentityOKCode int = 200 18 19 /*GetIdentityOK Success 20 21 swagger:response getIdentityOK 22 */ 23 type GetIdentityOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload []*models.Identity `json:"body,omitempty"` 29 } 30 31 // NewGetIdentityOK creates GetIdentityOK with default headers values 32 func NewGetIdentityOK() *GetIdentityOK { 33 34 return &GetIdentityOK{} 35 } 36 37 // WithPayload adds the payload to the get identity o k response 38 func (o *GetIdentityOK) WithPayload(payload []*models.Identity) *GetIdentityOK { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the get identity o k response 44 func (o *GetIdentityOK) SetPayload(payload []*models.Identity) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *GetIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 50 51 rw.WriteHeader(200) 52 payload := o.Payload 53 if payload == nil { 54 // return empty array 55 payload = make([]*models.Identity, 0, 50) 56 } 57 58 if err := producer.Produce(rw, payload); err != nil { 59 panic(err) // let the recovery middleware deal with this 60 } 61 } 62 63 // GetIdentityNotFoundCode is the HTTP code returned for type GetIdentityNotFound 64 const GetIdentityNotFoundCode int = 404 65 66 /*GetIdentityNotFound Identities with provided parameters not found 67 68 swagger:response getIdentityNotFound 69 */ 70 type GetIdentityNotFound struct { 71 } 72 73 // NewGetIdentityNotFound creates GetIdentityNotFound with default headers values 74 func NewGetIdentityNotFound() *GetIdentityNotFound { 75 76 return &GetIdentityNotFound{} 77 } 78 79 // WriteResponse to the client 80 func (o *GetIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 81 82 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 83 84 rw.WriteHeader(404) 85 } 86 87 // GetIdentityUnreachableCode is the HTTP code returned for type GetIdentityUnreachable 88 const GetIdentityUnreachableCode int = 520 89 90 /*GetIdentityUnreachable Identity storage unreachable. Likely a network problem. 91 92 swagger:response getIdentityUnreachable 93 */ 94 type GetIdentityUnreachable struct { 95 96 /* 97 In: Body 98 */ 99 Payload models.Error `json:"body,omitempty"` 100 } 101 102 // NewGetIdentityUnreachable creates GetIdentityUnreachable with default headers values 103 func NewGetIdentityUnreachable() *GetIdentityUnreachable { 104 105 return &GetIdentityUnreachable{} 106 } 107 108 // WithPayload adds the payload to the get identity unreachable response 109 func (o *GetIdentityUnreachable) WithPayload(payload models.Error) *GetIdentityUnreachable { 110 o.Payload = payload 111 return o 112 } 113 114 // SetPayload sets the payload to the get identity unreachable response 115 func (o *GetIdentityUnreachable) SetPayload(payload models.Error) { 116 o.Payload = payload 117 } 118 119 // WriteResponse to the client 120 func (o *GetIdentityUnreachable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 121 122 rw.WriteHeader(520) 123 payload := o.Payload 124 if err := producer.Produce(rw, payload); err != nil { 125 panic(err) // let the recovery middleware deal with this 126 } 127 } 128 129 // GetIdentityInvalidStorageFormatCode is the HTTP code returned for type GetIdentityInvalidStorageFormat 130 const GetIdentityInvalidStorageFormatCode int = 521 131 132 /*GetIdentityInvalidStorageFormat Invalid identity format in storage 133 134 swagger:response getIdentityInvalidStorageFormat 135 */ 136 type GetIdentityInvalidStorageFormat struct { 137 138 /* 139 In: Body 140 */ 141 Payload models.Error `json:"body,omitempty"` 142 } 143 144 // NewGetIdentityInvalidStorageFormat creates GetIdentityInvalidStorageFormat with default headers values 145 func NewGetIdentityInvalidStorageFormat() *GetIdentityInvalidStorageFormat { 146 147 return &GetIdentityInvalidStorageFormat{} 148 } 149 150 // WithPayload adds the payload to the get identity invalid storage format response 151 func (o *GetIdentityInvalidStorageFormat) WithPayload(payload models.Error) *GetIdentityInvalidStorageFormat { 152 o.Payload = payload 153 return o 154 } 155 156 // SetPayload sets the payload to the get identity invalid storage format response 157 func (o *GetIdentityInvalidStorageFormat) SetPayload(payload models.Error) { 158 o.Payload = payload 159 } 160 161 // WriteResponse to the client 162 func (o *GetIdentityInvalidStorageFormat) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 163 164 rw.WriteHeader(521) 165 payload := o.Payload 166 if err := producer.Produce(rw, payload); err != nil { 167 panic(err) // let the recovery middleware deal with this 168 } 169 }