[#1] Add route to delete object

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-14 11:53:13 +03:00 committed by Alex Vanin
parent 26f0ae93f4
commit f5eab95f95
17 changed files with 624 additions and 212 deletions

View file

@ -0,0 +1,80 @@
// 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/nspcc-dev/neofs-rest-gw/gen/models"
)
// DeleteObjectNoContentCode is the HTTP code returned for type DeleteObjectNoContent
const DeleteObjectNoContentCode int = 204
/*DeleteObjectNoContent Successful deletion
swagger:response deleteObjectNoContent
*/
type DeleteObjectNoContent struct {
}
// NewDeleteObjectNoContent creates DeleteObjectNoContent with default headers values
func NewDeleteObjectNoContent() *DeleteObjectNoContent {
return &DeleteObjectNoContent{}
}
// WriteResponse to the client
func (o *DeleteObjectNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(204)
}
// DeleteObjectBadRequestCode is the HTTP code returned for type DeleteObjectBadRequest
const DeleteObjectBadRequestCode int = 400
/*DeleteObjectBadRequest Bad request
swagger:response deleteObjectBadRequest
*/
type DeleteObjectBadRequest struct {
/*
In: Body
*/
Payload models.Error `json:"body,omitempty"`
}
// NewDeleteObjectBadRequest creates DeleteObjectBadRequest with default headers values
func NewDeleteObjectBadRequest() *DeleteObjectBadRequest {
return &DeleteObjectBadRequest{}
}
// WithPayload adds the payload to the delete object bad request response
func (o *DeleteObjectBadRequest) WithPayload(payload models.Error) *DeleteObjectBadRequest {
o.Payload = payload
return o
}
// SetPayload sets the payload to the delete object bad request response
func (o *DeleteObjectBadRequest) SetPayload(payload models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *DeleteObjectBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(400)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}