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

package package_appr

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

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

	models "github.com/operator-framework/go-appr/models"
)

// ShowPackageManifestsReader is a Reader for the ShowPackageManifests structure.
type ShowPackageManifestsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ShowPackageManifestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {

	case 200:
		result := NewShowPackageManifestsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil

	case 401:
		result := NewShowPackageManifestsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	case 404:
		result := NewShowPackageManifestsNotFound()
		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())
	}
}

// NewShowPackageManifestsOK creates a ShowPackageManifestsOK with default headers values
func NewShowPackageManifestsOK() *ShowPackageManifestsOK {
	return &ShowPackageManifestsOK{}
}

/*ShowPackageManifestsOK handles this case with default header values.

successful operation
*/
type ShowPackageManifestsOK struct {
	Payload models.PackageManifest
}

func (o *ShowPackageManifestsOK) Error() string {
	return fmt.Sprintf("[GET /api/v1/packages/{namespace}/{package}/{release}][%d] showPackageManifestsOK  %+v", 200, o.Payload)
}

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

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

	return nil
}

// NewShowPackageManifestsUnauthorized creates a ShowPackageManifestsUnauthorized with default headers values
func NewShowPackageManifestsUnauthorized() *ShowPackageManifestsUnauthorized {
	return &ShowPackageManifestsUnauthorized{}
}

/*ShowPackageManifestsUnauthorized handles this case with default header values.

Not authorized to read the package
*/
type ShowPackageManifestsUnauthorized struct {
	Payload *models.Error
}

func (o *ShowPackageManifestsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /api/v1/packages/{namespace}/{package}/{release}][%d] showPackageManifestsUnauthorized  %+v", 401, o.Payload)
}

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

// NewShowPackageManifestsNotFound creates a ShowPackageManifestsNotFound with default headers values
func NewShowPackageManifestsNotFound() *ShowPackageManifestsNotFound {
	return &ShowPackageManifestsNotFound{}
}

/*ShowPackageManifestsNotFound handles this case with default header values.

Package not found
*/
type ShowPackageManifestsNotFound struct {
	Payload *models.Error
}

func (o *ShowPackageManifestsNotFound) Error() string {
	return fmt.Sprintf("[GET /api/v1/packages/{namespace}/{package}/{release}][%d] showPackageManifestsNotFound  %+v", 404, o.Payload)
}

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