// 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 (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// AdminUnadoptedListReader is a Reader for the AdminUnadoptedList structure.
type AdminUnadoptedListReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminUnadoptedListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAdminUnadoptedListOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewAdminUnadoptedListForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /admin/unadopted] adminUnadoptedList", response, response.Code())
	}
}

// NewAdminUnadoptedListOK creates a AdminUnadoptedListOK with default headers values
func NewAdminUnadoptedListOK() *AdminUnadoptedListOK {
	return &AdminUnadoptedListOK{}
}

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

StringSlice
*/
type AdminUnadoptedListOK struct {
	Payload []string
}

// IsSuccess returns true when this admin unadopted list o k response has a 2xx status code
func (o *AdminUnadoptedListOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin unadopted list o k response has a 3xx status code
func (o *AdminUnadoptedListOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin unadopted list o k response has a 4xx status code
func (o *AdminUnadoptedListOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin unadopted list o k response has a 5xx status code
func (o *AdminUnadoptedListOK) IsServerError() bool {
	return false
}

// IsCode returns true when this admin unadopted list o k response a status code equal to that given
func (o *AdminUnadoptedListOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the admin unadopted list o k response
func (o *AdminUnadoptedListOK) Code() int {
	return 200
}

func (o *AdminUnadoptedListOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /admin/unadopted][%d] adminUnadoptedListOK %s", 200, payload)
}

func (o *AdminUnadoptedListOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /admin/unadopted][%d] adminUnadoptedListOK %s", 200, payload)
}

func (o *AdminUnadoptedListOK) GetPayload() []string {
	return o.Payload
}

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

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewAdminUnadoptedListForbidden creates a AdminUnadoptedListForbidden with default headers values
func NewAdminUnadoptedListForbidden() *AdminUnadoptedListForbidden {
	return &AdminUnadoptedListForbidden{}
}

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

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

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

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

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

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

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

// Code gets the status code for the admin unadopted list forbidden response
func (o *AdminUnadoptedListForbidden) Code() int {
	return 403
}

func (o *AdminUnadoptedListForbidden) Error() string {
	return fmt.Sprintf("[GET /admin/unadopted][%d] adminUnadoptedListForbidden", 403)
}

func (o *AdminUnadoptedListForbidden) String() string {
	return fmt.Sprintf("[GET /admin/unadopted][%d] adminUnadoptedListForbidden", 403)
}

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