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

package installer

// 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/openshift/assisted-service/models"
)

// V2GetIgnoredValidationsReader is a Reader for the V2GetIgnoredValidations structure.
type V2GetIgnoredValidationsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *V2GetIgnoredValidationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewV2GetIgnoredValidationsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewV2GetIgnoredValidationsBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewV2GetIgnoredValidationsNotFound()
		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())
	}
}

// NewV2GetIgnoredValidationsOK creates a V2GetIgnoredValidationsOK with default headers values
func NewV2GetIgnoredValidationsOK() *V2GetIgnoredValidationsOK {
	return &V2GetIgnoredValidationsOK{}
}

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

Success.
*/
type V2GetIgnoredValidationsOK struct {
	Payload *models.IgnoredValidations
}

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

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

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

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

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

func (o *V2GetIgnoredValidationsOK) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsOK  %+v", 200, o.Payload)
}

func (o *V2GetIgnoredValidationsOK) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsOK  %+v", 200, o.Payload)
}

func (o *V2GetIgnoredValidationsOK) GetPayload() *models.IgnoredValidations {
	return o.Payload
}

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

	o.Payload = new(models.IgnoredValidations)

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

	return nil
}

// NewV2GetIgnoredValidationsBadRequest creates a V2GetIgnoredValidationsBadRequest with default headers values
func NewV2GetIgnoredValidationsBadRequest() *V2GetIgnoredValidationsBadRequest {
	return &V2GetIgnoredValidationsBadRequest{}
}

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

Error.
*/
type V2GetIgnoredValidationsBadRequest struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 get ignored validations bad request response has a 2xx status code
func (o *V2GetIgnoredValidationsBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 get ignored validations bad request response has a 3xx status code
func (o *V2GetIgnoredValidationsBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get ignored validations bad request response has a 4xx status code
func (o *V2GetIgnoredValidationsBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 get ignored validations bad request response has a 5xx status code
func (o *V2GetIgnoredValidationsBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 get ignored validations bad request response a status code equal to that given
func (o *V2GetIgnoredValidationsBadRequest) IsCode(code int) bool {
	return code == 400
}

func (o *V2GetIgnoredValidationsBadRequest) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsBadRequest  %+v", 400, o.Payload)
}

func (o *V2GetIgnoredValidationsBadRequest) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsBadRequest  %+v", 400, o.Payload)
}

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

func (o *V2GetIgnoredValidationsBadRequest) 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
}

// NewV2GetIgnoredValidationsNotFound creates a V2GetIgnoredValidationsNotFound with default headers values
func NewV2GetIgnoredValidationsNotFound() *V2GetIgnoredValidationsNotFound {
	return &V2GetIgnoredValidationsNotFound{}
}

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

Error.
*/
type V2GetIgnoredValidationsNotFound struct {
	Payload *models.Error
}

// IsSuccess returns true when this v2 get ignored validations not found response has a 2xx status code
func (o *V2GetIgnoredValidationsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this v2 get ignored validations not found response has a 3xx status code
func (o *V2GetIgnoredValidationsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this v2 get ignored validations not found response has a 4xx status code
func (o *V2GetIgnoredValidationsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this v2 get ignored validations not found response has a 5xx status code
func (o *V2GetIgnoredValidationsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this v2 get ignored validations not found response a status code equal to that given
func (o *V2GetIgnoredValidationsNotFound) IsCode(code int) bool {
	return code == 404
}

func (o *V2GetIgnoredValidationsNotFound) Error() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsNotFound  %+v", 404, o.Payload)
}

func (o *V2GetIgnoredValidationsNotFound) String() string {
	return fmt.Sprintf("[GET /v2/clusters/{cluster_id}/ignored-validations][%d] v2GetIgnoredValidationsNotFound  %+v", 404, o.Payload)
}

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

func (o *V2GetIgnoredValidationsNotFound) 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
}
