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

package repository

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

// RepoPullRequestIsMergedReader is a Reader for the RepoPullRequestIsMerged structure.
type RepoPullRequestIsMergedReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoPullRequestIsMergedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoPullRequestIsMergedNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewRepoPullRequestIsMergedNotFound()
		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}/pulls/{index}/merge] repoPullRequestIsMerged", response, response.Code())
	}
}

// NewRepoPullRequestIsMergedNoContent creates a RepoPullRequestIsMergedNoContent with default headers values
func NewRepoPullRequestIsMergedNoContent() *RepoPullRequestIsMergedNoContent {
	return &RepoPullRequestIsMergedNoContent{}
}

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

pull request has been merged
*/
type RepoPullRequestIsMergedNoContent struct {
}

// IsSuccess returns true when this repo pull request is merged no content response has a 2xx status code
func (o *RepoPullRequestIsMergedNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this repo pull request is merged no content response has a 3xx status code
func (o *RepoPullRequestIsMergedNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo pull request is merged no content response has a 4xx status code
func (o *RepoPullRequestIsMergedNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this repo pull request is merged no content response has a 5xx status code
func (o *RepoPullRequestIsMergedNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this repo pull request is merged no content response a status code equal to that given
func (o *RepoPullRequestIsMergedNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the repo pull request is merged no content response
func (o *RepoPullRequestIsMergedNoContent) Code() int {
	return 204
}

func (o *RepoPullRequestIsMergedNoContent) Error() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoPullRequestIsMergedNoContent", 204)
}

func (o *RepoPullRequestIsMergedNoContent) String() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoPullRequestIsMergedNoContent", 204)
}

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

	return nil
}

// NewRepoPullRequestIsMergedNotFound creates a RepoPullRequestIsMergedNotFound with default headers values
func NewRepoPullRequestIsMergedNotFound() *RepoPullRequestIsMergedNotFound {
	return &RepoPullRequestIsMergedNotFound{}
}

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

pull request has not been merged
*/
type RepoPullRequestIsMergedNotFound struct {
}

// IsSuccess returns true when this repo pull request is merged not found response has a 2xx status code
func (o *RepoPullRequestIsMergedNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo pull request is merged not found response has a 3xx status code
func (o *RepoPullRequestIsMergedNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo pull request is merged not found response has a 4xx status code
func (o *RepoPullRequestIsMergedNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo pull request is merged not found response has a 5xx status code
func (o *RepoPullRequestIsMergedNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this repo pull request is merged not found response a status code equal to that given
func (o *RepoPullRequestIsMergedNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the repo pull request is merged not found response
func (o *RepoPullRequestIsMergedNotFound) Code() int {
	return 404
}

func (o *RepoPullRequestIsMergedNotFound) Error() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoPullRequestIsMergedNotFound", 404)
}

func (o *RepoPullRequestIsMergedNotFound) String() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoPullRequestIsMergedNotFound", 404)
}

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

	return nil
}
