gtslib/client/instance/instance_get_v1_responses.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

231 lines
7.0 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package instance
// 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"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// InstanceGetV1Reader is a Reader for the InstanceGetV1 structure.
type InstanceGetV1Reader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *InstanceGetV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewInstanceGetV1OK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 406:
result := NewInstanceGetV1NotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewInstanceGetV1InternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/instance] instanceGetV1", response, response.Code())
}
}
// NewInstanceGetV1OK creates a InstanceGetV1OK with default headers values
func NewInstanceGetV1OK() *InstanceGetV1OK {
return &InstanceGetV1OK{}
}
/*
InstanceGetV1OK describes a response with status code 200, with default header values.
Instance information.
*/
type InstanceGetV1OK struct {
Payload *models.InstanceV1
}
// IsSuccess returns true when this instance get v1 o k response has a 2xx status code
func (o *InstanceGetV1OK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this instance get v1 o k response has a 3xx status code
func (o *InstanceGetV1OK) IsRedirect() bool {
return false
}
// IsClientError returns true when this instance get v1 o k response has a 4xx status code
func (o *InstanceGetV1OK) IsClientError() bool {
return false
}
// IsServerError returns true when this instance get v1 o k response has a 5xx status code
func (o *InstanceGetV1OK) IsServerError() bool {
return false
}
// IsCode returns true when this instance get v1 o k response a status code equal to that given
func (o *InstanceGetV1OK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the instance get v1 o k response
func (o *InstanceGetV1OK) Code() int {
return 200
}
func (o *InstanceGetV1OK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1OK %s", 200, payload)
}
func (o *InstanceGetV1OK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1OK %s", 200, payload)
}
func (o *InstanceGetV1OK) GetPayload() *models.InstanceV1 {
return o.Payload
}
func (o *InstanceGetV1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.InstanceV1)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewInstanceGetV1NotAcceptable creates a InstanceGetV1NotAcceptable with default headers values
func NewInstanceGetV1NotAcceptable() *InstanceGetV1NotAcceptable {
return &InstanceGetV1NotAcceptable{}
}
/*
InstanceGetV1NotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type InstanceGetV1NotAcceptable struct {
}
// IsSuccess returns true when this instance get v1 not acceptable response has a 2xx status code
func (o *InstanceGetV1NotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this instance get v1 not acceptable response has a 3xx status code
func (o *InstanceGetV1NotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this instance get v1 not acceptable response has a 4xx status code
func (o *InstanceGetV1NotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this instance get v1 not acceptable response has a 5xx status code
func (o *InstanceGetV1NotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this instance get v1 not acceptable response a status code equal to that given
func (o *InstanceGetV1NotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the instance get v1 not acceptable response
func (o *InstanceGetV1NotAcceptable) Code() int {
return 406
}
func (o *InstanceGetV1NotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1NotAcceptable", 406)
}
func (o *InstanceGetV1NotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1NotAcceptable", 406)
}
func (o *InstanceGetV1NotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewInstanceGetV1InternalServerError creates a InstanceGetV1InternalServerError with default headers values
func NewInstanceGetV1InternalServerError() *InstanceGetV1InternalServerError {
return &InstanceGetV1InternalServerError{}
}
/*
InstanceGetV1InternalServerError describes a response with status code 500, with default header values.
internal error
*/
type InstanceGetV1InternalServerError struct {
}
// IsSuccess returns true when this instance get v1 internal server error response has a 2xx status code
func (o *InstanceGetV1InternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this instance get v1 internal server error response has a 3xx status code
func (o *InstanceGetV1InternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this instance get v1 internal server error response has a 4xx status code
func (o *InstanceGetV1InternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this instance get v1 internal server error response has a 5xx status code
func (o *InstanceGetV1InternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this instance get v1 internal server error response a status code equal to that given
func (o *InstanceGetV1InternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the instance get v1 internal server error response
func (o *InstanceGetV1InternalServerError) Code() int {
return 500
}
func (o *InstanceGetV1InternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1InternalServerError", 500)
}
func (o *InstanceGetV1InternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/instance][%d] instanceGetV1InternalServerError", 500)
}
func (o *InstanceGetV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}