// Code generated by go-swagger; DO NOT EDIT.

package account_management

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/credit-system/models"
)

// CreateAccountReader is a Reader for the CreateAccount structure.
type CreateAccountReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CreateAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewCreateAccountCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 409:
		result := NewCreateAccountConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewCreateAccountInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewCreateAccountCreated creates a CreateAccountCreated with default headers values
func NewCreateAccountCreated() *CreateAccountCreated {
	return &CreateAccountCreated{}
}

/*CreateAccountCreated handles this case with default header values.

Account created, provided information of the new item created
*/
type CreateAccountCreated struct {
	Payload *models.AccountStatus
}

func (o *CreateAccountCreated) Error() string {
	return fmt.Sprintf("[GET /account/create/{id}][%d] createAccountCreated  %+v", 201, o.Payload)
}

func (o *CreateAccountCreated) GetPayload() *models.AccountStatus {
	return o.Payload
}

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

	o.Payload = new(models.AccountStatus)

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

	return nil
}

// NewCreateAccountConflict creates a CreateAccountConflict with default headers values
func NewCreateAccountConflict() *CreateAccountConflict {
	return &CreateAccountConflict{}
}

/*CreateAccountConflict handles this case with default header values.

The account with the id provided already exist
*/
type CreateAccountConflict struct {
	Payload *models.ErrorResponse
}

func (o *CreateAccountConflict) Error() string {
	return fmt.Sprintf("[GET /account/create/{id}][%d] createAccountConflict  %+v", 409, o.Payload)
}

func (o *CreateAccountConflict) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}

// NewCreateAccountInternalServerError creates a CreateAccountInternalServerError with default headers values
func NewCreateAccountInternalServerError() *CreateAccountInternalServerError {
	return &CreateAccountInternalServerError{}
}

/*CreateAccountInternalServerError handles this case with default header values.

Something unexpected happend, error raised
*/
type CreateAccountInternalServerError struct {
	Payload *models.ErrorResponse
}

func (o *CreateAccountInternalServerError) Error() string {
	return fmt.Sprintf("[GET /account/create/{id}][%d] createAccountInternalServerError  %+v", 500, o.Payload)
}

func (o *CreateAccountInternalServerError) GetPayload() *models.ErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ErrorResponse)

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

	return nil
}
