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

// RepoDeleteCollaboratorReader is a Reader for the RepoDeleteCollaborator structure.
type RepoDeleteCollaboratorReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoDeleteCollaboratorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoDeleteCollaboratorNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewRepoDeleteCollaboratorNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewRepoDeleteCollaboratorUnprocessableEntity()
		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}/collaborators/{collaborator}] repoDeleteCollaborator", response, response.Code())
	}
}

// NewRepoDeleteCollaboratorNoContent creates a RepoDeleteCollaboratorNoContent with default headers values
func NewRepoDeleteCollaboratorNoContent() *RepoDeleteCollaboratorNoContent {
	return &RepoDeleteCollaboratorNoContent{}
}

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

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

// IsSuccess returns true when this repo delete collaborator no content response has a 2xx status code
func (o *RepoDeleteCollaboratorNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this repo delete collaborator no content response has a 3xx status code
func (o *RepoDeleteCollaboratorNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo delete collaborator no content response has a 4xx status code
func (o *RepoDeleteCollaboratorNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this repo delete collaborator no content response has a 5xx status code
func (o *RepoDeleteCollaboratorNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this repo delete collaborator no content response a status code equal to that given
func (o *RepoDeleteCollaboratorNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the repo delete collaborator no content response
func (o *RepoDeleteCollaboratorNoContent) Code() int {
	return 204
}

func (o *RepoDeleteCollaboratorNoContent) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorNoContent", 204)
}

func (o *RepoDeleteCollaboratorNoContent) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorNoContent", 204)
}

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

	return nil
}

// NewRepoDeleteCollaboratorNotFound creates a RepoDeleteCollaboratorNotFound with default headers values
func NewRepoDeleteCollaboratorNotFound() *RepoDeleteCollaboratorNotFound {
	return &RepoDeleteCollaboratorNotFound{}
}

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

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

// IsSuccess returns true when this repo delete collaborator not found response has a 2xx status code
func (o *RepoDeleteCollaboratorNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo delete collaborator not found response has a 3xx status code
func (o *RepoDeleteCollaboratorNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo delete collaborator not found response has a 4xx status code
func (o *RepoDeleteCollaboratorNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo delete collaborator not found response has a 5xx status code
func (o *RepoDeleteCollaboratorNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the repo delete collaborator not found response
func (o *RepoDeleteCollaboratorNotFound) Code() int {
	return 404
}

func (o *RepoDeleteCollaboratorNotFound) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorNotFound", 404)
}

func (o *RepoDeleteCollaboratorNotFound) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorNotFound", 404)
}

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

	return nil
}

// NewRepoDeleteCollaboratorUnprocessableEntity creates a RepoDeleteCollaboratorUnprocessableEntity with default headers values
func NewRepoDeleteCollaboratorUnprocessableEntity() *RepoDeleteCollaboratorUnprocessableEntity {
	return &RepoDeleteCollaboratorUnprocessableEntity{}
}

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

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

// IsSuccess returns true when this repo delete collaborator unprocessable entity response has a 2xx status code
func (o *RepoDeleteCollaboratorUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo delete collaborator unprocessable entity response has a 3xx status code
func (o *RepoDeleteCollaboratorUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo delete collaborator unprocessable entity response has a 4xx status code
func (o *RepoDeleteCollaboratorUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo delete collaborator unprocessable entity response has a 5xx status code
func (o *RepoDeleteCollaboratorUnprocessableEntity) IsServerError() bool {
	return false
}

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

// Code gets the status code for the repo delete collaborator unprocessable entity response
func (o *RepoDeleteCollaboratorUnprocessableEntity) Code() int {
	return 422
}

func (o *RepoDeleteCollaboratorUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorUnprocessableEntity", 422)
}

func (o *RepoDeleteCollaboratorUnprocessableEntity) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/collaborators/{collaborator}][%d] repoDeleteCollaboratorUnprocessableEntity", 422)
}

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