lib/api/members/members_client/sessions/refresh_session_parameters.go

137 lines
4.0 KiB
Go
Raw Normal View History

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package sessions
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"
)
// NewRefreshSessionParams creates a new RefreshSessionParams 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 NewRefreshSessionParams() *RefreshSessionParams {
return NewRefreshSessionParamsWithTimeout(cr.DefaultTimeout)
}
// NewRefreshSessionParamsWithTimeout creates a new RefreshSessionParams object
// with the ability to set a timeout on a request.
func NewRefreshSessionParamsWithTimeout(timeout time.Duration) *RefreshSessionParams {
return &RefreshSessionParams{
inner: innerParams{
timeout: timeout,
},
}
}
// NewRefreshSessionParamsWithContext creates a new RefreshSessionParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [RefreshSessionParams].
func NewRefreshSessionParamsWithContext(ctx context.Context) *RefreshSessionParams {
return &RefreshSessionParams{
inner: innerParams{
ctx: ctx,
},
}
}
// NewRefreshSessionParamsWithHTTPClient creates a new RefreshSessionParams object
// with the ability to set a custom HTTPClient for a request.
func NewRefreshSessionParamsWithHTTPClient(client *http.Client) *RefreshSessionParams {
return &RefreshSessionParams{
HTTPClient: client,
}
}
/*
RefreshSessionParams contains all the parameters to send to the API endpoint
for the refresh session operation.
Typically these are written to a http.Request.
*/
type RefreshSessionParams struct {
HTTPClient *http.Client
inner innerParams
}
// WithDefaults hydrates default values in the refresh session params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RefreshSessionParams) WithDefaults() *RefreshSessionParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the refresh session params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RefreshSessionParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the refresh session params.
func (o *RefreshSessionParams) WithTimeout(timeout time.Duration) *RefreshSessionParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the refresh session params.
func (o *RefreshSessionParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
}
// WithContext adds the context to the refresh session params.
//
// Deprecated: use the operation call with context to pass the context instead of [RefreshSessionParams].
func (o *RefreshSessionParams) WithContext(ctx context.Context) *RefreshSessionParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the refresh session params.
//
// Deprecated: use the operation call with context to pass the context instead of [RefreshSessionParams].
func (o *RefreshSessionParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
}
// WithHTTPClient adds the HTTPClient to the refresh session params.
func (o *RefreshSessionParams) WithHTTPClient(client *http.Client) *RefreshSessionParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the refresh session params.
func (o *RefreshSessionParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *RefreshSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}