garm/client/pools/update_pool_parameters.go
Mihaela Balutoiu db21fb6ea9 Update generated swagger client code
Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
2023-07-17 14:24:54 +03:00

173 lines
4.5 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package pools
// 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"
garm_params "github.com/cloudbase/garm/params"
)
// NewUpdatePoolParams creates a new UpdatePoolParams 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 NewUpdatePoolParams() *UpdatePoolParams {
return &UpdatePoolParams{
timeout: cr.DefaultTimeout,
}
}
// NewUpdatePoolParamsWithTimeout creates a new UpdatePoolParams object
// with the ability to set a timeout on a request.
func NewUpdatePoolParamsWithTimeout(timeout time.Duration) *UpdatePoolParams {
return &UpdatePoolParams{
timeout: timeout,
}
}
// NewUpdatePoolParamsWithContext creates a new UpdatePoolParams object
// with the ability to set a context for a request.
func NewUpdatePoolParamsWithContext(ctx context.Context) *UpdatePoolParams {
return &UpdatePoolParams{
Context: ctx,
}
}
// NewUpdatePoolParamsWithHTTPClient creates a new UpdatePoolParams object
// with the ability to set a custom HTTPClient for a request.
func NewUpdatePoolParamsWithHTTPClient(client *http.Client) *UpdatePoolParams {
return &UpdatePoolParams{
HTTPClient: client,
}
}
/*
UpdatePoolParams contains all the parameters to send to the API endpoint
for the update pool operation.
Typically these are written to a http.Request.
*/
type UpdatePoolParams struct {
/* Body.
Parameters to update the pool with.
*/
Body garm_params.UpdatePoolParams
/* PoolID.
ID of the pool to update.
*/
PoolID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the update pool params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *UpdatePoolParams) WithDefaults() *UpdatePoolParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the update pool params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *UpdatePoolParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the update pool params
func (o *UpdatePoolParams) WithTimeout(timeout time.Duration) *UpdatePoolParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the update pool params
func (o *UpdatePoolParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the update pool params
func (o *UpdatePoolParams) WithContext(ctx context.Context) *UpdatePoolParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the update pool params
func (o *UpdatePoolParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the update pool params
func (o *UpdatePoolParams) WithHTTPClient(client *http.Client) *UpdatePoolParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the update pool params
func (o *UpdatePoolParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the update pool params
func (o *UpdatePoolParams) WithBody(body garm_params.UpdatePoolParams) *UpdatePoolParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the update pool params
func (o *UpdatePoolParams) SetBody(body garm_params.UpdatePoolParams) {
o.Body = body
}
// WithPoolID adds the poolID to the update pool params
func (o *UpdatePoolParams) WithPoolID(poolID string) *UpdatePoolParams {
o.SetPoolID(poolID)
return o
}
// SetPoolID adds the poolId to the update pool params
func (o *UpdatePoolParams) SetPoolID(poolID string) {
o.PoolID = poolID
}
// WriteToRequest writes these params to a swagger request
func (o *UpdatePoolParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
// path param poolID
if err := r.SetPathParam("poolID", o.PoolID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}