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

package issue

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

import (
	"encoding/json"
	"fmt"
	"io"

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

	"src.opensuse.org/autogits/common/gitea-generated/models"
)

// IssueEditCommentReader is a Reader for the IssueEditComment structure.
type IssueEditCommentReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *IssueEditCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewIssueEditCommentOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewIssueEditCommentNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewIssueEditCommentForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewIssueEditCommentNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 423:
		result := NewIssueEditCommentLocked()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PATCH /repos/{owner}/{repo}/issues/comments/{id}] issueEditComment", response, response.Code())
	}
}

// NewIssueEditCommentOK creates a IssueEditCommentOK with default headers values
func NewIssueEditCommentOK() *IssueEditCommentOK {
	return &IssueEditCommentOK{}
}

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

Comment
*/
type IssueEditCommentOK struct {
	Payload *models.Comment
}

// IsSuccess returns true when this issue edit comment o k response has a 2xx status code
func (o *IssueEditCommentOK) IsSuccess() bool {
	return true
}

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

// IsClientError returns true when this issue edit comment o k response has a 4xx status code
func (o *IssueEditCommentOK) IsClientError() bool {
	return false
}

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

// IsCode returns true when this issue edit comment o k response a status code equal to that given
func (o *IssueEditCommentOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the issue edit comment o k response
func (o *IssueEditCommentOK) Code() int {
	return 200
}

func (o *IssueEditCommentOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentOK %s", 200, payload)
}

func (o *IssueEditCommentOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentOK %s", 200, payload)
}

func (o *IssueEditCommentOK) GetPayload() *models.Comment {
	return o.Payload
}

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

	o.Payload = new(models.Comment)

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

	return nil
}

// NewIssueEditCommentNoContent creates a IssueEditCommentNoContent with default headers values
func NewIssueEditCommentNoContent() *IssueEditCommentNoContent {
	return &IssueEditCommentNoContent{}
}

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

APIEmpty is an empty response
*/
type IssueEditCommentNoContent struct {
}

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

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

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

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

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

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

func (o *IssueEditCommentNoContent) Error() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentNoContent", 204)
}

func (o *IssueEditCommentNoContent) String() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentNoContent", 204)
}

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

	return nil
}

// NewIssueEditCommentForbidden creates a IssueEditCommentForbidden with default headers values
func NewIssueEditCommentForbidden() *IssueEditCommentForbidden {
	return &IssueEditCommentForbidden{}
}

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

APIForbiddenError is a forbidden error response
*/
type IssueEditCommentForbidden struct {
	Message string
	URL     string
}

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

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

// IsClientError returns true when this issue edit comment forbidden response has a 4xx status code
func (o *IssueEditCommentForbidden) IsClientError() bool {
	return true
}

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

// IsCode returns true when this issue edit comment forbidden response a status code equal to that given
func (o *IssueEditCommentForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the issue edit comment forbidden response
func (o *IssueEditCommentForbidden) Code() int {
	return 403
}

func (o *IssueEditCommentForbidden) Error() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentForbidden", 403)
}

func (o *IssueEditCommentForbidden) String() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentForbidden", 403)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}

// NewIssueEditCommentNotFound creates a IssueEditCommentNotFound with default headers values
func NewIssueEditCommentNotFound() *IssueEditCommentNotFound {
	return &IssueEditCommentNotFound{}
}

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

APINotFound is a not found empty response
*/
type IssueEditCommentNotFound struct {
}

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

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

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

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

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

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

func (o *IssueEditCommentNotFound) Error() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentNotFound", 404)
}

func (o *IssueEditCommentNotFound) String() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentNotFound", 404)
}

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

	return nil
}

// NewIssueEditCommentLocked creates a IssueEditCommentLocked with default headers values
func NewIssueEditCommentLocked() *IssueEditCommentLocked {
	return &IssueEditCommentLocked{}
}

/*
IssueEditCommentLocked describes a response with status code 423, with default header values.

APIRepoArchivedError is an error that is raised when an archived repo should be modified
*/
type IssueEditCommentLocked struct {
	Message string
	URL     string
}

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

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

// IsClientError returns true when this issue edit comment locked response has a 4xx status code
func (o *IssueEditCommentLocked) IsClientError() bool {
	return true
}

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

// IsCode returns true when this issue edit comment locked response a status code equal to that given
func (o *IssueEditCommentLocked) IsCode(code int) bool {
	return code == 423
}

// Code gets the status code for the issue edit comment locked response
func (o *IssueEditCommentLocked) Code() int {
	return 423
}

func (o *IssueEditCommentLocked) Error() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentLocked", 423)
}

func (o *IssueEditCommentLocked) String() string {
	return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/issues/comments/{id}][%d] issueEditCommentLocked", 423)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}
