// Code generated by go-swagger; DO NOT EDIT.

package provisioning

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

	"github.com/grafana/grafana-openapi-client-go/models"
)

// GetAlertRuleExportReader is a Reader for the GetAlertRuleExport structure.
type GetAlertRuleExportReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAlertRuleExportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetAlertRuleExportOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 404:
		result := NewGetAlertRuleExportNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /v1/provisioning/alert-rules/{UID}/export] GetAlertRuleExport", response, response.Code())
	}
}

// NewGetAlertRuleExportOK creates a GetAlertRuleExportOK with default headers values
func NewGetAlertRuleExportOK() *GetAlertRuleExportOK {
	return &GetAlertRuleExportOK{}
}

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

AlertingFileExport
*/
type GetAlertRuleExportOK struct {
	Payload *models.AlertingFileExport
}

// IsSuccess returns true when this get alert rule export Ok response has a 2xx status code
func (o *GetAlertRuleExportOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get alert rule export Ok response has a 3xx status code
func (o *GetAlertRuleExportOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get alert rule export Ok response has a 4xx status code
func (o *GetAlertRuleExportOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get alert rule export Ok response has a 5xx status code
func (o *GetAlertRuleExportOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get alert rule export Ok response a status code equal to that given
func (o *GetAlertRuleExportOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get alert rule export Ok response
func (o *GetAlertRuleExportOK) Code() int {
	return 200
}

func (o *GetAlertRuleExportOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/alert-rules/{UID}/export][%d] getAlertRuleExportOk %s", 200, payload)
}

func (o *GetAlertRuleExportOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/alert-rules/{UID}/export][%d] getAlertRuleExportOk %s", 200, payload)
}

func (o *GetAlertRuleExportOK) GetPayload() *models.AlertingFileExport {
	return o.Payload
}

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

	o.Payload = new(models.AlertingFileExport)

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

	return nil
}

// NewGetAlertRuleExportNotFound creates a GetAlertRuleExportNotFound with default headers values
func NewGetAlertRuleExportNotFound() *GetAlertRuleExportNotFound {
	return &GetAlertRuleExportNotFound{}
}

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

	Not found.
*/
type GetAlertRuleExportNotFound struct {
}

// IsSuccess returns true when this get alert rule export not found response has a 2xx status code
func (o *GetAlertRuleExportNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get alert rule export not found response has a 3xx status code
func (o *GetAlertRuleExportNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get alert rule export not found response has a 4xx status code
func (o *GetAlertRuleExportNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get alert rule export not found response has a 5xx status code
func (o *GetAlertRuleExportNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get alert rule export not found response a status code equal to that given
func (o *GetAlertRuleExportNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get alert rule export not found response
func (o *GetAlertRuleExportNotFound) Code() int {
	return 404
}

func (o *GetAlertRuleExportNotFound) Error() string {
	return fmt.Sprintf("[GET /v1/provisioning/alert-rules/{UID}/export][%d] getAlertRuleExportNotFound", 404)
}

func (o *GetAlertRuleExportNotFound) String() string {
	return fmt.Sprintf("[GET /v1/provisioning/alert-rules/{UID}/export][%d] getAlertRuleExportNotFound", 404)
}

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

	return nil
}
