garm/client/organizations/create_org_scale_set_parameters.go
Gabriel Adrian Samfira 7174e030e2 Add scaleset commands
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-05-03 22:29:40 +00:00

173 lines
4.9 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package organizations
// 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"
)
// NewCreateOrgScaleSetParams creates a new CreateOrgScaleSetParams 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 NewCreateOrgScaleSetParams() *CreateOrgScaleSetParams {
return &CreateOrgScaleSetParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateOrgScaleSetParamsWithTimeout creates a new CreateOrgScaleSetParams object
// with the ability to set a timeout on a request.
func NewCreateOrgScaleSetParamsWithTimeout(timeout time.Duration) *CreateOrgScaleSetParams {
return &CreateOrgScaleSetParams{
timeout: timeout,
}
}
// NewCreateOrgScaleSetParamsWithContext creates a new CreateOrgScaleSetParams object
// with the ability to set a context for a request.
func NewCreateOrgScaleSetParamsWithContext(ctx context.Context) *CreateOrgScaleSetParams {
return &CreateOrgScaleSetParams{
Context: ctx,
}
}
// NewCreateOrgScaleSetParamsWithHTTPClient creates a new CreateOrgScaleSetParams object
// with the ability to set a custom HTTPClient for a request.
func NewCreateOrgScaleSetParamsWithHTTPClient(client *http.Client) *CreateOrgScaleSetParams {
return &CreateOrgScaleSetParams{
HTTPClient: client,
}
}
/*
CreateOrgScaleSetParams contains all the parameters to send to the API endpoint
for the create org scale set operation.
Typically these are written to a http.Request.
*/
type CreateOrgScaleSetParams struct {
/* Body.
Parameters used when creating the organization scale set.
*/
Body garm_params.CreateScaleSetParams
/* OrgID.
Organization ID.
*/
OrgID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the create org scale set params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateOrgScaleSetParams) WithDefaults() *CreateOrgScaleSetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the create org scale set params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateOrgScaleSetParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the create org scale set params
func (o *CreateOrgScaleSetParams) WithTimeout(timeout time.Duration) *CreateOrgScaleSetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create org scale set params
func (o *CreateOrgScaleSetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create org scale set params
func (o *CreateOrgScaleSetParams) WithContext(ctx context.Context) *CreateOrgScaleSetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create org scale set params
func (o *CreateOrgScaleSetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create org scale set params
func (o *CreateOrgScaleSetParams) WithHTTPClient(client *http.Client) *CreateOrgScaleSetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create org scale set params
func (o *CreateOrgScaleSetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the create org scale set params
func (o *CreateOrgScaleSetParams) WithBody(body garm_params.CreateScaleSetParams) *CreateOrgScaleSetParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the create org scale set params
func (o *CreateOrgScaleSetParams) SetBody(body garm_params.CreateScaleSetParams) {
o.Body = body
}
// WithOrgID adds the orgID to the create org scale set params
func (o *CreateOrgScaleSetParams) WithOrgID(orgID string) *CreateOrgScaleSetParams {
o.SetOrgID(orgID)
return o
}
// SetOrgID adds the orgId to the create org scale set params
func (o *CreateOrgScaleSetParams) SetOrgID(orgID string) {
o.OrgID = orgID
}
// WriteToRequest writes these params to a swagger request
func (o *CreateOrgScaleSetParams) 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 orgID
if err := r.SetPathParam("orgID", o.OrgID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}