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

// RepoDeleteKeyReader is a Reader for the RepoDeleteKey structure.
type RepoDeleteKeyReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoDeleteKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoDeleteKeyNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewRepoDeleteKeyForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRepoDeleteKeyNotFound()
		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}/keys/{id}] repoDeleteKey", response, response.Code())
	}
}

// NewRepoDeleteKeyNoContent creates a RepoDeleteKeyNoContent with default headers values
func NewRepoDeleteKeyNoContent() *RepoDeleteKeyNoContent {
	return &RepoDeleteKeyNoContent{}
}

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

APIEmpty is an empty response
*/
type RepoDeleteKeyNoContent struct {
}

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

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

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

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

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

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

func (o *RepoDeleteKeyNoContent) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyNoContent", 204)
}

func (o *RepoDeleteKeyNoContent) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyNoContent", 204)
}

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

	return nil
}

// NewRepoDeleteKeyForbidden creates a RepoDeleteKeyForbidden with default headers values
func NewRepoDeleteKeyForbidden() *RepoDeleteKeyForbidden {
	return &RepoDeleteKeyForbidden{}
}

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

APIForbiddenError is a forbidden error response
*/
type RepoDeleteKeyForbidden struct {
	Message string
	URL     string
}

// IsSuccess returns true when this repo delete key forbidden response has a 2xx status code
func (o *RepoDeleteKeyForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo delete key forbidden response has a 3xx status code
func (o *RepoDeleteKeyForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo delete key forbidden response has a 4xx status code
func (o *RepoDeleteKeyForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo delete key forbidden response has a 5xx status code
func (o *RepoDeleteKeyForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this repo delete key forbidden response a status code equal to that given
func (o *RepoDeleteKeyForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the repo delete key forbidden response
func (o *RepoDeleteKeyForbidden) Code() int {
	return 403
}

func (o *RepoDeleteKeyForbidden) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyForbidden", 403)
}

func (o *RepoDeleteKeyForbidden) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyForbidden", 403)
}

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

// NewRepoDeleteKeyNotFound creates a RepoDeleteKeyNotFound with default headers values
func NewRepoDeleteKeyNotFound() *RepoDeleteKeyNotFound {
	return &RepoDeleteKeyNotFound{}
}

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

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

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

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

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

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

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

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

func (o *RepoDeleteKeyNotFound) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyNotFound", 404)
}

func (o *RepoDeleteKeyNotFound) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/keys/{id}][%d] repoDeleteKeyNotFound", 404)
}

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

	return nil
}
