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

package admin

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

// AdminAdoptRepositoryReader is a Reader for the AdminAdoptRepository structure.
type AdminAdoptRepositoryReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminAdoptRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewAdminAdoptRepositoryNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewAdminAdoptRepositoryForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewAdminAdoptRepositoryNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /admin/unadopted/{owner}/{repo}] adminAdoptRepository", response, response.Code())
	}
}

// NewAdminAdoptRepositoryNoContent creates a AdminAdoptRepositoryNoContent with default headers values
func NewAdminAdoptRepositoryNoContent() *AdminAdoptRepositoryNoContent {
	return &AdminAdoptRepositoryNoContent{}
}

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

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

// IsSuccess returns true when this admin adopt repository no content response has a 2xx status code
func (o *AdminAdoptRepositoryNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin adopt repository no content response has a 3xx status code
func (o *AdminAdoptRepositoryNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin adopt repository no content response has a 4xx status code
func (o *AdminAdoptRepositoryNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin adopt repository no content response has a 5xx status code
func (o *AdminAdoptRepositoryNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this admin adopt repository no content response a status code equal to that given
func (o *AdminAdoptRepositoryNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the admin adopt repository no content response
func (o *AdminAdoptRepositoryNoContent) Code() int {
	return 204
}

func (o *AdminAdoptRepositoryNoContent) Error() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryNoContent", 204)
}

func (o *AdminAdoptRepositoryNoContent) String() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryNoContent", 204)
}

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

	return nil
}

// NewAdminAdoptRepositoryForbidden creates a AdminAdoptRepositoryForbidden with default headers values
func NewAdminAdoptRepositoryForbidden() *AdminAdoptRepositoryForbidden {
	return &AdminAdoptRepositoryForbidden{}
}

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

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

// IsSuccess returns true when this admin adopt repository forbidden response has a 2xx status code
func (o *AdminAdoptRepositoryForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin adopt repository forbidden response has a 3xx status code
func (o *AdminAdoptRepositoryForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin adopt repository forbidden response has a 4xx status code
func (o *AdminAdoptRepositoryForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin adopt repository forbidden response has a 5xx status code
func (o *AdminAdoptRepositoryForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this admin adopt repository forbidden response a status code equal to that given
func (o *AdminAdoptRepositoryForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the admin adopt repository forbidden response
func (o *AdminAdoptRepositoryForbidden) Code() int {
	return 403
}

func (o *AdminAdoptRepositoryForbidden) Error() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryForbidden", 403)
}

func (o *AdminAdoptRepositoryForbidden) String() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryForbidden", 403)
}

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

// NewAdminAdoptRepositoryNotFound creates a AdminAdoptRepositoryNotFound with default headers values
func NewAdminAdoptRepositoryNotFound() *AdminAdoptRepositoryNotFound {
	return &AdminAdoptRepositoryNotFound{}
}

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

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

// IsSuccess returns true when this admin adopt repository not found response has a 2xx status code
func (o *AdminAdoptRepositoryNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this admin adopt repository not found response has a 3xx status code
func (o *AdminAdoptRepositoryNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin adopt repository not found response has a 4xx status code
func (o *AdminAdoptRepositoryNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this admin adopt repository not found response has a 5xx status code
func (o *AdminAdoptRepositoryNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this admin adopt repository not found response a status code equal to that given
func (o *AdminAdoptRepositoryNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the admin adopt repository not found response
func (o *AdminAdoptRepositoryNotFound) Code() int {
	return 404
}

func (o *AdminAdoptRepositoryNotFound) Error() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryNotFound", 404)
}

func (o *AdminAdoptRepositoryNotFound) String() string {
	return fmt.Sprintf("[POST /admin/unadopted/{owner}/{repo}][%d] adminAdoptRepositoryNotFound", 404)
}

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

	return nil
}
