// 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 documents

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

// PutDocumentsReader is a Reader for the PutDocuments structure.
type PutDocumentsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutDocumentsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutDocumentsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutDocumentsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutDocumentsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutDocumentsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutDocumentsInternalServerError()
		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())
	}
}

// NewPutDocumentsOK creates a PutDocumentsOK with default headers values
func NewPutDocumentsOK() *PutDocumentsOK {
	return &PutDocumentsOK{}
}

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

Response with Document objects
*/
type PutDocumentsOK struct {
	Payload *sfgate_models.DocumentResponse
}

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

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

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

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

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

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

func (o *PutDocumentsOK) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK  %+v", 200, o.Payload)
}

func (o *PutDocumentsOK) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK  %+v", 200, o.Payload)
}

func (o *PutDocumentsOK) GetPayload() *sfgate_models.DocumentResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.DocumentResponse)

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

	return nil
}

// NewPutDocumentsUnauthorized creates a PutDocumentsUnauthorized with default headers values
func NewPutDocumentsUnauthorized() *PutDocumentsUnauthorized {
	return &PutDocumentsUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *PutDocumentsUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized  %+v", 401, o.Payload)
}

func (o *PutDocumentsUnauthorized) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPutDocumentsForbidden creates a PutDocumentsForbidden with default headers values
func NewPutDocumentsForbidden() *PutDocumentsForbidden {
	return &PutDocumentsForbidden{}
}

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

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

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

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

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

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

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

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

func (o *PutDocumentsForbidden) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden  %+v", 403, o.Payload)
}

func (o *PutDocumentsForbidden) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden  %+v", 403, o.Payload)
}

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

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

// NewPutDocumentsNotFound creates a PutDocumentsNotFound with default headers values
func NewPutDocumentsNotFound() *PutDocumentsNotFound {
	return &PutDocumentsNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the put documents not found response
func (o *PutDocumentsNotFound) Code() int {
	return 404
}

func (o *PutDocumentsNotFound) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound  %+v", 404, o.Payload)
}

func (o *PutDocumentsNotFound) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound  %+v", 404, o.Payload)
}

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

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

// NewPutDocumentsUnprocessableEntity creates a PutDocumentsUnprocessableEntity with default headers values
func NewPutDocumentsUnprocessableEntity() *PutDocumentsUnprocessableEntity {
	return &PutDocumentsUnprocessableEntity{}
}

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

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

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

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

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

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

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

// Code gets the status code for the put documents unprocessable entity response
func (o *PutDocumentsUnprocessableEntity) Code() int {
	return 422
}

func (o *PutDocumentsUnprocessableEntity) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PutDocumentsUnprocessableEntity) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPutDocumentsInternalServerError creates a PutDocumentsInternalServerError with default headers values
func NewPutDocumentsInternalServerError() *PutDocumentsInternalServerError {
	return &PutDocumentsInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *PutDocumentsInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError  %+v", 500, o.Payload)
}

func (o *PutDocumentsInternalServerError) String() string {
	return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError  %+v", 500, o.Payload)
}

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

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