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

package statuses

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

// ThreadContextReader is a Reader for the ThreadContext structure.
type ThreadContextReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ThreadContextReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewThreadContextOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewThreadContextBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewThreadContextUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewThreadContextForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewThreadContextNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 406:
		result := NewThreadContextNotAcceptable()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewThreadContextInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /api/v1/statuses/{id}/context] threadContext", response, response.Code())
	}
}

// NewThreadContextOK creates a ThreadContextOK with default headers values
func NewThreadContextOK() *ThreadContextOK {
	return &ThreadContextOK{}
}

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

Thread context object.
*/
type ThreadContextOK struct {
	Payload *models.ThreadContext
}

// IsSuccess returns true when this thread context o k response has a 2xx status code
func (o *ThreadContextOK) IsSuccess() bool {
	return true
}

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

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

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

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

// Code gets the status code for the thread context o k response
func (o *ThreadContextOK) Code() int {
	return 200
}

func (o *ThreadContextOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextOK %s", 200, payload)
}

func (o *ThreadContextOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextOK %s", 200, payload)
}

func (o *ThreadContextOK) GetPayload() *models.ThreadContext {
	return o.Payload
}

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

	o.Payload = new(models.ThreadContext)

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

	return nil
}

// NewThreadContextBadRequest creates a ThreadContextBadRequest with default headers values
func NewThreadContextBadRequest() *ThreadContextBadRequest {
	return &ThreadContextBadRequest{}
}

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

bad request
*/
type ThreadContextBadRequest struct {
}

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

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

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

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

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

// Code gets the status code for the thread context bad request response
func (o *ThreadContextBadRequest) Code() int {
	return 400
}

func (o *ThreadContextBadRequest) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextBadRequest", 400)
}

func (o *ThreadContextBadRequest) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextBadRequest", 400)
}

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

	return nil
}

// NewThreadContextUnauthorized creates a ThreadContextUnauthorized with default headers values
func NewThreadContextUnauthorized() *ThreadContextUnauthorized {
	return &ThreadContextUnauthorized{}
}

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

unauthorized
*/
type ThreadContextUnauthorized struct {
}

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

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

// IsClientError returns true when this thread context unauthorized response has a 4xx status code
func (o *ThreadContextUnauthorized) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the thread context unauthorized response
func (o *ThreadContextUnauthorized) Code() int {
	return 401
}

func (o *ThreadContextUnauthorized) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextUnauthorized", 401)
}

func (o *ThreadContextUnauthorized) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextUnauthorized", 401)
}

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

	return nil
}

// NewThreadContextForbidden creates a ThreadContextForbidden with default headers values
func NewThreadContextForbidden() *ThreadContextForbidden {
	return &ThreadContextForbidden{}
}

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

forbidden
*/
type ThreadContextForbidden struct {
}

// IsSuccess returns true when this thread context forbidden response has a 2xx status code
func (o *ThreadContextForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this thread context forbidden response has a 3xx status code
func (o *ThreadContextForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this thread context forbidden response has a 4xx status code
func (o *ThreadContextForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this thread context forbidden response has a 5xx status code
func (o *ThreadContextForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this thread context forbidden response a status code equal to that given
func (o *ThreadContextForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the thread context forbidden response
func (o *ThreadContextForbidden) Code() int {
	return 403
}

func (o *ThreadContextForbidden) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextForbidden", 403)
}

func (o *ThreadContextForbidden) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextForbidden", 403)
}

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

	return nil
}

// NewThreadContextNotFound creates a ThreadContextNotFound with default headers values
func NewThreadContextNotFound() *ThreadContextNotFound {
	return &ThreadContextNotFound{}
}

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

not found
*/
type ThreadContextNotFound struct {
}

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

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

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

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

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

// Code gets the status code for the thread context not found response
func (o *ThreadContextNotFound) Code() int {
	return 404
}

func (o *ThreadContextNotFound) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextNotFound", 404)
}

func (o *ThreadContextNotFound) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextNotFound", 404)
}

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

	return nil
}

// NewThreadContextNotAcceptable creates a ThreadContextNotAcceptable with default headers values
func NewThreadContextNotAcceptable() *ThreadContextNotAcceptable {
	return &ThreadContextNotAcceptable{}
}

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

not acceptable
*/
type ThreadContextNotAcceptable struct {
}

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

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

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

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

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

// Code gets the status code for the thread context not acceptable response
func (o *ThreadContextNotAcceptable) Code() int {
	return 406
}

func (o *ThreadContextNotAcceptable) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextNotAcceptable", 406)
}

func (o *ThreadContextNotAcceptable) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextNotAcceptable", 406)
}

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

	return nil
}

// NewThreadContextInternalServerError creates a ThreadContextInternalServerError with default headers values
func NewThreadContextInternalServerError() *ThreadContextInternalServerError {
	return &ThreadContextInternalServerError{}
}

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

internal server error
*/
type ThreadContextInternalServerError struct {
}

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

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

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

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

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

// Code gets the status code for the thread context internal server error response
func (o *ThreadContextInternalServerError) Code() int {
	return 500
}

func (o *ThreadContextInternalServerError) Error() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextInternalServerError", 500)
}

func (o *ThreadContextInternalServerError) String() string {
	return fmt.Sprintf("[GET /api/v1/statuses/{id}/context][%d] threadContextInternalServerError", 500)
}

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

	return nil
}
