2022-04-11 09:35:06 +00:00
|
|
|
// 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
|
|
|
|
*/
|
2022-07-07 09:02:05 +00:00
|
|
|
Payload []*models.TokenResponse `json:"body,omitempty"`
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewAuthOK creates AuthOK with default headers values
|
|
|
|
func NewAuthOK() *AuthOK {
|
|
|
|
|
|
|
|
return &AuthOK{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithPayload adds the payload to the auth o k response
|
2022-07-07 09:02:05 +00:00
|
|
|
func (o *AuthOK) WithPayload(payload []*models.TokenResponse) *AuthOK {
|
2022-04-11 09:35:06 +00:00
|
|
|
o.Payload = payload
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayload sets the payload to the auth o k response
|
2022-07-07 09:02:05 +00:00
|
|
|
func (o *AuthOK) SetPayload(payload []*models.TokenResponse) {
|
2022-04-11 09:35:06 +00:00
|
|
|
o.Payload = payload
|
|
|
|
}
|
|
|
|
|
|
|
|
// WriteResponse to the client
|
|
|
|
func (o *AuthOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
|
|
|
|
rw.WriteHeader(200)
|
2022-07-07 09:02:05 +00:00
|
|
|
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
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// AuthBadRequestCode is the HTTP code returned for type AuthBadRequest
|
|
|
|
const AuthBadRequestCode int = 400
|
|
|
|
|
|
|
|
/*AuthBadRequest Bad request
|
|
|
|
|
|
|
|
swagger:response authBadRequest
|
|
|
|
*/
|
|
|
|
type AuthBadRequest struct {
|
|
|
|
|
|
|
|
/*
|
|
|
|
In: Body
|
|
|
|
*/
|
2022-07-07 12:59:38 +00:00
|
|
|
Payload *models.ErrorResponse `json:"body,omitempty"`
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewAuthBadRequest creates AuthBadRequest with default headers values
|
|
|
|
func NewAuthBadRequest() *AuthBadRequest {
|
|
|
|
|
|
|
|
return &AuthBadRequest{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithPayload adds the payload to the auth bad request response
|
2022-07-07 12:59:38 +00:00
|
|
|
func (o *AuthBadRequest) WithPayload(payload *models.ErrorResponse) *AuthBadRequest {
|
2022-04-11 09:35:06 +00:00
|
|
|
o.Payload = payload
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPayload sets the payload to the auth bad request response
|
2022-07-07 12:59:38 +00:00
|
|
|
func (o *AuthBadRequest) SetPayload(payload *models.ErrorResponse) {
|
2022-04-11 09:35:06 +00:00
|
|
|
o.Payload = payload
|
|
|
|
}
|
|
|
|
|
|
|
|
// WriteResponse to the client
|
|
|
|
func (o *AuthBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
|
|
|
|
rw.WriteHeader(400)
|
2022-07-07 12:59:38 +00:00
|
|
|
if o.Payload != nil {
|
|
|
|
payload := o.Payload
|
|
|
|
if err := producer.Produce(rw, payload); err != nil {
|
|
|
|
panic(err) // let the recovery middleware deal with this
|
|
|
|
}
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
}
|