github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/policy/get_fqdn_names_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 // GetFqdnNamesOKCode is the HTTP code returned for type GetFqdnNamesOK 20 const GetFqdnNamesOKCode int = 200 21 22 /* 23 GetFqdnNamesOK Success 24 25 swagger:response getFqdnNamesOK 26 */ 27 type GetFqdnNamesOK struct { 28 29 /* 30 In: Body 31 */ 32 Payload *models.NameManager `json:"body,omitempty"` 33 } 34 35 // NewGetFqdnNamesOK creates GetFqdnNamesOK with default headers values 36 func NewGetFqdnNamesOK() *GetFqdnNamesOK { 37 38 return &GetFqdnNamesOK{} 39 } 40 41 // WithPayload adds the payload to the get fqdn names o k response 42 func (o *GetFqdnNamesOK) WithPayload(payload *models.NameManager) *GetFqdnNamesOK { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the get fqdn names o k response 48 func (o *GetFqdnNamesOK) SetPayload(payload *models.NameManager) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *GetFqdnNamesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 54 55 rw.WriteHeader(200) 56 if o.Payload != nil { 57 payload := o.Payload 58 if err := producer.Produce(rw, payload); err != nil { 59 panic(err) // let the recovery middleware deal with this 60 } 61 } 62 } 63 64 // GetFqdnNamesBadRequestCode is the HTTP code returned for type GetFqdnNamesBadRequest 65 const GetFqdnNamesBadRequestCode int = 400 66 67 /* 68 GetFqdnNamesBadRequest Invalid request (error parsing parameters) 69 70 swagger:response getFqdnNamesBadRequest 71 */ 72 type GetFqdnNamesBadRequest struct { 73 74 /* 75 In: Body 76 */ 77 Payload models.Error `json:"body,omitempty"` 78 } 79 80 // NewGetFqdnNamesBadRequest creates GetFqdnNamesBadRequest with default headers values 81 func NewGetFqdnNamesBadRequest() *GetFqdnNamesBadRequest { 82 83 return &GetFqdnNamesBadRequest{} 84 } 85 86 // WithPayload adds the payload to the get fqdn names bad request response 87 func (o *GetFqdnNamesBadRequest) WithPayload(payload models.Error) *GetFqdnNamesBadRequest { 88 o.Payload = payload 89 return o 90 } 91 92 // SetPayload sets the payload to the get fqdn names bad request response 93 func (o *GetFqdnNamesBadRequest) SetPayload(payload models.Error) { 94 o.Payload = payload 95 } 96 97 // WriteResponse to the client 98 func (o *GetFqdnNamesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 99 100 rw.WriteHeader(400) 101 payload := o.Payload 102 if err := producer.Produce(rw, payload); err != nil { 103 panic(err) // let the recovery middleware deal with this 104 } 105 }