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

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

package user

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

	"github.com/taxnexus/go/lib/api/devops/devops_models"
)

// PutUsersReader is a Reader for the PutUsers structure.
type PutUsersReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutUsersOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutUsersUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutUsersForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutUsersNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutUsersUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutUsersInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewPutUsersOK creates a PutUsersOK with default headers values
func NewPutUsersOK() *PutUsersOK {
	return &PutUsersOK{}
}

/*PutUsersOK handles this case with default header values.

Taxnexus Response with User objects
*/
type PutUsersOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *devops_models.UserResponse
}

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

func (o *PutUsersOK) GetPayload() *devops_models.UserResponse {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(devops_models.UserResponse)

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

	return nil
}

// NewPutUsersUnauthorized creates a PutUsersUnauthorized with default headers values
func NewPutUsersUnauthorized() *PutUsersUnauthorized {
	return &PutUsersUnauthorized{}
}

/*PutUsersUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type PutUsersUnauthorized struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *devops_models.Error
}

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

func (o *PutUsersUnauthorized) GetPayload() *devops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(devops_models.Error)

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

	return nil
}

// NewPutUsersForbidden creates a PutUsersForbidden with default headers values
func NewPutUsersForbidden() *PutUsersForbidden {
	return &PutUsersForbidden{}
}

/*PutUsersForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type PutUsersForbidden struct {
	AccessControlAllowOrigin string

	Payload *devops_models.Error
}

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

func (o *PutUsersForbidden) GetPayload() *devops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(devops_models.Error)

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

	return nil
}

// NewPutUsersNotFound creates a PutUsersNotFound with default headers values
func NewPutUsersNotFound() *PutUsersNotFound {
	return &PutUsersNotFound{}
}

/*PutUsersNotFound handles this case with default header values.

Resource was not found
*/
type PutUsersNotFound struct {
	AccessControlAllowOrigin string

	Payload *devops_models.Error
}

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

func (o *PutUsersNotFound) GetPayload() *devops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(devops_models.Error)

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

	return nil
}

// NewPutUsersUnprocessableEntity creates a PutUsersUnprocessableEntity with default headers values
func NewPutUsersUnprocessableEntity() *PutUsersUnprocessableEntity {
	return &PutUsersUnprocessableEntity{}
}

/*PutUsersUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type PutUsersUnprocessableEntity struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *devops_models.Error
}

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

func (o *PutUsersUnprocessableEntity) GetPayload() *devops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(devops_models.Error)

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

	return nil
}

// NewPutUsersInternalServerError creates a PutUsersInternalServerError with default headers values
func NewPutUsersInternalServerError() *PutUsersInternalServerError {
	return &PutUsersInternalServerError{}
}

/*PutUsersInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutUsersInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *devops_models.Error
}

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

func (o *PutUsersInternalServerError) GetPayload() *devops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(devops_models.Error)

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

	return nil
}
