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

	"git.coopcloud.tech/decentral1se/gtslib/models"
)

// HeaderFilterAllowsGetReader is a Reader for the HeaderFilterAllowsGet structure.
type HeaderFilterAllowsGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *HeaderFilterAllowsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewHeaderFilterAllowsGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewHeaderFilterAllowsGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewHeaderFilterAllowsGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewHeaderFilterAllowsGetForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewHeaderFilterAllowsGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewHeaderFilterAllowsGetInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/v1/admin/header_allows] headerFilterAllowsGet", response, response.Code())
	}
}

// NewHeaderFilterAllowsGetOK creates a HeaderFilterAllowsGetOK with default headers values
func NewHeaderFilterAllowsGetOK() *HeaderFilterAllowsGetOK {
	return &HeaderFilterAllowsGetOK{}
}

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

All "allow" header filters currently in place.
*/
type HeaderFilterAllowsGetOK struct {
	Payload []*models.HeaderFilter
}

// IsSuccess returns true when this header filter allows get o k response has a 2xx status code
func (o *HeaderFilterAllowsGetOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this header filter allows get o k response has a 3xx status code
func (o *HeaderFilterAllowsGetOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get o k response has a 4xx status code
func (o *HeaderFilterAllowsGetOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this header filter allows get o k response has a 5xx status code
func (o *HeaderFilterAllowsGetOK) IsServerError() bool {
	return false
}

// IsCode returns true when this header filter allows get o k response a status code equal to that given
func (o *HeaderFilterAllowsGetOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the header filter allows get o k response
func (o *HeaderFilterAllowsGetOK) Code() int {
	return 200
}

func (o *HeaderFilterAllowsGetOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetOK %s", 200, payload)
}

func (o *HeaderFilterAllowsGetOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetOK %s", 200, payload)
}

func (o *HeaderFilterAllowsGetOK) GetPayload() []*models.HeaderFilter {
	return o.Payload
}

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

// NewHeaderFilterAllowsGetBadRequest creates a HeaderFilterAllowsGetBadRequest with default headers values
func NewHeaderFilterAllowsGetBadRequest() *HeaderFilterAllowsGetBadRequest {
	return &HeaderFilterAllowsGetBadRequest{}
}

/*
HeaderFilterAllowsGetBadRequest describes a response with status code 400, with default header values.

bad request
*/
type HeaderFilterAllowsGetBadRequest struct {
}

// IsSuccess returns true when this header filter allows get bad request response has a 2xx status code
func (o *HeaderFilterAllowsGetBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this header filter allows get bad request response has a 3xx status code
func (o *HeaderFilterAllowsGetBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get bad request response has a 4xx status code
func (o *HeaderFilterAllowsGetBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this header filter allows get bad request response has a 5xx status code
func (o *HeaderFilterAllowsGetBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this header filter allows get bad request response a status code equal to that given
func (o *HeaderFilterAllowsGetBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the header filter allows get bad request response
func (o *HeaderFilterAllowsGetBadRequest) Code() int {
	return 400
}

func (o *HeaderFilterAllowsGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetBadRequest", 400)
}

func (o *HeaderFilterAllowsGetBadRequest) String() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetBadRequest", 400)
}

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

	return nil
}

// NewHeaderFilterAllowsGetUnauthorized creates a HeaderFilterAllowsGetUnauthorized with default headers values
func NewHeaderFilterAllowsGetUnauthorized() *HeaderFilterAllowsGetUnauthorized {
	return &HeaderFilterAllowsGetUnauthorized{}
}

/*
HeaderFilterAllowsGetUnauthorized describes a response with status code 401, with default header values.

unauthorized
*/
type HeaderFilterAllowsGetUnauthorized struct {
}

// IsSuccess returns true when this header filter allows get unauthorized response has a 2xx status code
func (o *HeaderFilterAllowsGetUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this header filter allows get unauthorized response has a 3xx status code
func (o *HeaderFilterAllowsGetUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get unauthorized response has a 4xx status code
func (o *HeaderFilterAllowsGetUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this header filter allows get unauthorized response has a 5xx status code
func (o *HeaderFilterAllowsGetUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this header filter allows get unauthorized response a status code equal to that given
func (o *HeaderFilterAllowsGetUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the header filter allows get unauthorized response
func (o *HeaderFilterAllowsGetUnauthorized) Code() int {
	return 401
}

func (o *HeaderFilterAllowsGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetUnauthorized", 401)
}

func (o *HeaderFilterAllowsGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetUnauthorized", 401)
}

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

	return nil
}

// NewHeaderFilterAllowsGetForbidden creates a HeaderFilterAllowsGetForbidden with default headers values
func NewHeaderFilterAllowsGetForbidden() *HeaderFilterAllowsGetForbidden {
	return &HeaderFilterAllowsGetForbidden{}
}

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

forbidden
*/
type HeaderFilterAllowsGetForbidden struct {
}

// IsSuccess returns true when this header filter allows get forbidden response has a 2xx status code
func (o *HeaderFilterAllowsGetForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this header filter allows get forbidden response has a 3xx status code
func (o *HeaderFilterAllowsGetForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get forbidden response has a 4xx status code
func (o *HeaderFilterAllowsGetForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this header filter allows get forbidden response has a 5xx status code
func (o *HeaderFilterAllowsGetForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this header filter allows get forbidden response a status code equal to that given
func (o *HeaderFilterAllowsGetForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the header filter allows get forbidden response
func (o *HeaderFilterAllowsGetForbidden) Code() int {
	return 403
}

func (o *HeaderFilterAllowsGetForbidden) Error() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetForbidden", 403)
}

func (o *HeaderFilterAllowsGetForbidden) String() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetForbidden", 403)
}

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

	return nil
}

// NewHeaderFilterAllowsGetNotFound creates a HeaderFilterAllowsGetNotFound with default headers values
func NewHeaderFilterAllowsGetNotFound() *HeaderFilterAllowsGetNotFound {
	return &HeaderFilterAllowsGetNotFound{}
}

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

not found
*/
type HeaderFilterAllowsGetNotFound struct {
}

// IsSuccess returns true when this header filter allows get not found response has a 2xx status code
func (o *HeaderFilterAllowsGetNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this header filter allows get not found response has a 3xx status code
func (o *HeaderFilterAllowsGetNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get not found response has a 4xx status code
func (o *HeaderFilterAllowsGetNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this header filter allows get not found response has a 5xx status code
func (o *HeaderFilterAllowsGetNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this header filter allows get not found response a status code equal to that given
func (o *HeaderFilterAllowsGetNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the header filter allows get not found response
func (o *HeaderFilterAllowsGetNotFound) Code() int {
	return 404
}

func (o *HeaderFilterAllowsGetNotFound) Error() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetNotFound", 404)
}

func (o *HeaderFilterAllowsGetNotFound) String() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetNotFound", 404)
}

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

	return nil
}

// NewHeaderFilterAllowsGetInternalServerError creates a HeaderFilterAllowsGetInternalServerError with default headers values
func NewHeaderFilterAllowsGetInternalServerError() *HeaderFilterAllowsGetInternalServerError {
	return &HeaderFilterAllowsGetInternalServerError{}
}

/*
HeaderFilterAllowsGetInternalServerError describes a response with status code 500, with default header values.

internal server error
*/
type HeaderFilterAllowsGetInternalServerError struct {
}

// IsSuccess returns true when this header filter allows get internal server error response has a 2xx status code
func (o *HeaderFilterAllowsGetInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this header filter allows get internal server error response has a 3xx status code
func (o *HeaderFilterAllowsGetInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this header filter allows get internal server error response has a 4xx status code
func (o *HeaderFilterAllowsGetInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this header filter allows get internal server error response has a 5xx status code
func (o *HeaderFilterAllowsGetInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this header filter allows get internal server error response a status code equal to that given
func (o *HeaderFilterAllowsGetInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the header filter allows get internal server error response
func (o *HeaderFilterAllowsGetInternalServerError) Code() int {
	return 500
}

func (o *HeaderFilterAllowsGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetInternalServerError", 500)
}

func (o *HeaderFilterAllowsGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /api/v1/admin/header_allows][%d] headerFilterAllowsGetInternalServerError", 500)
}

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

	return nil
}
