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

// IssueGetCommentReader is a Reader for the IssueGetComment structure.
type IssueGetCommentReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *IssueGetCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewIssueGetCommentOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewIssueGetCommentNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewIssueGetCommentForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewIssueGetCommentNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/issues/comments/{id}] issueGetComment", response, response.Code())
	}
}

// NewIssueGetCommentOK creates a IssueGetCommentOK with default headers values
func NewIssueGetCommentOK() *IssueGetCommentOK {
	return &IssueGetCommentOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewIssueGetCommentNoContent creates a IssueGetCommentNoContent with default headers values
func NewIssueGetCommentNoContent() *IssueGetCommentNoContent {
	return &IssueGetCommentNoContent{}
}

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

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

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

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

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

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

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

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

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

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

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

	return nil
}

// NewIssueGetCommentForbidden creates a IssueGetCommentForbidden with default headers values
func NewIssueGetCommentForbidden() *IssueGetCommentForbidden {
	return &IssueGetCommentForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewIssueGetCommentNotFound creates a IssueGetCommentNotFound with default headers values
func NewIssueGetCommentNotFound() *IssueGetCommentNotFound {
	return &IssueGetCommentNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

	return nil
}