decentral1se
e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
479 lines
15 KiB
Go
479 lines
15 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package accounts
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
"git.coopcloud.tech/decentral1se/gtslib/models"
|
|
)
|
|
|
|
// AccountCreateReader is a Reader for the AccountCreate structure.
|
|
type AccountCreateReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *AccountCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewAccountCreateOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 400:
|
|
result := NewAccountCreateBadRequest()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 401:
|
|
result := NewAccountCreateUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewAccountCreateNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 406:
|
|
result := NewAccountCreateNotAcceptable()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewAccountCreateUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewAccountCreateInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[POST /api/v1/accounts] accountCreate", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewAccountCreateOK creates a AccountCreateOK with default headers values
|
|
func NewAccountCreateOK() *AccountCreateOK {
|
|
return &AccountCreateOK{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateOK describes a response with status code 200, with default header values.
|
|
|
|
An OAuth2 access token for the newly-created account.
|
|
*/
|
|
type AccountCreateOK struct {
|
|
Payload *models.Token
|
|
}
|
|
|
|
// IsSuccess returns true when this account create o k response has a 2xx status code
|
|
func (o *AccountCreateOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this account create o k response has a 3xx status code
|
|
func (o *AccountCreateOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create o k response has a 4xx status code
|
|
func (o *AccountCreateOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this account create o k response has a 5xx status code
|
|
func (o *AccountCreateOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create o k response a status code equal to that given
|
|
func (o *AccountCreateOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the account create o k response
|
|
func (o *AccountCreateOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *AccountCreateOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *AccountCreateOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *AccountCreateOK) GetPayload() *models.Token {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *AccountCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(models.Token)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateBadRequest creates a AccountCreateBadRequest with default headers values
|
|
func NewAccountCreateBadRequest() *AccountCreateBadRequest {
|
|
return &AccountCreateBadRequest{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateBadRequest describes a response with status code 400, with default header values.
|
|
|
|
bad request
|
|
*/
|
|
type AccountCreateBadRequest struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create bad request response has a 2xx status code
|
|
func (o *AccountCreateBadRequest) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create bad request response has a 3xx status code
|
|
func (o *AccountCreateBadRequest) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create bad request response has a 4xx status code
|
|
func (o *AccountCreateBadRequest) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this account create bad request response has a 5xx status code
|
|
func (o *AccountCreateBadRequest) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create bad request response a status code equal to that given
|
|
func (o *AccountCreateBadRequest) IsCode(code int) bool {
|
|
return code == 400
|
|
}
|
|
|
|
// Code gets the status code for the account create bad request response
|
|
func (o *AccountCreateBadRequest) Code() int {
|
|
return 400
|
|
}
|
|
|
|
func (o *AccountCreateBadRequest) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateBadRequest", 400)
|
|
}
|
|
|
|
func (o *AccountCreateBadRequest) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateBadRequest", 400)
|
|
}
|
|
|
|
func (o *AccountCreateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateUnauthorized creates a AccountCreateUnauthorized with default headers values
|
|
func NewAccountCreateUnauthorized() *AccountCreateUnauthorized {
|
|
return &AccountCreateUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
unauthorized
|
|
*/
|
|
type AccountCreateUnauthorized struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create unauthorized response has a 2xx status code
|
|
func (o *AccountCreateUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create unauthorized response has a 3xx status code
|
|
func (o *AccountCreateUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create unauthorized response has a 4xx status code
|
|
func (o *AccountCreateUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this account create unauthorized response has a 5xx status code
|
|
func (o *AccountCreateUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create unauthorized response a status code equal to that given
|
|
func (o *AccountCreateUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the account create unauthorized response
|
|
func (o *AccountCreateUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *AccountCreateUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnauthorized", 401)
|
|
}
|
|
|
|
func (o *AccountCreateUnauthorized) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnauthorized", 401)
|
|
}
|
|
|
|
func (o *AccountCreateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateNotFound creates a AccountCreateNotFound with default headers values
|
|
func NewAccountCreateNotFound() *AccountCreateNotFound {
|
|
return &AccountCreateNotFound{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateNotFound describes a response with status code 404, with default header values.
|
|
|
|
not found
|
|
*/
|
|
type AccountCreateNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create not found response has a 2xx status code
|
|
func (o *AccountCreateNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create not found response has a 3xx status code
|
|
func (o *AccountCreateNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create not found response has a 4xx status code
|
|
func (o *AccountCreateNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this account create not found response has a 5xx status code
|
|
func (o *AccountCreateNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create not found response a status code equal to that given
|
|
func (o *AccountCreateNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the account create not found response
|
|
func (o *AccountCreateNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *AccountCreateNotFound) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotFound", 404)
|
|
}
|
|
|
|
func (o *AccountCreateNotFound) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotFound", 404)
|
|
}
|
|
|
|
func (o *AccountCreateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateNotAcceptable creates a AccountCreateNotAcceptable with default headers values
|
|
func NewAccountCreateNotAcceptable() *AccountCreateNotAcceptable {
|
|
return &AccountCreateNotAcceptable{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateNotAcceptable describes a response with status code 406, with default header values.
|
|
|
|
not acceptable
|
|
*/
|
|
type AccountCreateNotAcceptable struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create not acceptable response has a 2xx status code
|
|
func (o *AccountCreateNotAcceptable) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create not acceptable response has a 3xx status code
|
|
func (o *AccountCreateNotAcceptable) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create not acceptable response has a 4xx status code
|
|
func (o *AccountCreateNotAcceptable) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this account create not acceptable response has a 5xx status code
|
|
func (o *AccountCreateNotAcceptable) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create not acceptable response a status code equal to that given
|
|
func (o *AccountCreateNotAcceptable) IsCode(code int) bool {
|
|
return code == 406
|
|
}
|
|
|
|
// Code gets the status code for the account create not acceptable response
|
|
func (o *AccountCreateNotAcceptable) Code() int {
|
|
return 406
|
|
}
|
|
|
|
func (o *AccountCreateNotAcceptable) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *AccountCreateNotAcceptable) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *AccountCreateNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateUnprocessableEntity creates a AccountCreateUnprocessableEntity with default headers values
|
|
func NewAccountCreateUnprocessableEntity() *AccountCreateUnprocessableEntity {
|
|
return &AccountCreateUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable. Your account creation request cannot be processed because either too many accounts have been created on this instance in the last 24h, or the pending account backlog is full.
|
|
*/
|
|
type AccountCreateUnprocessableEntity struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create unprocessable entity response has a 2xx status code
|
|
func (o *AccountCreateUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create unprocessable entity response has a 3xx status code
|
|
func (o *AccountCreateUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create unprocessable entity response has a 4xx status code
|
|
func (o *AccountCreateUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this account create unprocessable entity response has a 5xx status code
|
|
func (o *AccountCreateUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this account create unprocessable entity response a status code equal to that given
|
|
func (o *AccountCreateUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the account create unprocessable entity response
|
|
func (o *AccountCreateUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *AccountCreateUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *AccountCreateUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *AccountCreateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewAccountCreateInternalServerError creates a AccountCreateInternalServerError with default headers values
|
|
func NewAccountCreateInternalServerError() *AccountCreateInternalServerError {
|
|
return &AccountCreateInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
AccountCreateInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
internal server error
|
|
*/
|
|
type AccountCreateInternalServerError struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this account create internal server error response has a 2xx status code
|
|
func (o *AccountCreateInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this account create internal server error response has a 3xx status code
|
|
func (o *AccountCreateInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this account create internal server error response has a 4xx status code
|
|
func (o *AccountCreateInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this account create internal server error response has a 5xx status code
|
|
func (o *AccountCreateInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this account create internal server error response a status code equal to that given
|
|
func (o *AccountCreateInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the account create internal server error response
|
|
func (o *AccountCreateInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *AccountCreateInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateInternalServerError", 500)
|
|
}
|
|
|
|
func (o *AccountCreateInternalServerError) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateInternalServerError", 500)
|
|
}
|
|
|
|
func (o *AccountCreateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|