176 lines
4.6 KiB
Go
176 lines
4.6 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"
|
|
|
|
"github.com/fiskerinc/cloud-services/pkg/ota_api/models"
|
|
)
|
|
|
|
// NewPutFleetNameParams creates a new PutFleetNameParams 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 NewPutFleetNameParams() *PutFleetNameParams {
|
|
return &PutFleetNameParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewPutFleetNameParamsWithTimeout creates a new PutFleetNameParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewPutFleetNameParamsWithTimeout(timeout time.Duration) *PutFleetNameParams {
|
|
return &PutFleetNameParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewPutFleetNameParamsWithContext creates a new PutFleetNameParams object
|
|
// with the ability to set a context for a request.
|
|
func NewPutFleetNameParamsWithContext(ctx context.Context) *PutFleetNameParams {
|
|
return &PutFleetNameParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewPutFleetNameParamsWithHTTPClient creates a new PutFleetNameParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewPutFleetNameParamsWithHTTPClient(client *http.Client) *PutFleetNameParams {
|
|
return &PutFleetNameParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
PutFleetNameParams contains all the parameters to send to the API endpoint
|
|
|
|
for the put fleet name operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type PutFleetNameParams struct {
|
|
|
|
/* Config.
|
|
|
|
Fleet data
|
|
*/
|
|
Config *models.MongoFleet
|
|
|
|
/* Name.
|
|
|
|
Name
|
|
*/
|
|
Name string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the put fleet name params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PutFleetNameParams) WithDefaults() *PutFleetNameParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the put fleet name params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PutFleetNameParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the put fleet name params
|
|
func (o *PutFleetNameParams) WithTimeout(timeout time.Duration) *PutFleetNameParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the put fleet name params
|
|
func (o *PutFleetNameParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the put fleet name params
|
|
func (o *PutFleetNameParams) WithContext(ctx context.Context) *PutFleetNameParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the put fleet name params
|
|
func (o *PutFleetNameParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the put fleet name params
|
|
func (o *PutFleetNameParams) WithHTTPClient(client *http.Client) *PutFleetNameParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the put fleet name params
|
|
func (o *PutFleetNameParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithConfig adds the config to the put fleet name params
|
|
func (o *PutFleetNameParams) WithConfig(config *models.MongoFleet) *PutFleetNameParams {
|
|
o.SetConfig(config)
|
|
return o
|
|
}
|
|
|
|
// SetConfig adds the config to the put fleet name params
|
|
func (o *PutFleetNameParams) SetConfig(config *models.MongoFleet) {
|
|
o.Config = config
|
|
}
|
|
|
|
// WithName adds the name to the put fleet name params
|
|
func (o *PutFleetNameParams) WithName(name string) *PutFleetNameParams {
|
|
o.SetName(name)
|
|
return o
|
|
}
|
|
|
|
// SetName adds the name to the put fleet name params
|
|
func (o *PutFleetNameParams) SetName(name string) {
|
|
o.Name = name
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *PutFleetNameParams) 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
|
|
}
|
|
}
|
|
|
|
// path param name
|
|
if err := r.SetPathParam("name", o.Name); err != nil {
|
|
return err
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|