mirror of https://github.com/vernonkeenan/lib
158 lines
4.6 KiB
Go
158 lines
4.6 KiB
Go
|
// 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
|
||
|
|
||
|
// 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/vernonkeenan/lib/api/sfgate/sfgate_models"
|
||
|
)
|
||
|
|
||
|
// 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 &PutUsersSessionsParams{
|
||
|
timeout: cr.DefaultTimeout,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPutUsersSessionsParamsWithTimeout creates a new PutUsersSessionsParams object
|
||
|
// with the ability to set a timeout on a request.
|
||
|
func NewPutUsersSessionsParamsWithTimeout(timeout time.Duration) *PutUsersSessionsParams {
|
||
|
return &PutUsersSessionsParams{
|
||
|
timeout: timeout,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPutUsersSessionsParamsWithContext creates a new PutUsersSessionsParams object
|
||
|
// with the ability to set a context for a request.
|
||
|
func NewPutUsersSessionsParamsWithContext(ctx context.Context) *PutUsersSessionsParams {
|
||
|
return &PutUsersSessionsParams{
|
||
|
Context: ctx,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// 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
|
||
|
*/
|
||
|
UserRequest *sfgate_models.UserRequest
|
||
|
|
||
|
timeout time.Duration
|
||
|
Context context.Context
|
||
|
HTTPClient *http.Client
|
||
|
}
|
||
|
|
||
|
// 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
|
||
|
func (o *PutUsersSessionsParams) WithTimeout(timeout time.Duration) *PutUsersSessionsParams {
|
||
|
o.SetTimeout(timeout)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetTimeout adds the timeout to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) SetTimeout(timeout time.Duration) {
|
||
|
o.timeout = timeout
|
||
|
}
|
||
|
|
||
|
// WithContext adds the context to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) WithContext(ctx context.Context) *PutUsersSessionsParams {
|
||
|
o.SetContext(ctx)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetContext adds the context to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) SetContext(ctx context.Context) {
|
||
|
o.Context = ctx
|
||
|
}
|
||
|
|
||
|
// WithHTTPClient adds the HTTPClient to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) WithHTTPClient(client *http.Client) *PutUsersSessionsParams {
|
||
|
o.SetHTTPClient(client)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetHTTPClient adds the HTTPClient to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) SetHTTPClient(client *http.Client) {
|
||
|
o.HTTPClient = client
|
||
|
}
|
||
|
|
||
|
// WithUserRequest adds the userRequest to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PutUsersSessionsParams {
|
||
|
o.SetUserRequest(userRequest)
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetUserRequest adds the userRequest to the put users sessions params
|
||
|
func (o *PutUsersSessionsParams) SetUserRequest(userRequest *sfgate_models.UserRequest) {
|
||
|
o.UserRequest = userRequest
|
||
|
}
|
||
|
|
||
|
// WriteToRequest writes these params to a swagger request
|
||
|
func (o *PutUsersSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||
|
|
||
|
if err := r.SetTimeout(o.timeout); err != nil {
|
||
|
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
|
||
|
}
|