151 lines
3.9 KiB
Go
151 lines
3.9 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package first_run
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewFirstRunParams creates a new FirstRunParams 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 NewFirstRunParams() *FirstRunParams {
|
|
return &FirstRunParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewFirstRunParamsWithTimeout creates a new FirstRunParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewFirstRunParamsWithTimeout(timeout time.Duration) *FirstRunParams {
|
|
return &FirstRunParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewFirstRunParamsWithContext creates a new FirstRunParams object
|
|
// with the ability to set a context for a request.
|
|
func NewFirstRunParamsWithContext(ctx context.Context) *FirstRunParams {
|
|
return &FirstRunParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewFirstRunParamsWithHTTPClient creates a new FirstRunParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewFirstRunParamsWithHTTPClient(client *http.Client) *FirstRunParams {
|
|
return &FirstRunParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
FirstRunParams contains all the parameters to send to the API endpoint
|
|
|
|
for the first run operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type FirstRunParams struct {
|
|
|
|
/* Body.
|
|
|
|
Create a new user.
|
|
*/
|
|
Body garm_params.NewUserParams
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the first run params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *FirstRunParams) WithDefaults() *FirstRunParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the first run params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *FirstRunParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the first run params
|
|
func (o *FirstRunParams) WithTimeout(timeout time.Duration) *FirstRunParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the first run params
|
|
func (o *FirstRunParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the first run params
|
|
func (o *FirstRunParams) WithContext(ctx context.Context) *FirstRunParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the first run params
|
|
func (o *FirstRunParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the first run params
|
|
func (o *FirstRunParams) WithHTTPClient(client *http.Client) *FirstRunParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the first run params
|
|
func (o *FirstRunParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithBody adds the body to the first run params
|
|
func (o *FirstRunParams) WithBody(body garm_params.NewUserParams) *FirstRunParams {
|
|
o.SetBody(body)
|
|
return o
|
|
}
|
|
|
|
// SetBody adds the body to the first run params
|
|
func (o *FirstRunParams) SetBody(body garm_params.NewUserParams) {
|
|
o.Body = body
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *FirstRunParams) 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
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|