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

package repository

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

// UpdateRepoSecretReader is a Reader for the UpdateRepoSecret structure.
type UpdateRepoSecretReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateRepoSecretReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 201:
		result := NewUpdateRepoSecretCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewUpdateRepoSecretNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateRepoSecretBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateRepoSecretNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}] updateRepoSecret", response, response.Code())
	}
}

// NewUpdateRepoSecretCreated creates a UpdateRepoSecretCreated with default headers values
func NewUpdateRepoSecretCreated() *UpdateRepoSecretCreated {
	return &UpdateRepoSecretCreated{}
}

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

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

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

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

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

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

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

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

func (o *UpdateRepoSecretCreated) Error() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretCreated", 201)
}

func (o *UpdateRepoSecretCreated) String() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretCreated", 201)
}

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

	return nil
}

// NewUpdateRepoSecretNoContent creates a UpdateRepoSecretNoContent with default headers values
func NewUpdateRepoSecretNoContent() *UpdateRepoSecretNoContent {
	return &UpdateRepoSecretNoContent{}
}

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

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

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

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

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

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

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

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

func (o *UpdateRepoSecretNoContent) Error() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretNoContent", 204)
}

func (o *UpdateRepoSecretNoContent) String() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretNoContent", 204)
}

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

	return nil
}

// NewUpdateRepoSecretBadRequest creates a UpdateRepoSecretBadRequest with default headers values
func NewUpdateRepoSecretBadRequest() *UpdateRepoSecretBadRequest {
	return &UpdateRepoSecretBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *UpdateRepoSecretBadRequest) Error() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretBadRequest", 400)
}

func (o *UpdateRepoSecretBadRequest) String() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretBadRequest", 400)
}

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

// NewUpdateRepoSecretNotFound creates a UpdateRepoSecretNotFound with default headers values
func NewUpdateRepoSecretNotFound() *UpdateRepoSecretNotFound {
	return &UpdateRepoSecretNotFound{}
}

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

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

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

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

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

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

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

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

func (o *UpdateRepoSecretNotFound) Error() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretNotFound", 404)
}

func (o *UpdateRepoSecretNotFound) String() string {
	return fmt.Sprintf("[PUT /repos/{owner}/{repo}/actions/secrets/{secretname}][%d] updateRepoSecretNotFound", 404)
}

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

	return nil
}
