zrok/rest_client_zrok/metadata/version_inventory_responses.go

142 lines
3.8 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"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// VersionInventoryReader is a Reader for the VersionInventory structure.
type VersionInventoryReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *VersionInventoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewVersionInventoryOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("[GET /versions] versionInventory", response, response.Code())
}
}
// NewVersionInventoryOK creates a VersionInventoryOK with default headers values
func NewVersionInventoryOK() *VersionInventoryOK {
return &VersionInventoryOK{}
}
/*
VersionInventoryOK describes a response with status code 200, with default header values.
ok
*/
type VersionInventoryOK struct {
Payload *VersionInventoryOKBody
}
// IsSuccess returns true when this version inventory o k response has a 2xx status code
func (o *VersionInventoryOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this version inventory o k response has a 3xx status code
func (o *VersionInventoryOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this version inventory o k response has a 4xx status code
func (o *VersionInventoryOK) IsClientError() bool {
return false
}
// IsServerError returns true when this version inventory o k response has a 5xx status code
func (o *VersionInventoryOK) IsServerError() bool {
return false
}
// IsCode returns true when this version inventory o k response a status code equal to that given
func (o *VersionInventoryOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the version inventory o k response
func (o *VersionInventoryOK) Code() int {
return 200
}
func (o *VersionInventoryOK) Error() string {
return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %+v", 200, o.Payload)
}
func (o *VersionInventoryOK) String() string {
return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %+v", 200, o.Payload)
}
func (o *VersionInventoryOK) GetPayload() *VersionInventoryOKBody {
return o.Payload
}
func (o *VersionInventoryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(VersionInventoryOKBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
/*
VersionInventoryOKBody version inventory o k body
swagger:model VersionInventoryOKBody
*/
type VersionInventoryOKBody struct {
// controller version
ControllerVersion string `json:"controllerVersion,omitempty"`
}
// Validate validates this version inventory o k body
func (o *VersionInventoryOKBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this version inventory o k body based on context it is used
func (o *VersionInventoryOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *VersionInventoryOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *VersionInventoryOKBody) UnmarshalBinary(b []byte) error {
var res VersionInventoryOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}