diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-10 18:55:02 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-10 18:55:02 -0700 |
commit | e6fedd421bf7644e969072eff9f375ecb58b25e2 (patch) | |
tree | bfb0ef710af7a0d6d98b4a75f5265776d69e76d1 /golang/gen/restapi/operations/post_creator_responses.go | |
parent | c6422b49b8b946386ca1068ec6887bbf07a8b166 (diff) | |
download | fatcat-e6fedd421bf7644e969072eff9f375ecb58b25e2.tar.gz fatcat-e6fedd421bf7644e969072eff9f375ecb58b25e2.zip |
bunch more API endpoints
Diffstat (limited to 'golang/gen/restapi/operations/post_creator_responses.go')
-rw-r--r-- | golang/gen/restapi/operations/post_creator_responses.go | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/golang/gen/restapi/operations/post_creator_responses.go b/golang/gen/restapi/operations/post_creator_responses.go index 8f8ea571..dcf661a5 100644 --- a/golang/gen/restapi/operations/post_creator_responses.go +++ b/golang/gen/restapi/operations/post_creator_responses.go @@ -57,6 +57,50 @@ func (o *PostCreatorCreated) WriteResponse(rw http.ResponseWriter, producer runt } } +// PostCreatorBadRequestCode is the HTTP code returned for type PostCreatorBadRequest +const PostCreatorBadRequestCode int = 400 + +/*PostCreatorBadRequest bad request + +swagger:response postCreatorBadRequest +*/ +type PostCreatorBadRequest struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewPostCreatorBadRequest creates PostCreatorBadRequest with default headers values +func NewPostCreatorBadRequest() *PostCreatorBadRequest { + + return &PostCreatorBadRequest{} +} + +// WithPayload adds the payload to the post creator bad request response +func (o *PostCreatorBadRequest) WithPayload(payload *models.Error) *PostCreatorBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the post creator bad request response +func (o *PostCreatorBadRequest) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *PostCreatorBadRequest) 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 + } + } +} + /*PostCreatorDefault generic error response swagger:response postCreatorDefault |