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

// DomainBlockCreateReader is a Reader for the DomainBlockCreate structure.
type DomainBlockCreateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DomainBlockCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDomainBlockCreateOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDomainBlockCreateBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewDomainBlockCreateUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDomainBlockCreateForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDomainBlockCreateNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewDomainBlockCreateNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewDomainBlockCreateConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDomainBlockCreateInternalServerError()
		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/domain_blocks] domainBlockCreate", response, response.Code())
	}
}

// NewDomainBlockCreateOK creates a DomainBlockCreateOK with default headers values
func NewDomainBlockCreateOK() *DomainBlockCreateOK {
	return &DomainBlockCreateOK{}
}

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

The newly created domain block, if `import` != `true`. If a list has been imported, then an `array` of newly created domain blocks will be returned instead.
*/
type DomainBlockCreateOK struct {
	Payload *models.DomainPermission
}

// IsSuccess returns true when this domain block create o k response has a 2xx status code
func (o *DomainBlockCreateOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this domain block create o k response has a 3xx status code
func (o *DomainBlockCreateOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create o k response has a 4xx status code
func (o *DomainBlockCreateOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this domain block create o k response has a 5xx status code
func (o *DomainBlockCreateOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the domain block create o k response
func (o *DomainBlockCreateOK) Code() int {
	return 200
}

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

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

func (o *DomainBlockCreateOK) GetPayload() *models.DomainPermission {
	return o.Payload
}

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

	o.Payload = new(models.DomainPermission)

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

	return nil
}

// NewDomainBlockCreateBadRequest creates a DomainBlockCreateBadRequest with default headers values
func NewDomainBlockCreateBadRequest() *DomainBlockCreateBadRequest {
	return &DomainBlockCreateBadRequest{}
}

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

bad request
*/
type DomainBlockCreateBadRequest struct {
}

// IsSuccess returns true when this domain block create bad request response has a 2xx status code
func (o *DomainBlockCreateBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create bad request response has a 3xx status code
func (o *DomainBlockCreateBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create bad request response has a 4xx status code
func (o *DomainBlockCreateBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create bad request response has a 5xx status code
func (o *DomainBlockCreateBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the domain block create bad request response
func (o *DomainBlockCreateBadRequest) Code() int {
	return 400
}

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

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

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

	return nil
}

// NewDomainBlockCreateUnauthorized creates a DomainBlockCreateUnauthorized with default headers values
func NewDomainBlockCreateUnauthorized() *DomainBlockCreateUnauthorized {
	return &DomainBlockCreateUnauthorized{}
}

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

unauthorized
*/
type DomainBlockCreateUnauthorized struct {
}

// IsSuccess returns true when this domain block create unauthorized response has a 2xx status code
func (o *DomainBlockCreateUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create unauthorized response has a 3xx status code
func (o *DomainBlockCreateUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create unauthorized response has a 4xx status code
func (o *DomainBlockCreateUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create unauthorized response has a 5xx status code
func (o *DomainBlockCreateUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the domain block create unauthorized response
func (o *DomainBlockCreateUnauthorized) Code() int {
	return 401
}

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

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

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

	return nil
}

// NewDomainBlockCreateForbidden creates a DomainBlockCreateForbidden with default headers values
func NewDomainBlockCreateForbidden() *DomainBlockCreateForbidden {
	return &DomainBlockCreateForbidden{}
}

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

forbidden
*/
type DomainBlockCreateForbidden struct {
}

// IsSuccess returns true when this domain block create forbidden response has a 2xx status code
func (o *DomainBlockCreateForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create forbidden response has a 3xx status code
func (o *DomainBlockCreateForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create forbidden response has a 4xx status code
func (o *DomainBlockCreateForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create forbidden response has a 5xx status code
func (o *DomainBlockCreateForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the domain block create forbidden response
func (o *DomainBlockCreateForbidden) Code() int {
	return 403
}

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

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

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

	return nil
}

// NewDomainBlockCreateNotFound creates a DomainBlockCreateNotFound with default headers values
func NewDomainBlockCreateNotFound() *DomainBlockCreateNotFound {
	return &DomainBlockCreateNotFound{}
}

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

not found
*/
type DomainBlockCreateNotFound struct {
}

// IsSuccess returns true when this domain block create not found response has a 2xx status code
func (o *DomainBlockCreateNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create not found response has a 3xx status code
func (o *DomainBlockCreateNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create not found response has a 4xx status code
func (o *DomainBlockCreateNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create not found response has a 5xx status code
func (o *DomainBlockCreateNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this domain block create not found response a status code equal to that given
func (o *DomainBlockCreateNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the domain block create not found response
func (o *DomainBlockCreateNotFound) Code() int {
	return 404
}

func (o *DomainBlockCreateNotFound) Error() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateNotFound", 404)
}

func (o *DomainBlockCreateNotFound) String() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateNotFound", 404)
}

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

	return nil
}

// NewDomainBlockCreateNotAcceptable creates a DomainBlockCreateNotAcceptable with default headers values
func NewDomainBlockCreateNotAcceptable() *DomainBlockCreateNotAcceptable {
	return &DomainBlockCreateNotAcceptable{}
}

/*
DomainBlockCreateNotAcceptable describes a response with status code 406, with default header values.

not acceptable
*/
type DomainBlockCreateNotAcceptable struct {
}

// IsSuccess returns true when this domain block create not acceptable response has a 2xx status code
func (o *DomainBlockCreateNotAcceptable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create not acceptable response has a 3xx status code
func (o *DomainBlockCreateNotAcceptable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create not acceptable response has a 4xx status code
func (o *DomainBlockCreateNotAcceptable) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create not acceptable response has a 5xx status code
func (o *DomainBlockCreateNotAcceptable) IsServerError() bool {
	return false
}

// IsCode returns true when this domain block create not acceptable response a status code equal to that given
func (o *DomainBlockCreateNotAcceptable) IsCode(code int) bool {
	return code == 406
}

// Code gets the status code for the domain block create not acceptable response
func (o *DomainBlockCreateNotAcceptable) Code() int {
	return 406
}

func (o *DomainBlockCreateNotAcceptable) Error() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateNotAcceptable", 406)
}

func (o *DomainBlockCreateNotAcceptable) String() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateNotAcceptable", 406)
}

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

	return nil
}

// NewDomainBlockCreateConflict creates a DomainBlockCreateConflict with default headers values
func NewDomainBlockCreateConflict() *DomainBlockCreateConflict {
	return &DomainBlockCreateConflict{}
}

/*
DomainBlockCreateConflict describes a response with status code 409, with default header values.

Conflict: There is already an admin action running that conflicts with this action. Check the error message in the response body for more information. This is a temporary error; it should be possible to process this action if you try again in a bit.
*/
type DomainBlockCreateConflict struct {
}

// IsSuccess returns true when this domain block create conflict response has a 2xx status code
func (o *DomainBlockCreateConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create conflict response has a 3xx status code
func (o *DomainBlockCreateConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create conflict response has a 4xx status code
func (o *DomainBlockCreateConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this domain block create conflict response has a 5xx status code
func (o *DomainBlockCreateConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this domain block create conflict response a status code equal to that given
func (o *DomainBlockCreateConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the domain block create conflict response
func (o *DomainBlockCreateConflict) Code() int {
	return 409
}

func (o *DomainBlockCreateConflict) Error() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateConflict", 409)
}

func (o *DomainBlockCreateConflict) String() string {
	return fmt.Sprintf("[POST /api/v1/admin/domain_blocks][%d] domainBlockCreateConflict", 409)
}

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

	return nil
}

// NewDomainBlockCreateInternalServerError creates a DomainBlockCreateInternalServerError with default headers values
func NewDomainBlockCreateInternalServerError() *DomainBlockCreateInternalServerError {
	return &DomainBlockCreateInternalServerError{}
}

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

internal server error
*/
type DomainBlockCreateInternalServerError struct {
}

// IsSuccess returns true when this domain block create internal server error response has a 2xx status code
func (o *DomainBlockCreateInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this domain block create internal server error response has a 3xx status code
func (o *DomainBlockCreateInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this domain block create internal server error response has a 4xx status code
func (o *DomainBlockCreateInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this domain block create internal server error response has a 5xx status code
func (o *DomainBlockCreateInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the domain block create internal server error response
func (o *DomainBlockCreateInternalServerError) Code() int {
	return 500
}

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

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

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

	return nil
}
