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>
151 lines
4.3 KiB
Go
151 lines
4.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 (
|
|
"context"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
cr "github.com/go-openapi/runtime/client"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// NewDeleteFileObjectParams creates a new DeleteFileObjectParams object,
|
|
// with the default timeout for this client.
|
|
//
|
|
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
|
//
|
|
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
|
func NewDeleteFileObjectParams() *DeleteFileObjectParams {
|
|
return &DeleteFileObjectParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewDeleteFileObjectParamsWithTimeout creates a new DeleteFileObjectParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewDeleteFileObjectParamsWithTimeout(timeout time.Duration) *DeleteFileObjectParams {
|
|
return &DeleteFileObjectParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewDeleteFileObjectParamsWithContext creates a new DeleteFileObjectParams object
|
|
// with the ability to set a context for a request.
|
|
func NewDeleteFileObjectParamsWithContext(ctx context.Context) *DeleteFileObjectParams {
|
|
return &DeleteFileObjectParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewDeleteFileObjectParamsWithHTTPClient creates a new DeleteFileObjectParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewDeleteFileObjectParamsWithHTTPClient(client *http.Client) *DeleteFileObjectParams {
|
|
return &DeleteFileObjectParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
DeleteFileObjectParams contains all the parameters to send to the API endpoint
|
|
|
|
for the delete file object operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type DeleteFileObjectParams struct {
|
|
|
|
/* ObjectID.
|
|
|
|
The ID of the file object.
|
|
*/
|
|
ObjectID string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the delete file object params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *DeleteFileObjectParams) WithDefaults() *DeleteFileObjectParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the delete file object params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *DeleteFileObjectParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the delete file object params
|
|
func (o *DeleteFileObjectParams) WithTimeout(timeout time.Duration) *DeleteFileObjectParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the delete file object params
|
|
func (o *DeleteFileObjectParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the delete file object params
|
|
func (o *DeleteFileObjectParams) WithContext(ctx context.Context) *DeleteFileObjectParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the delete file object params
|
|
func (o *DeleteFileObjectParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the delete file object params
|
|
func (o *DeleteFileObjectParams) WithHTTPClient(client *http.Client) *DeleteFileObjectParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the delete file object params
|
|
func (o *DeleteFileObjectParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithObjectID adds the objectID to the delete file object params
|
|
func (o *DeleteFileObjectParams) WithObjectID(objectID string) *DeleteFileObjectParams {
|
|
o.SetObjectID(objectID)
|
|
return o
|
|
}
|
|
|
|
// SetObjectID adds the objectId to the delete file object params
|
|
func (o *DeleteFileObjectParams) SetObjectID(objectID string) {
|
|
o.ObjectID = objectID
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *DeleteFileObjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
// path param objectID
|
|
if err := r.SetPathParam("objectID", o.ObjectID); err != nil {
|
|
return err
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|