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

// PutServicesReader is a Reader for the PutServices structure.
type PutServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewPutServicesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewPutServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutServicesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /services] putServices", response, response.Code())
	}
}

// NewPutServicesOK creates a PutServicesOK with default headers values
func NewPutServicesOK() *PutServicesOK {
	return &PutServicesOK{}
}

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

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

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

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

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

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

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

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

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

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

func (o *PutServicesOK) 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
}

// NewPutServicesBadRequest creates a PutServicesBadRequest with default headers values
func NewPutServicesBadRequest() *PutServicesBadRequest {
	return &PutServicesBadRequest{}
}

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

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

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

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

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

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

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

func (o *PutServicesBadRequest) Error() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesBadRequest", 400)
}

func (o *PutServicesBadRequest) String() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesBadRequest", 400)
}

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

	return nil
}

// NewPutServicesUnauthorized creates a PutServicesUnauthorized with default headers values
func NewPutServicesUnauthorized() *PutServicesUnauthorized {
	return &PutServicesUnauthorized{}
}

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

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

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

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

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

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

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

func (o *PutServicesUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesUnauthorized", 401)
}

func (o *PutServicesUnauthorized) String() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesUnauthorized", 401)
}

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

	return nil
}

// NewPutServicesForbidden creates a PutServicesForbidden with default headers values
func NewPutServicesForbidden() *PutServicesForbidden {
	return &PutServicesForbidden{}
}

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

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

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

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

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

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

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

func (o *PutServicesForbidden) Error() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesForbidden", 403)
}

func (o *PutServicesForbidden) String() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesForbidden", 403)
}

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

	return nil
}

// NewPutServicesInternalServerError creates a PutServicesInternalServerError with default headers values
func NewPutServicesInternalServerError() *PutServicesInternalServerError {
	return &PutServicesInternalServerError{}
}

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

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

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

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

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

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

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

func (o *PutServicesInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesInternalServerError", 500)
}

func (o *PutServicesInternalServerError) String() string {
	return fmt.Sprintf("[PUT /services][%d] putServicesInternalServerError", 500)
}

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

	return nil
}
