This change adds the API endpoints, the CLI commands and the web UI elements needed to manage objects in GARMs internal storage. This storage system is meant to be used to distribute the garm-agent and as a single source of truth for provider binaries, when we will add the ability for GARM to scale out. Potentially, we can also use this in air gapped systems to distribute the runner binaries for forges that don't have their own internal storage system (like GHES). Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
179 lines
5.3 KiB
Go
179 lines
5.3 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package objects
|
|
|
|
// 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"
|
|
|
|
apiserver_params "github.com/cloudbase/garm/apiserver/params"
|
|
garm_params "github.com/cloudbase/garm/params"
|
|
)
|
|
|
|
// UpdateFileObjectReader is a Reader for the UpdateFileObject structure.
|
|
type UpdateFileObjectReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *UpdateFileObjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewUpdateFileObjectOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 400:
|
|
result := NewUpdateFileObjectBadRequest()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[PUT /objects/{objectID}] UpdateFileObject", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewUpdateFileObjectOK creates a UpdateFileObjectOK with default headers values
|
|
func NewUpdateFileObjectOK() *UpdateFileObjectOK {
|
|
return &UpdateFileObjectOK{}
|
|
}
|
|
|
|
/*
|
|
UpdateFileObjectOK describes a response with status code 200, with default header values.
|
|
|
|
FileObject
|
|
*/
|
|
type UpdateFileObjectOK struct {
|
|
Payload garm_params.FileObject
|
|
}
|
|
|
|
// IsSuccess returns true when this update file object o k response has a 2xx status code
|
|
func (o *UpdateFileObjectOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this update file object o k response has a 3xx status code
|
|
func (o *UpdateFileObjectOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this update file object o k response has a 4xx status code
|
|
func (o *UpdateFileObjectOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this update file object o k response has a 5xx status code
|
|
func (o *UpdateFileObjectOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this update file object o k response a status code equal to that given
|
|
func (o *UpdateFileObjectOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the update file object o k response
|
|
func (o *UpdateFileObjectOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *UpdateFileObjectOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /objects/{objectID}][%d] updateFileObjectOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *UpdateFileObjectOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /objects/{objectID}][%d] updateFileObjectOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *UpdateFileObjectOK) GetPayload() garm_params.FileObject {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *UpdateFileObjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewUpdateFileObjectBadRequest creates a UpdateFileObjectBadRequest with default headers values
|
|
func NewUpdateFileObjectBadRequest() *UpdateFileObjectBadRequest {
|
|
return &UpdateFileObjectBadRequest{}
|
|
}
|
|
|
|
/*
|
|
UpdateFileObjectBadRequest describes a response with status code 400, with default header values.
|
|
|
|
APIErrorResponse
|
|
*/
|
|
type UpdateFileObjectBadRequest struct {
|
|
Payload apiserver_params.APIErrorResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this update file object bad request response has a 2xx status code
|
|
func (o *UpdateFileObjectBadRequest) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this update file object bad request response has a 3xx status code
|
|
func (o *UpdateFileObjectBadRequest) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this update file object bad request response has a 4xx status code
|
|
func (o *UpdateFileObjectBadRequest) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this update file object bad request response has a 5xx status code
|
|
func (o *UpdateFileObjectBadRequest) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this update file object bad request response a status code equal to that given
|
|
func (o *UpdateFileObjectBadRequest) IsCode(code int) bool {
|
|
return code == 400
|
|
}
|
|
|
|
// Code gets the status code for the update file object bad request response
|
|
func (o *UpdateFileObjectBadRequest) Code() int {
|
|
return 400
|
|
}
|
|
|
|
func (o *UpdateFileObjectBadRequest) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /objects/{objectID}][%d] updateFileObjectBadRequest %s", 400, payload)
|
|
}
|
|
|
|
func (o *UpdateFileObjectBadRequest) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[PUT /objects/{objectID}][%d] updateFileObjectBadRequest %s", 400, payload)
|
|
}
|
|
|
|
func (o *UpdateFileObjectBadRequest) GetPayload() apiserver_params.APIErrorResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *UpdateFileObjectBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|