// 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"
)

// AccountAliasReader is a Reader for the AccountAlias structure.
type AccountAliasReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AccountAliasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAccountAliasOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewAccountAliasBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewAccountAliasUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewAccountAliasNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewAccountAliasNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewAccountAliasUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewAccountAliasInternalServerError()
		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/alias] accountAlias", response, response.Code())
	}
}

// NewAccountAliasOK creates a AccountAliasOK with default headers values
func NewAccountAliasOK() *AccountAliasOK {
	return &AccountAliasOK{}
}

/*
AccountAliasOK describes a response with status code 200, with default header values.

The newly updated account.
*/
type AccountAliasOK struct {
	Payload *models.Account
}

// IsSuccess returns true when this account alias o k response has a 2xx status code
func (o *AccountAliasOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this account alias o k response has a 3xx status code
func (o *AccountAliasOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias o k response has a 4xx status code
func (o *AccountAliasOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this account alias o k response has a 5xx status code
func (o *AccountAliasOK) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias o k response a status code equal to that given
func (o *AccountAliasOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the account alias o k response
func (o *AccountAliasOK) Code() int {
	return 200
}

func (o *AccountAliasOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasOK %s", 200, payload)
}

func (o *AccountAliasOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasOK %s", 200, payload)
}

func (o *AccountAliasOK) GetPayload() *models.Account {
	return o.Payload
}

func (o *AccountAliasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Account)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewAccountAliasBadRequest creates a AccountAliasBadRequest with default headers values
func NewAccountAliasBadRequest() *AccountAliasBadRequest {
	return &AccountAliasBadRequest{}
}

/*
AccountAliasBadRequest describes a response with status code 400, with default header values.

bad request
*/
type AccountAliasBadRequest struct {
}

// IsSuccess returns true when this account alias bad request response has a 2xx status code
func (o *AccountAliasBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias bad request response has a 3xx status code
func (o *AccountAliasBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias bad request response has a 4xx status code
func (o *AccountAliasBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this account alias bad request response has a 5xx status code
func (o *AccountAliasBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias bad request response a status code equal to that given
func (o *AccountAliasBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the account alias bad request response
func (o *AccountAliasBadRequest) Code() int {
	return 400
}

func (o *AccountAliasBadRequest) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasBadRequest", 400)
}

func (o *AccountAliasBadRequest) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasBadRequest", 400)
}

func (o *AccountAliasBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewAccountAliasUnauthorized creates a AccountAliasUnauthorized with default headers values
func NewAccountAliasUnauthorized() *AccountAliasUnauthorized {
	return &AccountAliasUnauthorized{}
}

/*
AccountAliasUnauthorized describes a response with status code 401, with default header values.

unauthorized
*/
type AccountAliasUnauthorized struct {
}

// IsSuccess returns true when this account alias unauthorized response has a 2xx status code
func (o *AccountAliasUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias unauthorized response has a 3xx status code
func (o *AccountAliasUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias unauthorized response has a 4xx status code
func (o *AccountAliasUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this account alias unauthorized response has a 5xx status code
func (o *AccountAliasUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias unauthorized response a status code equal to that given
func (o *AccountAliasUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the account alias unauthorized response
func (o *AccountAliasUnauthorized) Code() int {
	return 401
}

func (o *AccountAliasUnauthorized) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnauthorized", 401)
}

func (o *AccountAliasUnauthorized) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnauthorized", 401)
}

func (o *AccountAliasUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewAccountAliasNotFound creates a AccountAliasNotFound with default headers values
func NewAccountAliasNotFound() *AccountAliasNotFound {
	return &AccountAliasNotFound{}
}

/*
AccountAliasNotFound describes a response with status code 404, with default header values.

not found
*/
type AccountAliasNotFound struct {
}

// IsSuccess returns true when this account alias not found response has a 2xx status code
func (o *AccountAliasNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias not found response has a 3xx status code
func (o *AccountAliasNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias not found response has a 4xx status code
func (o *AccountAliasNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this account alias not found response has a 5xx status code
func (o *AccountAliasNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias not found response a status code equal to that given
func (o *AccountAliasNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the account alias not found response
func (o *AccountAliasNotFound) Code() int {
	return 404
}

func (o *AccountAliasNotFound) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotFound", 404)
}

func (o *AccountAliasNotFound) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotFound", 404)
}

func (o *AccountAliasNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewAccountAliasNotAcceptable creates a AccountAliasNotAcceptable with default headers values
func NewAccountAliasNotAcceptable() *AccountAliasNotAcceptable {
	return &AccountAliasNotAcceptable{}
}

/*
AccountAliasNotAcceptable describes a response with status code 406, with default header values.

not acceptable
*/
type AccountAliasNotAcceptable struct {
}

// IsSuccess returns true when this account alias not acceptable response has a 2xx status code
func (o *AccountAliasNotAcceptable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias not acceptable response has a 3xx status code
func (o *AccountAliasNotAcceptable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias not acceptable response has a 4xx status code
func (o *AccountAliasNotAcceptable) IsClientError() bool {
	return true
}

// IsServerError returns true when this account alias not acceptable response has a 5xx status code
func (o *AccountAliasNotAcceptable) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias not acceptable response a status code equal to that given
func (o *AccountAliasNotAcceptable) IsCode(code int) bool {
	return code == 406
}

// Code gets the status code for the account alias not acceptable response
func (o *AccountAliasNotAcceptable) Code() int {
	return 406
}

func (o *AccountAliasNotAcceptable) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotAcceptable", 406)
}

func (o *AccountAliasNotAcceptable) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotAcceptable", 406)
}

func (o *AccountAliasNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewAccountAliasUnprocessableEntity creates a AccountAliasUnprocessableEntity with default headers values
func NewAccountAliasUnprocessableEntity() *AccountAliasUnprocessableEntity {
	return &AccountAliasUnprocessableEntity{}
}

/*
AccountAliasUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable. Check the response body for more details.
*/
type AccountAliasUnprocessableEntity struct {
}

// IsSuccess returns true when this account alias unprocessable entity response has a 2xx status code
func (o *AccountAliasUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias unprocessable entity response has a 3xx status code
func (o *AccountAliasUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias unprocessable entity response has a 4xx status code
func (o *AccountAliasUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this account alias unprocessable entity response has a 5xx status code
func (o *AccountAliasUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this account alias unprocessable entity response a status code equal to that given
func (o *AccountAliasUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the account alias unprocessable entity response
func (o *AccountAliasUnprocessableEntity) Code() int {
	return 422
}

func (o *AccountAliasUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnprocessableEntity", 422)
}

func (o *AccountAliasUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnprocessableEntity", 422)
}

func (o *AccountAliasUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewAccountAliasInternalServerError creates a AccountAliasInternalServerError with default headers values
func NewAccountAliasInternalServerError() *AccountAliasInternalServerError {
	return &AccountAliasInternalServerError{}
}

/*
AccountAliasInternalServerError describes a response with status code 500, with default header values.

internal server error
*/
type AccountAliasInternalServerError struct {
}

// IsSuccess returns true when this account alias internal server error response has a 2xx status code
func (o *AccountAliasInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this account alias internal server error response has a 3xx status code
func (o *AccountAliasInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this account alias internal server error response has a 4xx status code
func (o *AccountAliasInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this account alias internal server error response has a 5xx status code
func (o *AccountAliasInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this account alias internal server error response a status code equal to that given
func (o *AccountAliasInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the account alias internal server error response
func (o *AccountAliasInternalServerError) Code() int {
	return 500
}

func (o *AccountAliasInternalServerError) Error() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasInternalServerError", 500)
}

func (o *AccountAliasInternalServerError) String() string {
	return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasInternalServerError", 500)
}

func (o *AccountAliasInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}
