github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/policy/get_fqdn_cache_id_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package policy 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "net/http" 13 14 "github.com/go-openapi/runtime" 15 16 "github.com/cilium/cilium/api/v1/models" 17 ) 18 19 // GetFqdnCacheIDOKCode is the HTTP code returned for type GetFqdnCacheIDOK 20 const GetFqdnCacheIDOKCode int = 200 21 22 /* 23 GetFqdnCacheIDOK Success 24 25 swagger:response getFqdnCacheIdOK 26 */ 27 type GetFqdnCacheIDOK struct { 28 29 /* 30 In: Body 31 */ 32 Payload []*models.DNSLookup `json:"body,omitempty"` 33 } 34 35 // NewGetFqdnCacheIDOK creates GetFqdnCacheIDOK with default headers values 36 func NewGetFqdnCacheIDOK() *GetFqdnCacheIDOK { 37 38 return &GetFqdnCacheIDOK{} 39 } 40 41 // WithPayload adds the payload to the get fqdn cache Id o k response 42 func (o *GetFqdnCacheIDOK) WithPayload(payload []*models.DNSLookup) *GetFqdnCacheIDOK { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the get fqdn cache Id o k response 48 func (o *GetFqdnCacheIDOK) SetPayload(payload []*models.DNSLookup) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *GetFqdnCacheIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 54 55 rw.WriteHeader(200) 56 payload := o.Payload 57 if payload == nil { 58 // return empty array 59 payload = make([]*models.DNSLookup, 0, 50) 60 } 61 62 if err := producer.Produce(rw, payload); err != nil { 63 panic(err) // let the recovery middleware deal with this 64 } 65 } 66 67 // GetFqdnCacheIDBadRequestCode is the HTTP code returned for type GetFqdnCacheIDBadRequest 68 const GetFqdnCacheIDBadRequestCode int = 400 69 70 /* 71 GetFqdnCacheIDBadRequest Invalid request (error parsing parameters) 72 73 swagger:response getFqdnCacheIdBadRequest 74 */ 75 type GetFqdnCacheIDBadRequest struct { 76 77 /* 78 In: Body 79 */ 80 Payload models.Error `json:"body,omitempty"` 81 } 82 83 // NewGetFqdnCacheIDBadRequest creates GetFqdnCacheIDBadRequest with default headers values 84 func NewGetFqdnCacheIDBadRequest() *GetFqdnCacheIDBadRequest { 85 86 return &GetFqdnCacheIDBadRequest{} 87 } 88 89 // WithPayload adds the payload to the get fqdn cache Id bad request response 90 func (o *GetFqdnCacheIDBadRequest) WithPayload(payload models.Error) *GetFqdnCacheIDBadRequest { 91 o.Payload = payload 92 return o 93 } 94 95 // SetPayload sets the payload to the get fqdn cache Id bad request response 96 func (o *GetFqdnCacheIDBadRequest) SetPayload(payload models.Error) { 97 o.Payload = payload 98 } 99 100 // WriteResponse to the client 101 func (o *GetFqdnCacheIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 102 103 rw.WriteHeader(400) 104 payload := o.Payload 105 if err := producer.Produce(rw, payload); err != nil { 106 panic(err) // let the recovery middleware deal with this 107 } 108 } 109 110 // GetFqdnCacheIDNotFoundCode is the HTTP code returned for type GetFqdnCacheIDNotFound 111 const GetFqdnCacheIDNotFoundCode int = 404 112 113 /* 114 GetFqdnCacheIDNotFound No DNS data with provided parameters found 115 116 swagger:response getFqdnCacheIdNotFound 117 */ 118 type GetFqdnCacheIDNotFound struct { 119 } 120 121 // NewGetFqdnCacheIDNotFound creates GetFqdnCacheIDNotFound with default headers values 122 func NewGetFqdnCacheIDNotFound() *GetFqdnCacheIDNotFound { 123 124 return &GetFqdnCacheIDNotFound{} 125 } 126 127 // WriteResponse to the client 128 func (o *GetFqdnCacheIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 129 130 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 131 132 rw.WriteHeader(404) 133 }