Files
cloud-services/pkg/ota_api/client/operations/post_fleet_parameters.go

154 lines
4.0 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package operations
// 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"
"fiskerinc.com/modules/ota_api/models"
)
// NewPostFleetParams creates a new PostFleetParams 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 NewPostFleetParams() *PostFleetParams {
return &PostFleetParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostFleetParamsWithTimeout creates a new PostFleetParams object
// with the ability to set a timeout on a request.
func NewPostFleetParamsWithTimeout(timeout time.Duration) *PostFleetParams {
return &PostFleetParams{
timeout: timeout,
}
}
// NewPostFleetParamsWithContext creates a new PostFleetParams object
// with the ability to set a context for a request.
func NewPostFleetParamsWithContext(ctx context.Context) *PostFleetParams {
return &PostFleetParams{
Context: ctx,
}
}
// NewPostFleetParamsWithHTTPClient creates a new PostFleetParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostFleetParamsWithHTTPClient(client *http.Client) *PostFleetParams {
return &PostFleetParams{
HTTPClient: client,
}
}
/*
PostFleetParams contains all the parameters to send to the API endpoint
for the post fleet operation.
Typically these are written to a http.Request.
*/
type PostFleetParams struct {
/* Config.
Fleet data
*/
Config *models.HandlersFleetRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the post fleet params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostFleetParams) WithDefaults() *PostFleetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post fleet params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostFleetParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post fleet params
func (o *PostFleetParams) WithTimeout(timeout time.Duration) *PostFleetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post fleet params
func (o *PostFleetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post fleet params
func (o *PostFleetParams) WithContext(ctx context.Context) *PostFleetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post fleet params
func (o *PostFleetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post fleet params
func (o *PostFleetParams) WithHTTPClient(client *http.Client) *PostFleetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post fleet params
func (o *PostFleetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithConfig adds the config to the post fleet params
func (o *PostFleetParams) WithConfig(config *models.HandlersFleetRequest) *PostFleetParams {
o.SetConfig(config)
return o
}
// SetConfig adds the config to the post fleet params
func (o *PostFleetParams) SetConfig(config *models.HandlersFleetRequest) {
o.Config = config
}
// WriteToRequest writes these params to a swagger request
func (o *PostFleetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Config != nil {
if err := r.SetBodyParam(o.Config); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}