frostfs-rest-gw/gen/restapi/operations/auth_responses.go
Denis Kirillov b412af2e22 [#24] Update examples and description in spec
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2022-07-22 12:19:33 +03:00

105 lines
2.4 KiB
Go

// 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"
)
// AuthOKCode is the HTTP code returned for type AuthOK
const AuthOKCode int = 200
/*AuthOK Base64 encoded stable binary marshaled bearer token.
swagger:response authOK
*/
type AuthOK struct {
/*
In: Body
*/
Payload []*models.TokenResponse `json:"body,omitempty"`
}
// NewAuthOK creates AuthOK with default headers values
func NewAuthOK() *AuthOK {
return &AuthOK{}
}
// WithPayload adds the payload to the auth o k response
func (o *AuthOK) WithPayload(payload []*models.TokenResponse) *AuthOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the auth o k response
func (o *AuthOK) SetPayload(payload []*models.TokenResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *AuthOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
payload := o.Payload
if payload == nil {
// return empty array
payload = make([]*models.TokenResponse, 0, 50)
}
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
// AuthBadRequestCode is the HTTP code returned for type AuthBadRequest
const AuthBadRequestCode int = 400
/*AuthBadRequest Bad request
swagger:response authBadRequest
*/
type AuthBadRequest struct {
/*
In: Body
*/
Payload *models.ErrorResponse `json:"body,omitempty"`
}
// NewAuthBadRequest creates AuthBadRequest with default headers values
func NewAuthBadRequest() *AuthBadRequest {
return &AuthBadRequest{}
}
// WithPayload adds the payload to the auth bad request response
func (o *AuthBadRequest) WithPayload(payload *models.ErrorResponse) *AuthBadRequest {
o.Payload = payload
return o
}
// SetPayload sets the payload to the auth bad request response
func (o *AuthBadRequest) SetPayload(payload *models.ErrorResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *AuthBadRequest) 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
}
}
}