lib/api/kazoo/kazoo_client/device/get_user_devices_parameters.go

170 lines
4.7 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Telnexus LLC
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package device
// 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"
)
// NewGetUserDevicesParams creates a new GetUserDevicesParams 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 NewGetUserDevicesParams() *GetUserDevicesParams {
return &GetUserDevicesParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetUserDevicesParamsWithTimeout creates a new GetUserDevicesParams object
// with the ability to set a timeout on a request.
func NewGetUserDevicesParamsWithTimeout(timeout time.Duration) *GetUserDevicesParams {
return &GetUserDevicesParams{
timeout: timeout,
}
}
// NewGetUserDevicesParamsWithContext creates a new GetUserDevicesParams object
// with the ability to set a context for a request.
func NewGetUserDevicesParamsWithContext(ctx context.Context) *GetUserDevicesParams {
return &GetUserDevicesParams{
Context: ctx,
}
}
// NewGetUserDevicesParamsWithHTTPClient creates a new GetUserDevicesParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetUserDevicesParamsWithHTTPClient(client *http.Client) *GetUserDevicesParams {
return &GetUserDevicesParams{
HTTPClient: client,
}
}
/* GetUserDevicesParams contains all the parameters to send to the API endpoint
for the get user devices operation.
Typically these are written to a http.Request.
*/
type GetUserDevicesParams struct {
// AccountID.
AccountID string
// UserID.
UserID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get user devices params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetUserDevicesParams) WithDefaults() *GetUserDevicesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get user devices params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetUserDevicesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get user devices params
func (o *GetUserDevicesParams) WithTimeout(timeout time.Duration) *GetUserDevicesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get user devices params
func (o *GetUserDevicesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get user devices params
func (o *GetUserDevicesParams) WithContext(ctx context.Context) *GetUserDevicesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get user devices params
func (o *GetUserDevicesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get user devices params
func (o *GetUserDevicesParams) WithHTTPClient(client *http.Client) *GetUserDevicesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get user devices params
func (o *GetUserDevicesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAccountID adds the accountID to the get user devices params
func (o *GetUserDevicesParams) WithAccountID(accountID string) *GetUserDevicesParams {
o.SetAccountID(accountID)
return o
}
// SetAccountID adds the accountId to the get user devices params
func (o *GetUserDevicesParams) SetAccountID(accountID string) {
o.AccountID = accountID
}
// WithUserID adds the userID to the get user devices params
func (o *GetUserDevicesParams) WithUserID(userID string) *GetUserDevicesParams {
o.SetUserID(userID)
return o
}
// SetUserID adds the userId to the get user devices params
func (o *GetUserDevicesParams) SetUserID(userID string) {
o.UserID = userID
}
// WriteToRequest writes these params to a swagger request
func (o *GetUserDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param accountId
if err := r.SetPathParam("accountId", o.AccountID); err != nil {
return err
}
// path param userId
if err := r.SetPathParam("userId", o.UserID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}