github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/get_policy_selectors_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 // GetPolicySelectorsOKCode is the HTTP code returned for type GetPolicySelectorsOK 17 const GetPolicySelectorsOKCode int = 200 18 19 /*GetPolicySelectorsOK Success 20 21 swagger:response getPolicySelectorsOK 22 */ 23 type GetPolicySelectorsOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload models.SelectorCache `json:"body,omitempty"` 29 } 30 31 // NewGetPolicySelectorsOK creates GetPolicySelectorsOK with default headers values 32 func NewGetPolicySelectorsOK() *GetPolicySelectorsOK { 33 34 return &GetPolicySelectorsOK{} 35 } 36 37 // WithPayload adds the payload to the get policy selectors o k response 38 func (o *GetPolicySelectorsOK) WithPayload(payload models.SelectorCache) *GetPolicySelectorsOK { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the get policy selectors o k response 44 func (o *GetPolicySelectorsOK) SetPayload(payload models.SelectorCache) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *GetPolicySelectorsOK) 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 = models.SelectorCache{} 56 } 57 58 if err := producer.Produce(rw, payload); err != nil { 59 panic(err) // let the recovery middleware deal with this 60 } 61 }