github.com/looshlee/beatles@v0.0.0-20220727174639-742810ab631c/api/v1/server/restapi/ipam/post_ip_a_m_ip_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package ipam 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 // PostIPAMIPOKCode is the HTTP code returned for type PostIPAMIPOK 17 const PostIPAMIPOKCode int = 200 18 19 /*PostIPAMIPOK Success 20 21 swagger:response postIpAMIpOK 22 */ 23 type PostIPAMIPOK struct { 24 } 25 26 // NewPostIPAMIPOK creates PostIPAMIPOK with default headers values 27 func NewPostIPAMIPOK() *PostIPAMIPOK { 28 29 return &PostIPAMIPOK{} 30 } 31 32 // WriteResponse to the client 33 func (o *PostIPAMIPOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 34 35 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 36 37 rw.WriteHeader(200) 38 } 39 40 // PostIPAMIPInvalidCode is the HTTP code returned for type PostIPAMIPInvalid 41 const PostIPAMIPInvalidCode int = 400 42 43 /*PostIPAMIPInvalid Invalid IP address 44 45 swagger:response postIpAMIpInvalid 46 */ 47 type PostIPAMIPInvalid struct { 48 } 49 50 // NewPostIPAMIPInvalid creates PostIPAMIPInvalid with default headers values 51 func NewPostIPAMIPInvalid() *PostIPAMIPInvalid { 52 53 return &PostIPAMIPInvalid{} 54 } 55 56 // WriteResponse to the client 57 func (o *PostIPAMIPInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 58 59 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 60 61 rw.WriteHeader(400) 62 } 63 64 // PostIPAMIPExistsCode is the HTTP code returned for type PostIPAMIPExists 65 const PostIPAMIPExistsCode int = 409 66 67 /*PostIPAMIPExists IP already allocated 68 69 swagger:response postIpAMIpExists 70 */ 71 type PostIPAMIPExists struct { 72 } 73 74 // NewPostIPAMIPExists creates PostIPAMIPExists with default headers values 75 func NewPostIPAMIPExists() *PostIPAMIPExists { 76 77 return &PostIPAMIPExists{} 78 } 79 80 // WriteResponse to the client 81 func (o *PostIPAMIPExists) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 82 83 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 84 85 rw.WriteHeader(409) 86 } 87 88 // PostIPAMIPFailureCode is the HTTP code returned for type PostIPAMIPFailure 89 const PostIPAMIPFailureCode int = 500 90 91 /*PostIPAMIPFailure IP allocation failure. Details in message. 92 93 swagger:response postIpAMIpFailure 94 */ 95 type PostIPAMIPFailure struct { 96 97 /* 98 In: Body 99 */ 100 Payload models.Error `json:"body,omitempty"` 101 } 102 103 // NewPostIPAMIPFailure creates PostIPAMIPFailure with default headers values 104 func NewPostIPAMIPFailure() *PostIPAMIPFailure { 105 106 return &PostIPAMIPFailure{} 107 } 108 109 // WithPayload adds the payload to the post Ip a m Ip failure response 110 func (o *PostIPAMIPFailure) WithPayload(payload models.Error) *PostIPAMIPFailure { 111 o.Payload = payload 112 return o 113 } 114 115 // SetPayload sets the payload to the post Ip a m Ip failure response 116 func (o *PostIPAMIPFailure) SetPayload(payload models.Error) { 117 o.Payload = payload 118 } 119 120 // WriteResponse to the client 121 func (o *PostIPAMIPFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 122 123 rw.WriteHeader(500) 124 payload := o.Payload 125 if err := producer.Produce(rw, payload); err != nil { 126 panic(err) // let the recovery middleware deal with this 127 } 128 } 129 130 // PostIPAMIPDisabledCode is the HTTP code returned for type PostIPAMIPDisabled 131 const PostIPAMIPDisabledCode int = 501 132 133 /*PostIPAMIPDisabled Allocation for address family disabled 134 135 swagger:response postIpAMIpDisabled 136 */ 137 type PostIPAMIPDisabled struct { 138 } 139 140 // NewPostIPAMIPDisabled creates PostIPAMIPDisabled with default headers values 141 func NewPostIPAMIPDisabled() *PostIPAMIPDisabled { 142 143 return &PostIPAMIPDisabled{} 144 } 145 146 // WriteResponse to the client 147 func (o *PostIPAMIPDisabled) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 148 149 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 150 151 rw.WriteHeader(501) 152 }