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

// RepoDeletePushMirrorReader is a Reader for the RepoDeletePushMirror structure.
type RepoDeletePushMirrorReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoDeletePushMirrorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewRepoDeletePushMirrorNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewRepoDeletePushMirrorBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRepoDeletePushMirrorNotFound()
		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}/push_mirrors/{name}] repoDeletePushMirror", response, response.Code())
	}
}

// NewRepoDeletePushMirrorNoContent creates a RepoDeletePushMirrorNoContent with default headers values
func NewRepoDeletePushMirrorNoContent() *RepoDeletePushMirrorNoContent {
	return &RepoDeletePushMirrorNoContent{}
}

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

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

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

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

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

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

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

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

func (o *RepoDeletePushMirrorNoContent) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorNoContent", 204)
}

func (o *RepoDeletePushMirrorNoContent) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorNoContent", 204)
}

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

	return nil
}

// NewRepoDeletePushMirrorBadRequest creates a RepoDeletePushMirrorBadRequest with default headers values
func NewRepoDeletePushMirrorBadRequest() *RepoDeletePushMirrorBadRequest {
	return &RepoDeletePushMirrorBadRequest{}
}

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

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

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

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

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

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

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

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

func (o *RepoDeletePushMirrorBadRequest) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorBadRequest", 400)
}

func (o *RepoDeletePushMirrorBadRequest) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorBadRequest", 400)
}

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

// NewRepoDeletePushMirrorNotFound creates a RepoDeletePushMirrorNotFound with default headers values
func NewRepoDeletePushMirrorNotFound() *RepoDeletePushMirrorNotFound {
	return &RepoDeletePushMirrorNotFound{}
}

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

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

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

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

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

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

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

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

func (o *RepoDeletePushMirrorNotFound) Error() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorNotFound", 404)
}

func (o *RepoDeletePushMirrorNotFound) String() string {
	return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoDeletePushMirrorNotFound", 404)
}

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

	return nil
}
