This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
frostfs-rest-gw/gen/restapi/operations/auth_responses.go

101 lines
2.3 KiB
Go
Raw Normal View History

// 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)
if o.Payload != nil {
payload := o.Payload
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.Error `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.Error) *AuthBadRequest {
o.Payload = payload
return o
}
// SetPayload sets the payload to the auth bad request response
func (o *AuthBadRequest) SetPayload(payload models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *AuthBadRequest) 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
}
}