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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package portal_catalog

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// PostServicesReader is a Reader for the PostServices structure.
type PostServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPostServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPostServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /services] postServices", response, response.Code())
	}
}

// NewPostServicesOK creates a PostServicesOK with default headers values
func NewPostServicesOK() *PostServicesOK {
	return &PostServicesOK{}
}

// PostServicesOK describes a response with status code 200, with default header values.
//
// Created services
type PostServicesOK struct {
	Payload *members_models.ServiceResponse
}

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

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

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

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

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

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

func (o *PostServicesOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /services][%d] postServicesOK %s", 200, payload)
}

func (o *PostServicesOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /services][%d] postServicesOK %s", 200, payload)
}

func (o *PostServicesOK) GetPayload() *members_models.ServiceResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ServiceResponse)

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

	return nil
}

// NewPostServicesBadRequest creates a PostServicesBadRequest with default headers values
func NewPostServicesBadRequest() *PostServicesBadRequest {
	return &PostServicesBadRequest{}
}

// PostServicesBadRequest describes a response with status code 400, with default header values.
//
// Invalid service data
type PostServicesBadRequest struct {
}

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

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

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

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

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

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

func (o *PostServicesBadRequest) Error() string {
	return fmt.Sprintf("[POST /services][%d] postServicesBadRequest", 400)
}

func (o *PostServicesBadRequest) String() string {
	return fmt.Sprintf("[POST /services][%d] postServicesBadRequest", 400)
}

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

	return nil
}

// NewPostServicesUnauthorized creates a PostServicesUnauthorized with default headers values
func NewPostServicesUnauthorized() *PostServicesUnauthorized {
	return &PostServicesUnauthorized{}
}

// PostServicesUnauthorized describes a response with status code 401, with default header values.
//
// Missing or invalid server or session credential
type PostServicesUnauthorized struct {
}

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

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

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

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

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

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

func (o *PostServicesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized", 401)
}

func (o *PostServicesUnauthorized) String() string {
	return fmt.Sprintf("[POST /services][%d] postServicesUnauthorized", 401)
}

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

	return nil
}

// NewPostServicesForbidden creates a PostServicesForbidden with default headers values
func NewPostServicesForbidden() *PostServicesForbidden {
	return &PostServicesForbidden{}
}

// PostServicesForbidden describes a response with status code 403, with default header values.
//
// Actor lacks catalog-management authority
type PostServicesForbidden struct {
}

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

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

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

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

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

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

func (o *PostServicesForbidden) Error() string {
	return fmt.Sprintf("[POST /services][%d] postServicesForbidden", 403)
}

func (o *PostServicesForbidden) String() string {
	return fmt.Sprintf("[POST /services][%d] postServicesForbidden", 403)
}

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

	return nil
}

// NewPostServicesInternalServerError creates a PostServicesInternalServerError with default headers values
func NewPostServicesInternalServerError() *PostServicesInternalServerError {
	return &PostServicesInternalServerError{}
}

// PostServicesInternalServerError describes a response with status code 500, with default header values.
//
// Server error
type PostServicesInternalServerError struct {
}

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

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

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

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

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

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

func (o *PostServicesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError", 500)
}

func (o *PostServicesInternalServerError) String() string {
	return fmt.Sprintf("[POST /services][%d] postServicesInternalServerError", 500)
}

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

	return nil
}
