lib/api/members/members_client/tracks/put_tracks_parameters.go

158 lines
4.3 KiB
Go
Raw Normal View History

2023-09-30 15:38:27 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package tracks
// 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"
"code.tnxs.net/work/lib/api/members/members_models"
)
// NewPutTracksParams creates a new PutTracksParams 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 NewPutTracksParams() *PutTracksParams {
return &PutTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPutTracksParamsWithTimeout creates a new PutTracksParams object
// with the ability to set a timeout on a request.
func NewPutTracksParamsWithTimeout(timeout time.Duration) *PutTracksParams {
return &PutTracksParams{
timeout: timeout,
}
}
// NewPutTracksParamsWithContext creates a new PutTracksParams object
// with the ability to set a context for a request.
func NewPutTracksParamsWithContext(ctx context.Context) *PutTracksParams {
return &PutTracksParams{
Context: ctx,
}
}
// NewPutTracksParamsWithHTTPClient creates a new PutTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutTracksParamsWithHTTPClient(client *http.Client) *PutTracksParams {
return &PutTracksParams{
HTTPClient: client,
}
}
/*
PutTracksParams contains all the parameters to send to the API endpoint
for the put tracks operation.
Typically these are written to a http.Request.
*/
type PutTracksParams struct {
/* TrackRequest.
An array of new Track records
*/
TrackRequest *members_models.TrackRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the put tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTracksParams) WithDefaults() *PutTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put tracks params
func (o *PutTracksParams) WithTimeout(timeout time.Duration) *PutTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put tracks params
func (o *PutTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the put tracks params
func (o *PutTracksParams) WithContext(ctx context.Context) *PutTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put tracks params
func (o *PutTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the put tracks params
func (o *PutTracksParams) WithHTTPClient(client *http.Client) *PutTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put tracks params
func (o *PutTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackRequest adds the trackRequest to the put tracks params
func (o *PutTracksParams) WithTrackRequest(trackRequest *members_models.TrackRequest) *PutTracksParams {
o.SetTrackRequest(trackRequest)
return o
}
// SetTrackRequest adds the trackRequest to the put tracks params
func (o *PutTracksParams) SetTrackRequest(trackRequest *members_models.TrackRequest) {
o.TrackRequest = trackRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PutTracksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.TrackRequest != nil {
if err := r.SetBodyParam(o.TrackRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}