mirror of
https://github.com/openziti/zrok.git
synced 2025-03-03 17:41:29 +01:00
383 lines
10 KiB
Go
383 lines
10 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package metadata
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
|
|
"github.com/openziti/zrok/rest_model_zrok"
|
|
)
|
|
|
|
// GetSparklinesReader is a Reader for the GetSparklines structure.
|
|
type GetSparklinesReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetSparklinesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetSparklinesOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetSparklinesUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetSparklinesInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[POST /sparklines] getSparklines", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetSparklinesOK creates a GetSparklinesOK with default headers values
|
|
func NewGetSparklinesOK() *GetSparklinesOK {
|
|
return &GetSparklinesOK{}
|
|
}
|
|
|
|
/*
|
|
GetSparklinesOK describes a response with status code 200, with default header values.
|
|
|
|
sparklines data
|
|
*/
|
|
type GetSparklinesOK struct {
|
|
Payload *GetSparklinesOKBody
|
|
}
|
|
|
|
// IsSuccess returns true when this get sparklines o k response has a 2xx status code
|
|
func (o *GetSparklinesOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this get sparklines o k response has a 3xx status code
|
|
func (o *GetSparklinesOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get sparklines o k response has a 4xx status code
|
|
func (o *GetSparklinesOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get sparklines o k response has a 5xx status code
|
|
func (o *GetSparklinesOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get sparklines o k response a status code equal to that given
|
|
func (o *GetSparklinesOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the get sparklines o k response
|
|
func (o *GetSparklinesOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *GetSparklinesOK) Error() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetSparklinesOK) String() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetSparklinesOK) GetPayload() *GetSparklinesOKBody {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetSparklinesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(GetSparklinesOKBody)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetSparklinesUnauthorized creates a GetSparklinesUnauthorized with default headers values
|
|
func NewGetSparklinesUnauthorized() *GetSparklinesUnauthorized {
|
|
return &GetSparklinesUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
GetSparklinesUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
unauthorized
|
|
*/
|
|
type GetSparklinesUnauthorized struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this get sparklines unauthorized response has a 2xx status code
|
|
func (o *GetSparklinesUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get sparklines unauthorized response has a 3xx status code
|
|
func (o *GetSparklinesUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get sparklines unauthorized response has a 4xx status code
|
|
func (o *GetSparklinesUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get sparklines unauthorized response has a 5xx status code
|
|
func (o *GetSparklinesUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get sparklines unauthorized response a status code equal to that given
|
|
func (o *GetSparklinesUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the get sparklines unauthorized response
|
|
func (o *GetSparklinesUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *GetSparklinesUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized ", 401)
|
|
}
|
|
|
|
func (o *GetSparklinesUnauthorized) String() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized ", 401)
|
|
}
|
|
|
|
func (o *GetSparklinesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetSparklinesInternalServerError creates a GetSparklinesInternalServerError with default headers values
|
|
func NewGetSparklinesInternalServerError() *GetSparklinesInternalServerError {
|
|
return &GetSparklinesInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
GetSparklinesInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
internal server error
|
|
*/
|
|
type GetSparklinesInternalServerError struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this get sparklines internal server error response has a 2xx status code
|
|
func (o *GetSparklinesInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get sparklines internal server error response has a 3xx status code
|
|
func (o *GetSparklinesInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get sparklines internal server error response has a 4xx status code
|
|
func (o *GetSparklinesInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get sparklines internal server error response has a 5xx status code
|
|
func (o *GetSparklinesInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this get sparklines internal server error response a status code equal to that given
|
|
func (o *GetSparklinesInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the get sparklines internal server error response
|
|
func (o *GetSparklinesInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *GetSparklinesInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError ", 500)
|
|
}
|
|
|
|
func (o *GetSparklinesInternalServerError) String() string {
|
|
return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError ", 500)
|
|
}
|
|
|
|
func (o *GetSparklinesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
/*
|
|
GetSparklinesBody get sparklines body
|
|
swagger:model GetSparklinesBody
|
|
*/
|
|
type GetSparklinesBody struct {
|
|
|
|
// account
|
|
Account bool `json:"account,omitempty"`
|
|
|
|
// environments
|
|
Environments []string `json:"environments"`
|
|
|
|
// shares
|
|
Shares []string `json:"shares"`
|
|
}
|
|
|
|
// Validate validates this get sparklines body
|
|
func (o *GetSparklinesBody) Validate(formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this get sparklines body based on context it is used
|
|
func (o *GetSparklinesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetSparklinesBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetSparklinesBody) UnmarshalBinary(b []byte) error {
|
|
var res GetSparklinesBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*
|
|
GetSparklinesOKBody get sparklines o k body
|
|
swagger:model GetSparklinesOKBody
|
|
*/
|
|
type GetSparklinesOKBody struct {
|
|
|
|
// sparklines
|
|
Sparklines []*rest_model_zrok.Metrics `json:"sparklines"`
|
|
}
|
|
|
|
// Validate validates this get sparklines o k body
|
|
func (o *GetSparklinesOKBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateSparklines(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetSparklinesOKBody) validateSparklines(formats strfmt.Registry) error {
|
|
if swag.IsZero(o.Sparklines) { // not required
|
|
return nil
|
|
}
|
|
|
|
for i := 0; i < len(o.Sparklines); i++ {
|
|
if swag.IsZero(o.Sparklines[i]) { // not required
|
|
continue
|
|
}
|
|
|
|
if o.Sparklines[i] != nil {
|
|
if err := o.Sparklines[i].Validate(formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("getSparklinesOK" + "." + "sparklines" + "." + strconv.Itoa(i))
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("getSparklinesOK" + "." + "sparklines" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validate this get sparklines o k body based on the context it is used
|
|
func (o *GetSparklinesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.contextValidateSparklines(ctx, formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetSparklinesOKBody) contextValidateSparklines(ctx context.Context, formats strfmt.Registry) error {
|
|
|
|
for i := 0; i < len(o.Sparklines); i++ {
|
|
|
|
if o.Sparklines[i] != nil {
|
|
|
|
if swag.IsZero(o.Sparklines[i]) { // not required
|
|
return nil
|
|
}
|
|
|
|
if err := o.Sparklines[i].ContextValidate(ctx, formats); err != nil {
|
|
if ve, ok := err.(*errors.Validation); ok {
|
|
return ve.ValidateName("getSparklinesOK" + "." + "sparklines" + "." + strconv.Itoa(i))
|
|
} else if ce, ok := err.(*errors.CompositeError); ok {
|
|
return ce.ValidateName("getSparklinesOK" + "." + "sparklines" + "." + strconv.Itoa(i))
|
|
}
|
|
return err
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *GetSparklinesOKBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *GetSparklinesOKBody) UnmarshalBinary(b []byte) error {
|
|
var res GetSparklinesOKBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|