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

// HeaderFilterAllowCreateReader is a Reader for the HeaderFilterAllowCreate structure.
type HeaderFilterAllowCreateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *HeaderFilterAllowCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewHeaderFilterAllowCreateOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewHeaderFilterAllowCreateBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewHeaderFilterAllowCreateUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewHeaderFilterAllowCreateForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewHeaderFilterAllowCreateInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /api/v1/admin/header_allows] headerFilterAllowCreate", response, response.Code())
	}
}

// NewHeaderFilterAllowCreateOK creates a HeaderFilterAllowCreateOK with default headers values
func NewHeaderFilterAllowCreateOK() *HeaderFilterAllowCreateOK {
	return &HeaderFilterAllowCreateOK{}
}

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

The newly created "allow" header filter.
*/
type HeaderFilterAllowCreateOK struct {
	Payload *models.HeaderFilter
}

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

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

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

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

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

// Code gets the status code for the header filter allow create o k response
func (o *HeaderFilterAllowCreateOK) Code() int {
	return 200
}

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

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

func (o *HeaderFilterAllowCreateOK) GetPayload() *models.HeaderFilter {
	return o.Payload
}

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

	o.Payload = new(models.HeaderFilter)

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

	return nil
}

// NewHeaderFilterAllowCreateBadRequest creates a HeaderFilterAllowCreateBadRequest with default headers values
func NewHeaderFilterAllowCreateBadRequest() *HeaderFilterAllowCreateBadRequest {
	return &HeaderFilterAllowCreateBadRequest{}
}

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

bad request
*/
type HeaderFilterAllowCreateBadRequest struct {
}

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

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

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

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

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

// Code gets the status code for the header filter allow create bad request response
func (o *HeaderFilterAllowCreateBadRequest) Code() int {
	return 400
}

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

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

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

	return nil
}

// NewHeaderFilterAllowCreateUnauthorized creates a HeaderFilterAllowCreateUnauthorized with default headers values
func NewHeaderFilterAllowCreateUnauthorized() *HeaderFilterAllowCreateUnauthorized {
	return &HeaderFilterAllowCreateUnauthorized{}
}

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

unauthorized
*/
type HeaderFilterAllowCreateUnauthorized struct {
}

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

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

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

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

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

// Code gets the status code for the header filter allow create unauthorized response
func (o *HeaderFilterAllowCreateUnauthorized) Code() int {
	return 401
}

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

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

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

	return nil
}

// NewHeaderFilterAllowCreateForbidden creates a HeaderFilterAllowCreateForbidden with default headers values
func NewHeaderFilterAllowCreateForbidden() *HeaderFilterAllowCreateForbidden {
	return &HeaderFilterAllowCreateForbidden{}
}

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

forbidden
*/
type HeaderFilterAllowCreateForbidden struct {
}

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

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

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

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

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

// Code gets the status code for the header filter allow create forbidden response
func (o *HeaderFilterAllowCreateForbidden) Code() int {
	return 403
}

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

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

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

	return nil
}

// NewHeaderFilterAllowCreateInternalServerError creates a HeaderFilterAllowCreateInternalServerError with default headers values
func NewHeaderFilterAllowCreateInternalServerError() *HeaderFilterAllowCreateInternalServerError {
	return &HeaderFilterAllowCreateInternalServerError{}
}

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

internal server error
*/
type HeaderFilterAllowCreateInternalServerError struct {
}

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

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

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

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

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

// Code gets the status code for the header filter allow create internal server error response
func (o *HeaderFilterAllowCreateInternalServerError) Code() int {
	return 500
}

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

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

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

	return nil
}
