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

// RepoCancelScheduledAutoMergeReader is a Reader for the RepoCancelScheduledAutoMerge structure.
type RepoCancelScheduledAutoMergeReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoCancelScheduledAutoMergeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoCancelScheduledAutoMergeNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewRepoCancelScheduledAutoMergeForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRepoCancelScheduledAutoMergeNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 423:
		result := NewRepoCancelScheduledAutoMergeLocked()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /repos/{owner}/{repo}/pulls/{index}/merge] repoCancelScheduledAutoMerge", response, response.Code())
	}
}

// NewRepoCancelScheduledAutoMergeNoContent creates a RepoCancelScheduledAutoMergeNoContent with default headers values
func NewRepoCancelScheduledAutoMergeNoContent() *RepoCancelScheduledAutoMergeNoContent {
	return &RepoCancelScheduledAutoMergeNoContent{}
}

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

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

// IsSuccess returns true when this repo cancel scheduled auto merge no content response has a 2xx status code
func (o *RepoCancelScheduledAutoMergeNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this repo cancel scheduled auto merge no content response has a 3xx status code
func (o *RepoCancelScheduledAutoMergeNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo cancel scheduled auto merge no content response has a 4xx status code
func (o *RepoCancelScheduledAutoMergeNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this repo cancel scheduled auto merge no content response has a 5xx status code
func (o *RepoCancelScheduledAutoMergeNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this repo cancel scheduled auto merge no content response a status code equal to that given
func (o *RepoCancelScheduledAutoMergeNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the repo cancel scheduled auto merge no content response
func (o *RepoCancelScheduledAutoMergeNoContent) Code() int {
	return 204
}

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

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

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

	return nil
}

// NewRepoCancelScheduledAutoMergeForbidden creates a RepoCancelScheduledAutoMergeForbidden with default headers values
func NewRepoCancelScheduledAutoMergeForbidden() *RepoCancelScheduledAutoMergeForbidden {
	return &RepoCancelScheduledAutoMergeForbidden{}
}

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

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

// IsSuccess returns true when this repo cancel scheduled auto merge forbidden response has a 2xx status code
func (o *RepoCancelScheduledAutoMergeForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo cancel scheduled auto merge forbidden response has a 3xx status code
func (o *RepoCancelScheduledAutoMergeForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo cancel scheduled auto merge forbidden response has a 4xx status code
func (o *RepoCancelScheduledAutoMergeForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo cancel scheduled auto merge forbidden response has a 5xx status code
func (o *RepoCancelScheduledAutoMergeForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this repo cancel scheduled auto merge forbidden response a status code equal to that given
func (o *RepoCancelScheduledAutoMergeForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the repo cancel scheduled auto merge forbidden response
func (o *RepoCancelScheduledAutoMergeForbidden) Code() int {
	return 403
}

func (o *RepoCancelScheduledAutoMergeForbidden) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoCancelScheduledAutoMergeForbidden", 403)
}

func (o *RepoCancelScheduledAutoMergeForbidden) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoCancelScheduledAutoMergeForbidden", 403)
}

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

// NewRepoCancelScheduledAutoMergeNotFound creates a RepoCancelScheduledAutoMergeNotFound with default headers values
func NewRepoCancelScheduledAutoMergeNotFound() *RepoCancelScheduledAutoMergeNotFound {
	return &RepoCancelScheduledAutoMergeNotFound{}
}

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

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

// IsSuccess returns true when this repo cancel scheduled auto merge not found response has a 2xx status code
func (o *RepoCancelScheduledAutoMergeNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo cancel scheduled auto merge not found response has a 3xx status code
func (o *RepoCancelScheduledAutoMergeNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo cancel scheduled auto merge not found response has a 4xx status code
func (o *RepoCancelScheduledAutoMergeNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo cancel scheduled auto merge not found response has a 5xx status code
func (o *RepoCancelScheduledAutoMergeNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this repo cancel scheduled auto merge not found response a status code equal to that given
func (o *RepoCancelScheduledAutoMergeNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the repo cancel scheduled auto merge not found response
func (o *RepoCancelScheduledAutoMergeNotFound) Code() int {
	return 404
}

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

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

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

	return nil
}

// NewRepoCancelScheduledAutoMergeLocked creates a RepoCancelScheduledAutoMergeLocked with default headers values
func NewRepoCancelScheduledAutoMergeLocked() *RepoCancelScheduledAutoMergeLocked {
	return &RepoCancelScheduledAutoMergeLocked{}
}

/*
RepoCancelScheduledAutoMergeLocked 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 RepoCancelScheduledAutoMergeLocked struct {
	Message string
	URL     string
}

// IsSuccess returns true when this repo cancel scheduled auto merge locked response has a 2xx status code
func (o *RepoCancelScheduledAutoMergeLocked) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo cancel scheduled auto merge locked response has a 3xx status code
func (o *RepoCancelScheduledAutoMergeLocked) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo cancel scheduled auto merge locked response has a 4xx status code
func (o *RepoCancelScheduledAutoMergeLocked) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo cancel scheduled auto merge locked response has a 5xx status code
func (o *RepoCancelScheduledAutoMergeLocked) IsServerError() bool {
	return false
}

// IsCode returns true when this repo cancel scheduled auto merge locked response a status code equal to that given
func (o *RepoCancelScheduledAutoMergeLocked) IsCode(code int) bool {
	return code == 423
}

// Code gets the status code for the repo cancel scheduled auto merge locked response
func (o *RepoCancelScheduledAutoMergeLocked) Code() int {
	return 423
}

func (o *RepoCancelScheduledAutoMergeLocked) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoCancelScheduledAutoMergeLocked", 423)
}

func (o *RepoCancelScheduledAutoMergeLocked) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoCancelScheduledAutoMergeLocked", 423)
}

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