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

package search

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

// SearchGetReader is a Reader for the SearchGet structure.
type SearchGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *SearchGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewSearchGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewSearchGetBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewSearchGetUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewSearchGetNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewSearchGetNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewSearchGetInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/{api_version}/search] searchGet", response, response.Code())
	}
}

// NewSearchGetOK creates a SearchGetOK with default headers values
func NewSearchGetOK() *SearchGetOK {
	return &SearchGetOK{}
}

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

Results of the search.
*/
type SearchGetOK struct {
	Payload *models.SearchResult
}

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

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

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

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

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

// Code gets the status code for the search get o k response
func (o *SearchGetOK) Code() int {
	return 200
}

func (o *SearchGetOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetOK %s", 200, payload)
}

func (o *SearchGetOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetOK %s", 200, payload)
}

func (o *SearchGetOK) GetPayload() *models.SearchResult {
	return o.Payload
}

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

	o.Payload = new(models.SearchResult)

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

	return nil
}

// NewSearchGetBadRequest creates a SearchGetBadRequest with default headers values
func NewSearchGetBadRequest() *SearchGetBadRequest {
	return &SearchGetBadRequest{}
}

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

bad request
*/
type SearchGetBadRequest struct {
}

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

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

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

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

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

// Code gets the status code for the search get bad request response
func (o *SearchGetBadRequest) Code() int {
	return 400
}

func (o *SearchGetBadRequest) Error() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetBadRequest", 400)
}

func (o *SearchGetBadRequest) String() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetBadRequest", 400)
}

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

	return nil
}

// NewSearchGetUnauthorized creates a SearchGetUnauthorized with default headers values
func NewSearchGetUnauthorized() *SearchGetUnauthorized {
	return &SearchGetUnauthorized{}
}

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

unauthorized
*/
type SearchGetUnauthorized struct {
}

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

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

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

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

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

// Code gets the status code for the search get unauthorized response
func (o *SearchGetUnauthorized) Code() int {
	return 401
}

func (o *SearchGetUnauthorized) Error() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetUnauthorized", 401)
}

func (o *SearchGetUnauthorized) String() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetUnauthorized", 401)
}

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

	return nil
}

// NewSearchGetNotFound creates a SearchGetNotFound with default headers values
func NewSearchGetNotFound() *SearchGetNotFound {
	return &SearchGetNotFound{}
}

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

not found
*/
type SearchGetNotFound struct {
}

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

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

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

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

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

// Code gets the status code for the search get not found response
func (o *SearchGetNotFound) Code() int {
	return 404
}

func (o *SearchGetNotFound) Error() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetNotFound", 404)
}

func (o *SearchGetNotFound) String() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetNotFound", 404)
}

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

	return nil
}

// NewSearchGetNotAcceptable creates a SearchGetNotAcceptable with default headers values
func NewSearchGetNotAcceptable() *SearchGetNotAcceptable {
	return &SearchGetNotAcceptable{}
}

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

not acceptable
*/
type SearchGetNotAcceptable struct {
}

// IsSuccess returns true when this search get not acceptable response has a 2xx status code
func (o *SearchGetNotAcceptable) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this search get not acceptable response has a 3xx status code
func (o *SearchGetNotAcceptable) IsRedirect() bool {
	return false
}

// IsClientError returns true when this search get not acceptable response has a 4xx status code
func (o *SearchGetNotAcceptable) IsClientError() bool {
	return true
}

// IsServerError returns true when this search get not acceptable response has a 5xx status code
func (o *SearchGetNotAcceptable) IsServerError() bool {
	return false
}

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

// Code gets the status code for the search get not acceptable response
func (o *SearchGetNotAcceptable) Code() int {
	return 406
}

func (o *SearchGetNotAcceptable) Error() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetNotAcceptable", 406)
}

func (o *SearchGetNotAcceptable) String() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetNotAcceptable", 406)
}

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

	return nil
}

// NewSearchGetInternalServerError creates a SearchGetInternalServerError with default headers values
func NewSearchGetInternalServerError() *SearchGetInternalServerError {
	return &SearchGetInternalServerError{}
}

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

internal server error
*/
type SearchGetInternalServerError struct {
}

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

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

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

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

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

// Code gets the status code for the search get internal server error response
func (o *SearchGetInternalServerError) Code() int {
	return 500
}

func (o *SearchGetInternalServerError) Error() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetInternalServerError", 500)
}

func (o *SearchGetInternalServerError) String() string {
	return fmt.Sprintf("[GET /api/{api_version}/search][%d] searchGetInternalServerError", 500)
}

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

	return nil
}
