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

package markers

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

// MarkersPostReader is a Reader for the MarkersPost structure.
type MarkersPostReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *MarkersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewMarkersPostOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewMarkersPostBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewMarkersPostUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewMarkersPostConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewMarkersPostInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /api/v1/markers] markersPost", response, response.Code())
	}
}

// NewMarkersPostOK creates a MarkersPostOK with default headers values
func NewMarkersPostOK() *MarkersPostOK {
	return &MarkersPostOK{}
}

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

Requested markers
*/
type MarkersPostOK struct {
	Payload *models.Marker
}

// IsSuccess returns true when this markers post o k response has a 2xx status code
func (o *MarkersPostOK) IsSuccess() bool {
	return true
}

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

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

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

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

// Code gets the status code for the markers post o k response
func (o *MarkersPostOK) Code() int {
	return 200
}

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

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

func (o *MarkersPostOK) GetPayload() *models.Marker {
	return o.Payload
}

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

	o.Payload = new(models.Marker)

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

	return nil
}

// NewMarkersPostBadRequest creates a MarkersPostBadRequest with default headers values
func NewMarkersPostBadRequest() *MarkersPostBadRequest {
	return &MarkersPostBadRequest{}
}

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

bad request
*/
type MarkersPostBadRequest struct {
}

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

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

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

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

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

// Code gets the status code for the markers post bad request response
func (o *MarkersPostBadRequest) Code() int {
	return 400
}

func (o *MarkersPostBadRequest) Error() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostBadRequest", 400)
}

func (o *MarkersPostBadRequest) String() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostBadRequest", 400)
}

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

	return nil
}

// NewMarkersPostUnauthorized creates a MarkersPostUnauthorized with default headers values
func NewMarkersPostUnauthorized() *MarkersPostUnauthorized {
	return &MarkersPostUnauthorized{}
}

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

unauthorized
*/
type MarkersPostUnauthorized struct {
}

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

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

// IsClientError returns true when this markers post unauthorized response has a 4xx status code
func (o *MarkersPostUnauthorized) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the markers post unauthorized response
func (o *MarkersPostUnauthorized) Code() int {
	return 401
}

func (o *MarkersPostUnauthorized) Error() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostUnauthorized", 401)
}

func (o *MarkersPostUnauthorized) String() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostUnauthorized", 401)
}

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

	return nil
}

// NewMarkersPostConflict creates a MarkersPostConflict with default headers values
func NewMarkersPostConflict() *MarkersPostConflict {
	return &MarkersPostConflict{}
}

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

conflict (when two clients try to update the same timeline at the same time)
*/
type MarkersPostConflict struct {
}

// IsSuccess returns true when this markers post conflict response has a 2xx status code
func (o *MarkersPostConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this markers post conflict response has a 3xx status code
func (o *MarkersPostConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this markers post conflict response has a 4xx status code
func (o *MarkersPostConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this markers post conflict response has a 5xx status code
func (o *MarkersPostConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this markers post conflict response a status code equal to that given
func (o *MarkersPostConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the markers post conflict response
func (o *MarkersPostConflict) Code() int {
	return 409
}

func (o *MarkersPostConflict) Error() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostConflict", 409)
}

func (o *MarkersPostConflict) String() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostConflict", 409)
}

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

	return nil
}

// NewMarkersPostInternalServerError creates a MarkersPostInternalServerError with default headers values
func NewMarkersPostInternalServerError() *MarkersPostInternalServerError {
	return &MarkersPostInternalServerError{}
}

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

internal server error
*/
type MarkersPostInternalServerError struct {
}

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

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

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

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

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

// Code gets the status code for the markers post internal server error response
func (o *MarkersPostInternalServerError) Code() int {
	return 500
}

func (o *MarkersPostInternalServerError) Error() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostInternalServerError", 500)
}

func (o *MarkersPostInternalServerError) String() string {
	return fmt.Sprintf("[POST /api/v1/markers][%d] markersPostInternalServerError", 500)
}

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

	return nil
}
