github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/get_fqdn_cache_id_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 // GetFqdnCacheIDOKCode is the HTTP code returned for type GetFqdnCacheIDOK 17 const GetFqdnCacheIDOKCode int = 200 18 19 /*GetFqdnCacheIDOK Success 20 21 swagger:response getFqdnCacheIdOK 22 */ 23 type GetFqdnCacheIDOK struct { 24 25 /* 26 In: Body 27 */ 28 Payload []*models.DNSLookup `json:"body,omitempty"` 29 } 30 31 // NewGetFqdnCacheIDOK creates GetFqdnCacheIDOK with default headers values 32 func NewGetFqdnCacheIDOK() *GetFqdnCacheIDOK { 33 34 return &GetFqdnCacheIDOK{} 35 } 36 37 // WithPayload adds the payload to the get fqdn cache Id o k response 38 func (o *GetFqdnCacheIDOK) WithPayload(payload []*models.DNSLookup) *GetFqdnCacheIDOK { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the get fqdn cache Id o k response 44 func (o *GetFqdnCacheIDOK) SetPayload(payload []*models.DNSLookup) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *GetFqdnCacheIDOK) 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.DNSLookup, 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 // GetFqdnCacheIDBadRequestCode is the HTTP code returned for type GetFqdnCacheIDBadRequest 64 const GetFqdnCacheIDBadRequestCode int = 400 65 66 /*GetFqdnCacheIDBadRequest Invalid request (error parsing parameters) 67 68 swagger:response getFqdnCacheIdBadRequest 69 */ 70 type GetFqdnCacheIDBadRequest struct { 71 72 /* 73 In: Body 74 */ 75 Payload models.Error `json:"body,omitempty"` 76 } 77 78 // NewGetFqdnCacheIDBadRequest creates GetFqdnCacheIDBadRequest with default headers values 79 func NewGetFqdnCacheIDBadRequest() *GetFqdnCacheIDBadRequest { 80 81 return &GetFqdnCacheIDBadRequest{} 82 } 83 84 // WithPayload adds the payload to the get fqdn cache Id bad request response 85 func (o *GetFqdnCacheIDBadRequest) WithPayload(payload models.Error) *GetFqdnCacheIDBadRequest { 86 o.Payload = payload 87 return o 88 } 89 90 // SetPayload sets the payload to the get fqdn cache Id bad request response 91 func (o *GetFqdnCacheIDBadRequest) SetPayload(payload models.Error) { 92 o.Payload = payload 93 } 94 95 // WriteResponse to the client 96 func (o *GetFqdnCacheIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 97 98 rw.WriteHeader(400) 99 payload := o.Payload 100 if err := producer.Produce(rw, payload); err != nil { 101 panic(err) // let the recovery middleware deal with this 102 } 103 } 104 105 // GetFqdnCacheIDNotFoundCode is the HTTP code returned for type GetFqdnCacheIDNotFound 106 const GetFqdnCacheIDNotFoundCode int = 404 107 108 /*GetFqdnCacheIDNotFound No DNS data with provided parameters found 109 110 swagger:response getFqdnCacheIdNotFound 111 */ 112 type GetFqdnCacheIDNotFound struct { 113 } 114 115 // NewGetFqdnCacheIDNotFound creates GetFqdnCacheIDNotFound with default headers values 116 func NewGetFqdnCacheIDNotFound() *GetFqdnCacheIDNotFound { 117 118 return &GetFqdnCacheIDNotFound{} 119 } 120 121 // WriteResponse to the client 122 func (o *GetFqdnCacheIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 123 124 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 125 126 rw.WriteHeader(404) 127 }