zrok/rest_client_zrok/metrics/get_share_metrics_responses.go

156 lines
4.7 KiB
Go
Raw Normal View History

// Code generated by go-swagger; DO NOT EDIT.
package metrics
// 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"
"github.com/go-openapi/strfmt"
"github.com/openziti/zrok/rest_model_zrok"
)
// GetShareMetricsReader is a Reader for the GetShareMetrics structure.
type GetShareMetricsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetShareMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetShareMetricsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetShareMetricsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetShareMetricsOK creates a GetShareMetricsOK with default headers values
func NewGetShareMetricsOK() *GetShareMetricsOK {
return &GetShareMetricsOK{}
}
/*
GetShareMetricsOK describes a response with status code 200, with default header values.
share metrics
*/
type GetShareMetricsOK struct {
Payload *rest_model_zrok.Metrics
}
// IsSuccess returns true when this get share metrics o k response has a 2xx status code
func (o *GetShareMetricsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get share metrics o k response has a 3xx status code
func (o *GetShareMetricsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get share metrics o k response has a 4xx status code
func (o *GetShareMetricsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get share metrics o k response has a 5xx status code
func (o *GetShareMetricsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get share metrics o k response a status code equal to that given
func (o *GetShareMetricsOK) IsCode(code int) bool {
return code == 200
}
func (o *GetShareMetricsOK) Error() string {
return fmt.Sprintf("[GET /metrics/share/{shrToken}][%d] getShareMetricsOK %+v", 200, o.Payload)
}
func (o *GetShareMetricsOK) String() string {
return fmt.Sprintf("[GET /metrics/share/{shrToken}][%d] getShareMetricsOK %+v", 200, o.Payload)
}
func (o *GetShareMetricsOK) GetPayload() *rest_model_zrok.Metrics {
return o.Payload
}
func (o *GetShareMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(rest_model_zrok.Metrics)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetShareMetricsUnauthorized creates a GetShareMetricsUnauthorized with default headers values
func NewGetShareMetricsUnauthorized() *GetShareMetricsUnauthorized {
return &GetShareMetricsUnauthorized{}
}
/*
GetShareMetricsUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type GetShareMetricsUnauthorized struct {
}
// IsSuccess returns true when this get share metrics unauthorized response has a 2xx status code
func (o *GetShareMetricsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get share metrics unauthorized response has a 3xx status code
func (o *GetShareMetricsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get share metrics unauthorized response has a 4xx status code
func (o *GetShareMetricsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get share metrics unauthorized response has a 5xx status code
func (o *GetShareMetricsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get share metrics unauthorized response a status code equal to that given
func (o *GetShareMetricsUnauthorized) IsCode(code int) bool {
return code == 401
}
func (o *GetShareMetricsUnauthorized) Error() string {
return fmt.Sprintf("[GET /metrics/share/{shrToken}][%d] getShareMetricsUnauthorized ", 401)
}
func (o *GetShareMetricsUnauthorized) String() string {
return fmt.Sprintf("[GET /metrics/share/{shrToken}][%d] getShareMetricsUnauthorized ", 401)
}
func (o *GetShareMetricsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}