// 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 (
	"encoding/json"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"src.opensuse.org/autogits/common/gitea-generated/models"
)

// RepoGetPushMirrorByRemoteNameReader is a Reader for the RepoGetPushMirrorByRemoteName structure.
type RepoGetPushMirrorByRemoteNameReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *RepoGetPushMirrorByRemoteNameReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewRepoGetPushMirrorByRemoteNameOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewRepoGetPushMirrorByRemoteNameBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewRepoGetPushMirrorByRemoteNameForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewRepoGetPushMirrorByRemoteNameNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /repos/{owner}/{repo}/push_mirrors/{name}] repoGetPushMirrorByRemoteName", response, response.Code())
	}
}

// NewRepoGetPushMirrorByRemoteNameOK creates a RepoGetPushMirrorByRemoteNameOK with default headers values
func NewRepoGetPushMirrorByRemoteNameOK() *RepoGetPushMirrorByRemoteNameOK {
	return &RepoGetPushMirrorByRemoteNameOK{}
}

/*
RepoGetPushMirrorByRemoteNameOK describes a response with status code 200, with default header values.

PushMirror
*/
type RepoGetPushMirrorByRemoteNameOK struct {
	Payload *models.PushMirror
}

// IsSuccess returns true when this repo get push mirror by remote name o k response has a 2xx status code
func (o *RepoGetPushMirrorByRemoteNameOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this repo get push mirror by remote name o k response has a 3xx status code
func (o *RepoGetPushMirrorByRemoteNameOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo get push mirror by remote name o k response has a 4xx status code
func (o *RepoGetPushMirrorByRemoteNameOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this repo get push mirror by remote name o k response has a 5xx status code
func (o *RepoGetPushMirrorByRemoteNameOK) IsServerError() bool {
	return false
}

// IsCode returns true when this repo get push mirror by remote name o k response a status code equal to that given
func (o *RepoGetPushMirrorByRemoteNameOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the repo get push mirror by remote name o k response
func (o *RepoGetPushMirrorByRemoteNameOK) Code() int {
	return 200
}

func (o *RepoGetPushMirrorByRemoteNameOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoGetPushMirrorByRemoteNameOK %s", 200, payload)
}

func (o *RepoGetPushMirrorByRemoteNameOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoGetPushMirrorByRemoteNameOK %s", 200, payload)
}

func (o *RepoGetPushMirrorByRemoteNameOK) GetPayload() *models.PushMirror {
	return o.Payload
}

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

	o.Payload = new(models.PushMirror)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewRepoGetPushMirrorByRemoteNameBadRequest creates a RepoGetPushMirrorByRemoteNameBadRequest with default headers values
func NewRepoGetPushMirrorByRemoteNameBadRequest() *RepoGetPushMirrorByRemoteNameBadRequest {
	return &RepoGetPushMirrorByRemoteNameBadRequest{}
}

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

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

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

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

// IsClientError returns true when this repo get push mirror by remote name bad request response has a 4xx status code
func (o *RepoGetPushMirrorByRemoteNameBadRequest) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the repo get push mirror by remote name bad request response
func (o *RepoGetPushMirrorByRemoteNameBadRequest) Code() int {
	return 400
}

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

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

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

// NewRepoGetPushMirrorByRemoteNameForbidden creates a RepoGetPushMirrorByRemoteNameForbidden with default headers values
func NewRepoGetPushMirrorByRemoteNameForbidden() *RepoGetPushMirrorByRemoteNameForbidden {
	return &RepoGetPushMirrorByRemoteNameForbidden{}
}

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

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

// IsSuccess returns true when this repo get push mirror by remote name forbidden response has a 2xx status code
func (o *RepoGetPushMirrorByRemoteNameForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this repo get push mirror by remote name forbidden response has a 3xx status code
func (o *RepoGetPushMirrorByRemoteNameForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this repo get push mirror by remote name forbidden response has a 4xx status code
func (o *RepoGetPushMirrorByRemoteNameForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this repo get push mirror by remote name forbidden response has a 5xx status code
func (o *RepoGetPushMirrorByRemoteNameForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this repo get push mirror by remote name forbidden response a status code equal to that given
func (o *RepoGetPushMirrorByRemoteNameForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the repo get push mirror by remote name forbidden response
func (o *RepoGetPushMirrorByRemoteNameForbidden) Code() int {
	return 403
}

func (o *RepoGetPushMirrorByRemoteNameForbidden) Error() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoGetPushMirrorByRemoteNameForbidden", 403)
}

func (o *RepoGetPushMirrorByRemoteNameForbidden) String() string {
	return fmt.Sprintf("[GET /repos/{owner}/{repo}/push_mirrors/{name}][%d] repoGetPushMirrorByRemoteNameForbidden", 403)
}

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

// NewRepoGetPushMirrorByRemoteNameNotFound creates a RepoGetPushMirrorByRemoteNameNotFound with default headers values
func NewRepoGetPushMirrorByRemoteNameNotFound() *RepoGetPushMirrorByRemoteNameNotFound {
	return &RepoGetPushMirrorByRemoteNameNotFound{}
}

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

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

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

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

// IsClientError returns true when this repo get push mirror by remote name not found response has a 4xx status code
func (o *RepoGetPushMirrorByRemoteNameNotFound) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the repo get push mirror by remote name not found response
func (o *RepoGetPushMirrorByRemoteNameNotFound) Code() int {
	return 404
}

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

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

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

	return nil
}
