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

158 lines
4.3 KiB
Go

// 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"
)
// NewPostTracksParams creates a new PostTracksParams 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 NewPostTracksParams() *PostTracksParams {
return &PostTracksParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostTracksParamsWithTimeout creates a new PostTracksParams object
// with the ability to set a timeout on a request.
func NewPostTracksParamsWithTimeout(timeout time.Duration) *PostTracksParams {
return &PostTracksParams{
timeout: timeout,
}
}
// NewPostTracksParamsWithContext creates a new PostTracksParams object
// with the ability to set a context for a request.
func NewPostTracksParamsWithContext(ctx context.Context) *PostTracksParams {
return &PostTracksParams{
Context: ctx,
}
}
// NewPostTracksParamsWithHTTPClient creates a new PostTracksParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostTracksParamsWithHTTPClient(client *http.Client) *PostTracksParams {
return &PostTracksParams{
HTTPClient: client,
}
}
/*
PostTracksParams contains all the parameters to send to the API endpoint
for the post tracks operation.
Typically these are written to a http.Request.
*/
type PostTracksParams 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 post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) WithDefaults() *PostTracksParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the post tracks params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostTracksParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) WithTimeout(timeout time.Duration) *PostTracksParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post tracks params
func (o *PostTracksParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post tracks params
func (o *PostTracksParams) WithContext(ctx context.Context) *PostTracksParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post tracks params
func (o *PostTracksParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) WithHTTPClient(client *http.Client) *PostTracksParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the post tracks params
func (o *PostTracksParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) WithTrackRequest(trackRequest *members_models.TrackRequest) *PostTracksParams {
o.SetTrackRequest(trackRequest)
return o
}
// SetTrackRequest adds the trackRequest to the post tracks params
func (o *PostTracksParams) SetTrackRequest(trackRequest *members_models.TrackRequest) {
o.TrackRequest = trackRequest
}
// WriteToRequest writes these params to a swagger request
func (o *PostTracksParams) 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
}