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

package arrays

// 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.dev.purestorage.com/FlashArray/terraform-provider-cbs/cbs/internal/array/faclient/2.4/models"
)

// GetAPI24ArraysPerformanceReader is a Reader for the GetAPI24ArraysPerformance structure.
type GetAPI24ArraysPerformanceReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAPI24ArraysPerformanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetApi24ArraysPerformanceOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetApi24ArraysPerformanceBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewGetApi24ArraysPerformanceOK creates a GetApi24ArraysPerformanceOK with default headers values
func NewGetApi24ArraysPerformanceOK() *GetApi24ArraysPerformanceOK {
	return &GetApi24ArraysPerformanceOK{}
}

/*GetApi24ArraysPerformanceOK handles this case with default header values.

OK
*/
type GetApi24ArraysPerformanceOK struct {
	Payload *models.ArrayPerformanceGetResponse
}

func (o *GetApi24ArraysPerformanceOK) Error() string {
	return fmt.Sprintf("[GET /api/2.4/arrays/performance][%d] getApi24ArraysPerformanceOK  %+v", 200, o.Payload)
}

func (o *GetApi24ArraysPerformanceOK) GetPayload() *models.ArrayPerformanceGetResponse {
	return o.Payload
}

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

	o.Payload = new(models.ArrayPerformanceGetResponse)

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

	return nil
}

// NewGetApi24ArraysPerformanceBadRequest creates a GetApi24ArraysPerformanceBadRequest with default headers values
func NewGetApi24ArraysPerformanceBadRequest() *GetApi24ArraysPerformanceBadRequest {
	return &GetApi24ArraysPerformanceBadRequest{}
}

/*GetApi24ArraysPerformanceBadRequest handles this case with default header values.

BadRequest
*/
type GetApi24ArraysPerformanceBadRequest struct {
	Payload *models.Error
}

func (o *GetApi24ArraysPerformanceBadRequest) Error() string {
	return fmt.Sprintf("[GET /api/2.4/arrays/performance][%d] getApi24ArraysPerformanceBadRequest  %+v", 400, o.Payload)
}

func (o *GetApi24ArraysPerformanceBadRequest) GetPayload() *models.Error {
	return o.Payload
}

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

	o.Payload = new(models.Error)

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

	return nil
}
