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

package assets

// 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/030/n3dr/internal/app/n3dr/goswagger/models"
)

// GetAssetsReader is a Reader for the GetAssets structure.
type GetAssetsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetAssetsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewGetAssetsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetAssetsUnprocessableEntity()
		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())
	}
}

// NewGetAssetsOK creates a GetAssetsOK with default headers values
func NewGetAssetsOK() *GetAssetsOK {
	return &GetAssetsOK{}
}

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

successful operation
*/
type GetAssetsOK struct {
	Payload *models.PageAssetXO
}

// IsSuccess returns true when this get assets o k response has a 2xx status code
func (o *GetAssetsOK) IsSuccess() bool {
	return true
}

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

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

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

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

// Code gets the status code for the get assets o k response
func (o *GetAssetsOK) Code() int {
	return 200
}

func (o *GetAssetsOK) Error() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsOK  %+v", 200, o.Payload)
}

func (o *GetAssetsOK) String() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsOK  %+v", 200, o.Payload)
}

func (o *GetAssetsOK) GetPayload() *models.PageAssetXO {
	return o.Payload
}

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

	o.Payload = new(models.PageAssetXO)

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

	return nil
}

// NewGetAssetsForbidden creates a GetAssetsForbidden with default headers values
func NewGetAssetsForbidden() *GetAssetsForbidden {
	return &GetAssetsForbidden{}
}

/*
GetAssetsForbidden describes a response with status code 403, with default header values.

Insufficient permissions to list assets
*/
type GetAssetsForbidden struct {
}

// IsSuccess returns true when this get assets forbidden response has a 2xx status code
func (o *GetAssetsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get assets forbidden response has a 3xx status code
func (o *GetAssetsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get assets forbidden response has a 4xx status code
func (o *GetAssetsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get assets forbidden response has a 5xx status code
func (o *GetAssetsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get assets forbidden response a status code equal to that given
func (o *GetAssetsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get assets forbidden response
func (o *GetAssetsForbidden) Code() int {
	return 403
}

func (o *GetAssetsForbidden) Error() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsForbidden ", 403)
}

func (o *GetAssetsForbidden) String() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsForbidden ", 403)
}

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

	return nil
}

// NewGetAssetsUnprocessableEntity creates a GetAssetsUnprocessableEntity with default headers values
func NewGetAssetsUnprocessableEntity() *GetAssetsUnprocessableEntity {
	return &GetAssetsUnprocessableEntity{}
}

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

Parameter 'repository' is required
*/
type GetAssetsUnprocessableEntity struct {
}

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

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

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

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

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

// Code gets the status code for the get assets unprocessable entity response
func (o *GetAssetsUnprocessableEntity) Code() int {
	return 422
}

func (o *GetAssetsUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsUnprocessableEntity ", 422)
}

func (o *GetAssetsUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /v1/assets][%d] getAssetsUnprocessableEntity ", 422)
}

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

	return nil
}
