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

// RepoDeleteReleaseByTagReader is a Reader for the RepoDeleteReleaseByTag structure.
type RepoDeleteReleaseByTagReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoDeleteReleaseByTagReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoDeleteReleaseByTagNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewRepoDeleteReleaseByTagNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewRepoDeleteReleaseByTagUnprocessableEntity()
		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}/releases/tags/{tag}] repoDeleteReleaseByTag", response, response.Code())
	}
}

// NewRepoDeleteReleaseByTagNoContent creates a RepoDeleteReleaseByTagNoContent with default headers values
func NewRepoDeleteReleaseByTagNoContent() *RepoDeleteReleaseByTagNoContent {
	return &RepoDeleteReleaseByTagNoContent{}
}

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

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

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

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

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

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

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

// Code gets the status code for the repo delete release by tag no content response
func (o *RepoDeleteReleaseByTagNoContent) Code() int {
	return 204
}

func (o *RepoDeleteReleaseByTagNoContent) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagNoContent", 204)
}

func (o *RepoDeleteReleaseByTagNoContent) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagNoContent", 204)
}

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

	return nil
}

// NewRepoDeleteReleaseByTagNotFound creates a RepoDeleteReleaseByTagNotFound with default headers values
func NewRepoDeleteReleaseByTagNotFound() *RepoDeleteReleaseByTagNotFound {
	return &RepoDeleteReleaseByTagNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the repo delete release by tag not found response
func (o *RepoDeleteReleaseByTagNotFound) Code() int {
	return 404
}

func (o *RepoDeleteReleaseByTagNotFound) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagNotFound", 404)
}

func (o *RepoDeleteReleaseByTagNotFound) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagNotFound", 404)
}

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

	return nil
}

// NewRepoDeleteReleaseByTagUnprocessableEntity creates a RepoDeleteReleaseByTagUnprocessableEntity with default headers values
func NewRepoDeleteReleaseByTagUnprocessableEntity() *RepoDeleteReleaseByTagUnprocessableEntity {
	return &RepoDeleteReleaseByTagUnprocessableEntity{}
}

/*
RepoDeleteReleaseByTagUnprocessableEntity describes a response with status code 422, with default header values.

APIValidationError is error format response related to input validation
*/
type RepoDeleteReleaseByTagUnprocessableEntity struct {
	Message string
	URL     string
}

// IsSuccess returns true when this repo delete release by tag unprocessable entity response has a 2xx status code
func (o *RepoDeleteReleaseByTagUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo delete release by tag unprocessable entity response has a 3xx status code
func (o *RepoDeleteReleaseByTagUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo delete release by tag unprocessable entity response has a 4xx status code
func (o *RepoDeleteReleaseByTagUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo delete release by tag unprocessable entity response has a 5xx status code
func (o *RepoDeleteReleaseByTagUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this repo delete release by tag unprocessable entity response a status code equal to that given
func (o *RepoDeleteReleaseByTagUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the repo delete release by tag unprocessable entity response
func (o *RepoDeleteReleaseByTagUnprocessableEntity) Code() int {
	return 422
}

func (o *RepoDeleteReleaseByTagUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagUnprocessableEntity", 422)
}

func (o *RepoDeleteReleaseByTagUnprocessableEntity) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/releases/tags/{tag}][%d] repoDeleteReleaseByTagUnprocessableEntity", 422)
}

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