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

package training_data

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"

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

	"github.com/IBM/FfDL/restapi/api_v1/restmodels"
)

// GetEMetricsReader is a Reader for the GetEMetrics structure.
type GetEMetricsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetEMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {

	case 200:
		result := NewGetEMetricsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil

	case 401:
		result := NewGetEMetricsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewGetEMetricsOK creates a GetEMetricsOK with default headers values
func NewGetEMetricsOK() *GetEMetricsOK {
	return &GetEMetricsOK{}
}

/*GetEMetricsOK handles this case with default header values.

(streaming responses)
*/
type GetEMetricsOK struct {
	Payload *restmodels.V1EMetricsList
}

func (o *GetEMetricsOK) Error() string {
	return fmt.Sprintf("[GET /v1/logs/{model_id}/emetrics][%d] getEMetricsOK  %+v", 200, o.Payload)
}

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

	o.Payload = new(restmodels.V1EMetricsList)

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

	return nil
}

// NewGetEMetricsUnauthorized creates a GetEMetricsUnauthorized with default headers values
func NewGetEMetricsUnauthorized() *GetEMetricsUnauthorized {
	return &GetEMetricsUnauthorized{}
}

/*GetEMetricsUnauthorized handles this case with default header values.

Unauthorized
*/
type GetEMetricsUnauthorized struct {
	Payload *restmodels.Error
}

func (o *GetEMetricsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /v1/logs/{model_id}/emetrics][%d] getEMetricsUnauthorized  %+v", 401, o.Payload)
}

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

	o.Payload = new(restmodels.Error)

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

	return nil
}
