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

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package topics

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"code.tnxs.net/work/lib/api/sfgate/sfgate_models"
)

// PostTopicsReader is a Reader for the PostTopics structure.
type PostTopicsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostTopicsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostTopicsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostTopicsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostTopicsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostTopicsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostTopicsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewPostTopicsOK creates a PostTopicsOK with default headers values
func NewPostTopicsOK() *PostTopicsOK {
	return &PostTopicsOK{}
}

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

Response with Topic objects
*/
type PostTopicsOK struct {
	Payload *sfgate_models.TopicResponse
}

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

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

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

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

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

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

func (o *PostTopicsOK) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsOK  %+v", 200, o.Payload)
}

func (o *PostTopicsOK) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsOK  %+v", 200, o.Payload)
}

func (o *PostTopicsOK) GetPayload() *sfgate_models.TopicResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.TopicResponse)

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

	return nil
}

// NewPostTopicsUnauthorized creates a PostTopicsUnauthorized with default headers values
func NewPostTopicsUnauthorized() *PostTopicsUnauthorized {
	return &PostTopicsUnauthorized{}
}

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

Access unauthorized, invalid API-KEY was used
*/
type PostTopicsUnauthorized struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PostTopicsUnauthorized) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsUnauthorized  %+v", 401, o.Payload)
}

func (o *PostTopicsUnauthorized) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsUnauthorized  %+v", 401, o.Payload)
}

func (o *PostTopicsUnauthorized) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPostTopicsForbidden creates a PostTopicsForbidden with default headers values
func NewPostTopicsForbidden() *PostTopicsForbidden {
	return &PostTopicsForbidden{}
}

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

Access forbidden, account lacks access
*/
type PostTopicsForbidden struct {
	Payload *sfgate_models.Error
}

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

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

// IsClientError returns true when this post topics forbidden response has a 4xx status code
func (o *PostTopicsForbidden) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the post topics forbidden response
func (o *PostTopicsForbidden) Code() int {
	return 403
}

func (o *PostTopicsForbidden) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsForbidden  %+v", 403, o.Payload)
}

func (o *PostTopicsForbidden) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsForbidden  %+v", 403, o.Payload)
}

func (o *PostTopicsForbidden) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPostTopicsNotFound creates a PostTopicsNotFound with default headers values
func NewPostTopicsNotFound() *PostTopicsNotFound {
	return &PostTopicsNotFound{}
}

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

Resource was not found
*/
type PostTopicsNotFound struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

// Code gets the status code for the post topics not found response
func (o *PostTopicsNotFound) Code() int {
	return 404
}

func (o *PostTopicsNotFound) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsNotFound  %+v", 404, o.Payload)
}

func (o *PostTopicsNotFound) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsNotFound  %+v", 404, o.Payload)
}

func (o *PostTopicsNotFound) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPostTopicsUnprocessableEntity creates a PostTopicsUnprocessableEntity with default headers values
func NewPostTopicsUnprocessableEntity() *PostTopicsUnprocessableEntity {
	return &PostTopicsUnprocessableEntity{}
}

/*
PostTopicsUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity, likely a bad parameter
*/
type PostTopicsUnprocessableEntity struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this post topics unprocessable entity response has a 2xx status code
func (o *PostTopicsUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post topics unprocessable entity response has a 3xx status code
func (o *PostTopicsUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post topics unprocessable entity response has a 4xx status code
func (o *PostTopicsUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this post topics unprocessable entity response has a 5xx status code
func (o *PostTopicsUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this post topics unprocessable entity response a status code equal to that given
func (o *PostTopicsUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the post topics unprocessable entity response
func (o *PostTopicsUnprocessableEntity) Code() int {
	return 422
}

func (o *PostTopicsUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostTopicsUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostTopicsUnprocessableEntity) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPostTopicsInternalServerError creates a PostTopicsInternalServerError with default headers values
func NewPostTopicsInternalServerError() *PostTopicsInternalServerError {
	return &PostTopicsInternalServerError{}
}

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

Server Internal Error
*/
type PostTopicsInternalServerError struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PostTopicsInternalServerError) Error() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsInternalServerError  %+v", 500, o.Payload)
}

func (o *PostTopicsInternalServerError) String() string {
	return fmt.Sprintf("[POST /topics][%d] postTopicsInternalServerError  %+v", 500, o.Payload)
}

func (o *PostTopicsInternalServerError) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}
