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

// DeleteRepoSecretReader is a Reader for the DeleteRepoSecret structure.
type DeleteRepoSecretReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteRepoSecretReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewDeleteRepoSecretNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewDeleteRepoSecretBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteRepoSecretNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /repos/{owner}/{repo}/actions/secrets/{secretname}] deleteRepoSecret", response, response.Code())
	}
}

// NewDeleteRepoSecretNoContent creates a DeleteRepoSecretNoContent with default headers values
func NewDeleteRepoSecretNoContent() *DeleteRepoSecretNoContent {
	return &DeleteRepoSecretNoContent{}
}

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

delete one secret of the organization
*/
type DeleteRepoSecretNoContent struct {
}

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

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

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

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

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

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

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

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

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

	return nil
}

// NewDeleteRepoSecretBadRequest creates a DeleteRepoSecretBadRequest with default headers values
func NewDeleteRepoSecretBadRequest() *DeleteRepoSecretBadRequest {
	return &DeleteRepoSecretBadRequest{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewDeleteRepoSecretNotFound creates a DeleteRepoSecretNotFound with default headers values
func NewDeleteRepoSecretNotFound() *DeleteRepoSecretNotFound {
	return &DeleteRepoSecretNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

	return nil
}