github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/ipam/post_ip_a_m_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 // PostIPAMCreatedCode is the HTTP code returned for type PostIPAMCreated 17 const PostIPAMCreatedCode int = 201 18 19 /*PostIPAMCreated Success 20 21 swagger:response postIpAMCreated 22 */ 23 type PostIPAMCreated struct { 24 25 /* 26 In: Body 27 */ 28 Payload *models.IPAMResponse `json:"body,omitempty"` 29 } 30 31 // NewPostIPAMCreated creates PostIPAMCreated with default headers values 32 func NewPostIPAMCreated() *PostIPAMCreated { 33 34 return &PostIPAMCreated{} 35 } 36 37 // WithPayload adds the payload to the post Ip a m created response 38 func (o *PostIPAMCreated) WithPayload(payload *models.IPAMResponse) *PostIPAMCreated { 39 o.Payload = payload 40 return o 41 } 42 43 // SetPayload sets the payload to the post Ip a m created response 44 func (o *PostIPAMCreated) SetPayload(payload *models.IPAMResponse) { 45 o.Payload = payload 46 } 47 48 // WriteResponse to the client 49 func (o *PostIPAMCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 50 51 rw.WriteHeader(201) 52 if o.Payload != nil { 53 payload := o.Payload 54 if err := producer.Produce(rw, payload); err != nil { 55 panic(err) // let the recovery middleware deal with this 56 } 57 } 58 } 59 60 // PostIPAMFailureCode is the HTTP code returned for type PostIPAMFailure 61 const PostIPAMFailureCode int = 502 62 63 /*PostIPAMFailure Allocation failure 64 65 swagger:response postIpAMFailure 66 */ 67 type PostIPAMFailure struct { 68 69 /* 70 In: Body 71 */ 72 Payload models.Error `json:"body,omitempty"` 73 } 74 75 // NewPostIPAMFailure creates PostIPAMFailure with default headers values 76 func NewPostIPAMFailure() *PostIPAMFailure { 77 78 return &PostIPAMFailure{} 79 } 80 81 // WithPayload adds the payload to the post Ip a m failure response 82 func (o *PostIPAMFailure) WithPayload(payload models.Error) *PostIPAMFailure { 83 o.Payload = payload 84 return o 85 } 86 87 // SetPayload sets the payload to the post Ip a m failure response 88 func (o *PostIPAMFailure) SetPayload(payload models.Error) { 89 o.Payload = payload 90 } 91 92 // WriteResponse to the client 93 func (o *PostIPAMFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 94 95 rw.WriteHeader(502) 96 payload := o.Payload 97 if err := producer.Produce(rw, payload); err != nil { 98 panic(err) // let the recovery middleware deal with this 99 } 100 }