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

// GetContactpointsExportReader is a Reader for the GetContactpointsExport structure.
type GetContactpointsExportReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetContactpointsExportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetContactpointsExportOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewGetContactpointsExportForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /v1/provisioning/contact-points/export] GetContactpointsExport", response, response.Code())
	}
}

// NewGetContactpointsExportOK creates a GetContactpointsExportOK with default headers values
func NewGetContactpointsExportOK() *GetContactpointsExportOK {
	return &GetContactpointsExportOK{}
}

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

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

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

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

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

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

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

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

func (o *GetContactpointsExportOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/contact-points/export][%d] getContactpointsExportOk %s", 200, payload)
}

func (o *GetContactpointsExportOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/contact-points/export][%d] getContactpointsExportOk %s", 200, payload)
}

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

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

// NewGetContactpointsExportForbidden creates a GetContactpointsExportForbidden with default headers values
func NewGetContactpointsExportForbidden() *GetContactpointsExportForbidden {
	return &GetContactpointsExportForbidden{}
}

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

PermissionDenied
*/
type GetContactpointsExportForbidden struct {
	Payload models.PermissionDenied
}

// IsSuccess returns true when this get contactpoints export forbidden response has a 2xx status code
func (o *GetContactpointsExportForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get contactpoints export forbidden response has a 3xx status code
func (o *GetContactpointsExportForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get contactpoints export forbidden response has a 4xx status code
func (o *GetContactpointsExportForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get contactpoints export forbidden response has a 5xx status code
func (o *GetContactpointsExportForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get contactpoints export forbidden response a status code equal to that given
func (o *GetContactpointsExportForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get contactpoints export forbidden response
func (o *GetContactpointsExportForbidden) Code() int {
	return 403
}

func (o *GetContactpointsExportForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/contact-points/export][%d] getContactpointsExportForbidden %s", 403, payload)
}

func (o *GetContactpointsExportForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/provisioning/contact-points/export][%d] getContactpointsExportForbidden %s", 403, payload)
}

func (o *GetContactpointsExportForbidden) GetPayload() models.PermissionDenied {
	return o.Payload
}

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

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

	return nil
}
