github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/bgp/get_bgp_route_policies_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 bgp 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 // GetBgpRoutePoliciesOKCode is the HTTP code returned for type GetBgpRoutePoliciesOK 20 const GetBgpRoutePoliciesOKCode int = 200 21 22 /* 23 GetBgpRoutePoliciesOK Success 24 25 swagger:response getBgpRoutePoliciesOK 26 */ 27 type GetBgpRoutePoliciesOK struct { 28 29 /* 30 In: Body 31 */ 32 Payload []*models.BgpRoutePolicy `json:"body,omitempty"` 33 } 34 35 // NewGetBgpRoutePoliciesOK creates GetBgpRoutePoliciesOK with default headers values 36 func NewGetBgpRoutePoliciesOK() *GetBgpRoutePoliciesOK { 37 38 return &GetBgpRoutePoliciesOK{} 39 } 40 41 // WithPayload adds the payload to the get bgp route policies o k response 42 func (o *GetBgpRoutePoliciesOK) WithPayload(payload []*models.BgpRoutePolicy) *GetBgpRoutePoliciesOK { 43 o.Payload = payload 44 return o 45 } 46 47 // SetPayload sets the payload to the get bgp route policies o k response 48 func (o *GetBgpRoutePoliciesOK) SetPayload(payload []*models.BgpRoutePolicy) { 49 o.Payload = payload 50 } 51 52 // WriteResponse to the client 53 func (o *GetBgpRoutePoliciesOK) 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.BgpRoutePolicy, 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 // GetBgpRoutePoliciesInternalServerErrorCode is the HTTP code returned for type GetBgpRoutePoliciesInternalServerError 68 const GetBgpRoutePoliciesInternalServerErrorCode int = 500 69 70 /* 71 GetBgpRoutePoliciesInternalServerError Internal Server Error 72 73 swagger:response getBgpRoutePoliciesInternalServerError 74 */ 75 type GetBgpRoutePoliciesInternalServerError struct { 76 77 /* 78 In: Body 79 */ 80 Payload models.Error `json:"body,omitempty"` 81 } 82 83 // NewGetBgpRoutePoliciesInternalServerError creates GetBgpRoutePoliciesInternalServerError with default headers values 84 func NewGetBgpRoutePoliciesInternalServerError() *GetBgpRoutePoliciesInternalServerError { 85 86 return &GetBgpRoutePoliciesInternalServerError{} 87 } 88 89 // WithPayload adds the payload to the get bgp route policies internal server error response 90 func (o *GetBgpRoutePoliciesInternalServerError) WithPayload(payload models.Error) *GetBgpRoutePoliciesInternalServerError { 91 o.Payload = payload 92 return o 93 } 94 95 // SetPayload sets the payload to the get bgp route policies internal server error response 96 func (o *GetBgpRoutePoliciesInternalServerError) SetPayload(payload models.Error) { 97 o.Payload = payload 98 } 99 100 // WriteResponse to the client 101 func (o *GetBgpRoutePoliciesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 102 103 rw.WriteHeader(500) 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 // GetBgpRoutePoliciesDisabledCode is the HTTP code returned for type GetBgpRoutePoliciesDisabled 111 const GetBgpRoutePoliciesDisabledCode int = 501 112 113 /* 114 GetBgpRoutePoliciesDisabled BGP Control Plane disabled 115 116 swagger:response getBgpRoutePoliciesDisabled 117 */ 118 type GetBgpRoutePoliciesDisabled struct { 119 120 /* 121 In: Body 122 */ 123 Payload models.Error `json:"body,omitempty"` 124 } 125 126 // NewGetBgpRoutePoliciesDisabled creates GetBgpRoutePoliciesDisabled with default headers values 127 func NewGetBgpRoutePoliciesDisabled() *GetBgpRoutePoliciesDisabled { 128 129 return &GetBgpRoutePoliciesDisabled{} 130 } 131 132 // WithPayload adds the payload to the get bgp route policies disabled response 133 func (o *GetBgpRoutePoliciesDisabled) WithPayload(payload models.Error) *GetBgpRoutePoliciesDisabled { 134 o.Payload = payload 135 return o 136 } 137 138 // SetPayload sets the payload to the get bgp route policies disabled response 139 func (o *GetBgpRoutePoliciesDisabled) SetPayload(payload models.Error) { 140 o.Payload = payload 141 } 142 143 // WriteResponse to the client 144 func (o *GetBgpRoutePoliciesDisabled) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 145 146 rw.WriteHeader(501) 147 payload := o.Payload 148 if err := producer.Produce(rw, payload); err != nil { 149 panic(err) // let the recovery middleware deal with this 150 } 151 }