// Code generated by go-swagger; DO NOT EDIT. package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "net/http" "github.com/go-openapi/runtime" "github.com/TrueCloudLab/frostfs-rest-gw/gen/models" ) // PutObjectOKCode is the HTTP code returned for type PutObjectOK const PutObjectOKCode int = 200 /*PutObjectOK Address of uploaded objects swagger:response putObjectOK */ type PutObjectOK struct { /* */ AccessControlAllowOrigin string `json:"Access-Control-Allow-Origin"` /* In: Body */ Payload *models.Address `json:"body,omitempty"` } // NewPutObjectOK creates PutObjectOK with default headers values func NewPutObjectOK() *PutObjectOK { return &PutObjectOK{} } // WithAccessControlAllowOrigin adds the accessControlAllowOrigin to the put object o k response func (o *PutObjectOK) WithAccessControlAllowOrigin(accessControlAllowOrigin string) *PutObjectOK { o.AccessControlAllowOrigin = accessControlAllowOrigin return o } // SetAccessControlAllowOrigin sets the accessControlAllowOrigin to the put object o k response func (o *PutObjectOK) SetAccessControlAllowOrigin(accessControlAllowOrigin string) { o.AccessControlAllowOrigin = accessControlAllowOrigin } // WithPayload adds the payload to the put object o k response func (o *PutObjectOK) WithPayload(payload *models.Address) *PutObjectOK { o.Payload = payload return o } // SetPayload sets the payload to the put object o k response func (o *PutObjectOK) SetPayload(payload *models.Address) { o.Payload = payload } // WriteResponse to the client func (o *PutObjectOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { // response header Access-Control-Allow-Origin accessControlAllowOrigin := o.AccessControlAllowOrigin if accessControlAllowOrigin != "" { rw.Header().Set("Access-Control-Allow-Origin", accessControlAllowOrigin) } rw.WriteHeader(200) if o.Payload != nil { payload := o.Payload if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } } } // PutObjectBadRequestCode is the HTTP code returned for type PutObjectBadRequest const PutObjectBadRequestCode int = 400 /*PutObjectBadRequest Bad request swagger:response putObjectBadRequest */ type PutObjectBadRequest struct { /* In: Body */ Payload *models.ErrorResponse `json:"body,omitempty"` } // NewPutObjectBadRequest creates PutObjectBadRequest with default headers values func NewPutObjectBadRequest() *PutObjectBadRequest { return &PutObjectBadRequest{} } // WithPayload adds the payload to the put object bad request response func (o *PutObjectBadRequest) WithPayload(payload *models.ErrorResponse) *PutObjectBadRequest { o.Payload = payload return o } // SetPayload sets the payload to the put object bad request response func (o *PutObjectBadRequest) SetPayload(payload *models.ErrorResponse) { o.Payload = payload } // WriteResponse to the client func (o *PutObjectBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(400) if o.Payload != nil { payload := o.Payload if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } } }