lib/api/sfgate/sfgate_client/users/put_users_sessions_paramete...

160 lines
4.8 KiB
Go
Raw Normal View History

2023-04-12 00:32:15 +00:00
// 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 users
import (
"context"
"net/http"
"time"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
2023-04-12 00:32:15 +00:00
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewPutUsersSessionsParams creates a new PutUsersSessionsParams 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 NewPutUsersSessionsParams() *PutUsersSessionsParams {
return NewPutUsersSessionsParamsWithTimeout(cr.DefaultTimeout)
2023-04-12 00:32:15 +00:00
}
// NewPutUsersSessionsParamsWithTimeout creates a new PutUsersSessionsParams object
// with the ability to set a timeout on a request.
func NewPutUsersSessionsParamsWithTimeout(timeout time.Duration) *PutUsersSessionsParams {
return &PutUsersSessionsParams{
inner: innerParams{
timeout: timeout,
},
2023-04-12 00:32:15 +00:00
}
}
// NewPutUsersSessionsParamsWithContext creates a new PutUsersSessionsParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [PutUsersSessionsParams].
2023-04-12 00:32:15 +00:00
func NewPutUsersSessionsParamsWithContext(ctx context.Context) *PutUsersSessionsParams {
return &PutUsersSessionsParams{
inner: innerParams{
ctx: ctx,
},
2023-04-12 00:32:15 +00:00
}
}
// NewPutUsersSessionsParamsWithHTTPClient creates a new PutUsersSessionsParams object
// with the ability to set a custom HTTPClient for a request.
func NewPutUsersSessionsParamsWithHTTPClient(client *http.Client) *PutUsersSessionsParams {
return &PutUsersSessionsParams{
HTTPClient: client,
}
}
/*
PutUsersSessionsParams contains all the parameters to send to the API endpoint
for the put users sessions operation.
Typically these are written to a http.Request.
*/
type PutUsersSessionsParams struct {
// UserRequest.
//
// A single new user record
2023-04-12 00:32:15 +00:00
UserRequest *sfgate_models.UserRequest
HTTPClient *http.Client
inner innerParams
2023-04-12 00:32:15 +00:00
}
// WithDefaults hydrates default values in the put users sessions params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutUsersSessionsParams) WithDefaults() *PutUsersSessionsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the put users sessions params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PutUsersSessionsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) WithTimeout(timeout time.Duration) *PutUsersSessionsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) SetTimeout(timeout time.Duration) {
o.inner.timeout = timeout
2023-04-12 00:32:15 +00:00
}
// WithContext adds the context to the put users sessions params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutUsersSessionsParams].
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) WithContext(ctx context.Context) *PutUsersSessionsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the put users sessions params.
//
// Deprecated: use the operation call with context to pass the context instead of [PutUsersSessionsParams].
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) SetContext(ctx context.Context) {
o.inner.ctx = ctx
2023-04-12 00:32:15 +00:00
}
// WithHTTPClient adds the HTTPClient to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) WithHTTPClient(client *http.Client) *PutUsersSessionsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithUserRequest adds the userRequest to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PutUsersSessionsParams {
o.SetUserRequest(userRequest)
return o
}
// SetUserRequest adds the userRequest to the put users sessions params.
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) SetUserRequest(userRequest *sfgate_models.UserRequest) {
o.UserRequest = userRequest
}
// WriteToRequest writes these params to a [runtime.ClientRequest].
2023-04-12 00:32:15 +00:00
func (o *PutUsersSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.inner.timeout); err != nil {
2023-04-12 00:32:15 +00:00
return err
}
var res []error
if o.UserRequest != nil {
if err := r.SetBodyParam(o.UserRequest); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}