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

package script

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

import (
	"fmt"

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

// EditReader is a Reader for the Edit structure.
type EditReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *EditReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewEditNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewEditNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 410:
		result := NewEditGone()
		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())
	}
}

// NewEditNoContent creates a EditNoContent with default headers values
func NewEditNoContent() *EditNoContent {
	return &EditNoContent{}
}

/*
EditNoContent describes a response with status code 204, with default header values.

Script was updated
*/
type EditNoContent struct {
}

// IsSuccess returns true when this edit no content response has a 2xx status code
func (o *EditNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this edit no content response has a 3xx status code
func (o *EditNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this edit no content response has a 4xx status code
func (o *EditNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this edit no content response has a 5xx status code
func (o *EditNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this edit no content response a status code equal to that given
func (o *EditNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the edit no content response
func (o *EditNoContent) Code() int {
	return 204
}

func (o *EditNoContent) Error() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editNoContent ", 204)
}

func (o *EditNoContent) String() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editNoContent ", 204)
}

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

	return nil
}

// NewEditNotFound creates a EditNotFound with default headers values
func NewEditNotFound() *EditNotFound {
	return &EditNotFound{}
}

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

No script with the specified name
*/
type EditNotFound struct {
}

// IsSuccess returns true when this edit not found response has a 2xx status code
func (o *EditNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this edit not found response has a 3xx status code
func (o *EditNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this edit not found response has a 4xx status code
func (o *EditNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this edit not found response has a 5xx status code
func (o *EditNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the edit not found response
func (o *EditNotFound) Code() int {
	return 404
}

func (o *EditNotFound) Error() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editNotFound ", 404)
}

func (o *EditNotFound) String() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editNotFound ", 404)
}

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

	return nil
}

// NewEditGone creates a EditGone with default headers values
func NewEditGone() *EditGone {
	return &EditGone{}
}

/*
EditGone describes a response with status code 410, with default header values.

Script updating is disabled
*/
type EditGone struct {
}

// IsSuccess returns true when this edit gone response has a 2xx status code
func (o *EditGone) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this edit gone response has a 3xx status code
func (o *EditGone) IsRedirect() bool {
	return false
}

// IsClientError returns true when this edit gone response has a 4xx status code
func (o *EditGone) IsClientError() bool {
	return true
}

// IsServerError returns true when this edit gone response has a 5xx status code
func (o *EditGone) IsServerError() bool {
	return false
}

// IsCode returns true when this edit gone response a status code equal to that given
func (o *EditGone) IsCode(code int) bool {
	return code == 410
}

// Code gets the status code for the edit gone response
func (o *EditGone) Code() int {
	return 410
}

func (o *EditGone) Error() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editGone ", 410)
}

func (o *EditGone) String() string {
	return fmt.Sprintf("[PUT /v1/script/{name}][%d] editGone ", 410)
}

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

	return nil
}
