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

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"

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

// UpdateUserSecretReader is a Reader for the UpdateUserSecret structure.
type UpdateUserSecretReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateUserSecretReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewUpdateUserSecretCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewUpdateUserSecretNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateUserSecretBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateUserSecretNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /user/actions/secrets/{secretname}] updateUserSecret", response, response.Code())
	}
}

// NewUpdateUserSecretCreated creates a UpdateUserSecretCreated with default headers values
func NewUpdateUserSecretCreated() *UpdateUserSecretCreated {
	return &UpdateUserSecretCreated{}
}

/*
UpdateUserSecretCreated describes a response with status code 201, with default header values.

response when creating a secret
*/
type UpdateUserSecretCreated struct {
}

// IsSuccess returns true when this update user secret created response has a 2xx status code
func (o *UpdateUserSecretCreated) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update user secret created response has a 3xx status code
func (o *UpdateUserSecretCreated) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update user secret created response has a 4xx status code
func (o *UpdateUserSecretCreated) IsClientError() bool {
	return false
}

// IsServerError returns true when this update user secret created response has a 5xx status code
func (o *UpdateUserSecretCreated) IsServerError() bool {
	return false
}

// IsCode returns true when this update user secret created response a status code equal to that given
func (o *UpdateUserSecretCreated) IsCode(code int) bool {
	return code == 201
}

// Code gets the status code for the update user secret created response
func (o *UpdateUserSecretCreated) Code() int {
	return 201
}

func (o *UpdateUserSecretCreated) Error() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretCreated", 201)
}

func (o *UpdateUserSecretCreated) String() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretCreated", 201)
}

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

	return nil
}

// NewUpdateUserSecretNoContent creates a UpdateUserSecretNoContent with default headers values
func NewUpdateUserSecretNoContent() *UpdateUserSecretNoContent {
	return &UpdateUserSecretNoContent{}
}

/*
UpdateUserSecretNoContent describes a response with status code 204, with default header values.

response when updating a secret
*/
type UpdateUserSecretNoContent struct {
}

// IsSuccess returns true when this update user secret no content response has a 2xx status code
func (o *UpdateUserSecretNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update user secret no content response has a 3xx status code
func (o *UpdateUserSecretNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update user secret no content response has a 4xx status code
func (o *UpdateUserSecretNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this update user secret no content response has a 5xx status code
func (o *UpdateUserSecretNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this update user secret no content response a status code equal to that given
func (o *UpdateUserSecretNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the update user secret no content response
func (o *UpdateUserSecretNoContent) Code() int {
	return 204
}

func (o *UpdateUserSecretNoContent) Error() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretNoContent", 204)
}

func (o *UpdateUserSecretNoContent) String() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretNoContent", 204)
}

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

	return nil
}

// NewUpdateUserSecretBadRequest creates a UpdateUserSecretBadRequest with default headers values
func NewUpdateUserSecretBadRequest() *UpdateUserSecretBadRequest {
	return &UpdateUserSecretBadRequest{}
}

/*
UpdateUserSecretBadRequest describes a response with status code 400, with default header values.

APIError is error format response
*/
type UpdateUserSecretBadRequest struct {
	Message string
	URL     string
}

// IsSuccess returns true when this update user secret bad request response has a 2xx status code
func (o *UpdateUserSecretBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update user secret bad request response has a 3xx status code
func (o *UpdateUserSecretBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update user secret bad request response has a 4xx status code
func (o *UpdateUserSecretBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this update user secret bad request response has a 5xx status code
func (o *UpdateUserSecretBadRequest) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update user secret bad request response
func (o *UpdateUserSecretBadRequest) Code() int {
	return 400
}

func (o *UpdateUserSecretBadRequest) Error() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretBadRequest", 400)
}

func (o *UpdateUserSecretBadRequest) String() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretBadRequest", 400)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}

// NewUpdateUserSecretNotFound creates a UpdateUserSecretNotFound with default headers values
func NewUpdateUserSecretNotFound() *UpdateUserSecretNotFound {
	return &UpdateUserSecretNotFound{}
}

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

APINotFound is a not found empty response
*/
type UpdateUserSecretNotFound struct {
}

// IsSuccess returns true when this update user secret not found response has a 2xx status code
func (o *UpdateUserSecretNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update user secret not found response has a 3xx status code
func (o *UpdateUserSecretNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update user secret not found response has a 4xx status code
func (o *UpdateUserSecretNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this update user secret not found response has a 5xx status code
func (o *UpdateUserSecretNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the update user secret not found response
func (o *UpdateUserSecretNotFound) Code() int {
	return 404
}

func (o *UpdateUserSecretNotFound) Error() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretNotFound", 404)
}

func (o *UpdateUserSecretNotFound) String() string {
	return fmt.Sprintf("[PUT /user/actions/secrets/{secretname}][%d] updateUserSecretNotFound", 404)
}

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

	return nil
}
