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

// RepoUpdatePullRequestReader is a Reader for the RepoUpdatePullRequest structure.
type RepoUpdatePullRequestReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoUpdatePullRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewRepoUpdatePullRequestOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewRepoUpdatePullRequestForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRepoUpdatePullRequestNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewRepoUpdatePullRequestConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewRepoUpdatePullRequestUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /repos/{owner}/{repo}/pulls/{index}/update] repoUpdatePullRequest", response, response.Code())
	}
}

// NewRepoUpdatePullRequestOK creates a RepoUpdatePullRequestOK with default headers values
func NewRepoUpdatePullRequestOK() *RepoUpdatePullRequestOK {
	return &RepoUpdatePullRequestOK{}
}

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

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

// IsSuccess returns true when this repo update pull request o k response has a 2xx status code
func (o *RepoUpdatePullRequestOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this repo update pull request o k response has a 3xx status code
func (o *RepoUpdatePullRequestOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo update pull request o k response has a 4xx status code
func (o *RepoUpdatePullRequestOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this repo update pull request o k response has a 5xx status code
func (o *RepoUpdatePullRequestOK) IsServerError() bool {
	return false
}

// IsCode returns true when this repo update pull request o k response a status code equal to that given
func (o *RepoUpdatePullRequestOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the repo update pull request o k response
func (o *RepoUpdatePullRequestOK) Code() int {
	return 200
}

func (o *RepoUpdatePullRequestOK) Error() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestOK", 200)
}

func (o *RepoUpdatePullRequestOK) String() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestOK", 200)
}

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

	return nil
}

// NewRepoUpdatePullRequestForbidden creates a RepoUpdatePullRequestForbidden with default headers values
func NewRepoUpdatePullRequestForbidden() *RepoUpdatePullRequestForbidden {
	return &RepoUpdatePullRequestForbidden{}
}

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

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

// IsSuccess returns true when this repo update pull request forbidden response has a 2xx status code
func (o *RepoUpdatePullRequestForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo update pull request forbidden response has a 3xx status code
func (o *RepoUpdatePullRequestForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo update pull request forbidden response has a 4xx status code
func (o *RepoUpdatePullRequestForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo update pull request forbidden response has a 5xx status code
func (o *RepoUpdatePullRequestForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this repo update pull request forbidden response a status code equal to that given
func (o *RepoUpdatePullRequestForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the repo update pull request forbidden response
func (o *RepoUpdatePullRequestForbidden) Code() int {
	return 403
}

func (o *RepoUpdatePullRequestForbidden) Error() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestForbidden", 403)
}

func (o *RepoUpdatePullRequestForbidden) String() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestForbidden", 403)
}

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

// NewRepoUpdatePullRequestNotFound creates a RepoUpdatePullRequestNotFound with default headers values
func NewRepoUpdatePullRequestNotFound() *RepoUpdatePullRequestNotFound {
	return &RepoUpdatePullRequestNotFound{}
}

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

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

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

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

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

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

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

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

func (o *RepoUpdatePullRequestNotFound) Error() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestNotFound", 404)
}

func (o *RepoUpdatePullRequestNotFound) String() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestNotFound", 404)
}

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

	return nil
}

// NewRepoUpdatePullRequestConflict creates a RepoUpdatePullRequestConflict with default headers values
func NewRepoUpdatePullRequestConflict() *RepoUpdatePullRequestConflict {
	return &RepoUpdatePullRequestConflict{}
}

/*
RepoUpdatePullRequestConflict describes a response with status code 409, with default header values.

APIError is error format response
*/
type RepoUpdatePullRequestConflict struct {
	Message string
	URL     string
}

// IsSuccess returns true when this repo update pull request conflict response has a 2xx status code
func (o *RepoUpdatePullRequestConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo update pull request conflict response has a 3xx status code
func (o *RepoUpdatePullRequestConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo update pull request conflict response has a 4xx status code
func (o *RepoUpdatePullRequestConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo update pull request conflict response has a 5xx status code
func (o *RepoUpdatePullRequestConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this repo update pull request conflict response a status code equal to that given
func (o *RepoUpdatePullRequestConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the repo update pull request conflict response
func (o *RepoUpdatePullRequestConflict) Code() int {
	return 409
}

func (o *RepoUpdatePullRequestConflict) Error() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestConflict", 409)
}

func (o *RepoUpdatePullRequestConflict) String() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestConflict", 409)
}

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

// NewRepoUpdatePullRequestUnprocessableEntity creates a RepoUpdatePullRequestUnprocessableEntity with default headers values
func NewRepoUpdatePullRequestUnprocessableEntity() *RepoUpdatePullRequestUnprocessableEntity {
	return &RepoUpdatePullRequestUnprocessableEntity{}
}

/*
RepoUpdatePullRequestUnprocessableEntity describes a response with status code 422, with default header values.

APIValidationError is error format response related to input validation
*/
type RepoUpdatePullRequestUnprocessableEntity struct {
	Message string
	URL     string
}

// IsSuccess returns true when this repo update pull request unprocessable entity response has a 2xx status code
func (o *RepoUpdatePullRequestUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo update pull request unprocessable entity response has a 3xx status code
func (o *RepoUpdatePullRequestUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo update pull request unprocessable entity response has a 4xx status code
func (o *RepoUpdatePullRequestUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo update pull request unprocessable entity response has a 5xx status code
func (o *RepoUpdatePullRequestUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this repo update pull request unprocessable entity response a status code equal to that given
func (o *RepoUpdatePullRequestUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the repo update pull request unprocessable entity response
func (o *RepoUpdatePullRequestUnprocessableEntity) Code() int {
	return 422
}

func (o *RepoUpdatePullRequestUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestUnprocessableEntity", 422)
}

func (o *RepoUpdatePullRequestUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/update][%d] repoUpdatePullRequestUnprocessableEntity", 422)
}

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