lib/api/voip/voip_client/endpoint/get_endpoints_parameters.go

254 lines
6.0 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 endpoint
// 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"
"github.com/go-openapi/swag"
)
// NewGetEndpointsParams creates a new GetEndpointsParams 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 NewGetEndpointsParams() *GetEndpointsParams {
return &GetEndpointsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetEndpointsParamsWithTimeout creates a new GetEndpointsParams object
// with the ability to set a timeout on a request.
func NewGetEndpointsParamsWithTimeout(timeout time.Duration) *GetEndpointsParams {
return &GetEndpointsParams{
timeout: timeout,
}
}
// NewGetEndpointsParamsWithContext creates a new GetEndpointsParams object
// with the ability to set a context for a request.
func NewGetEndpointsParamsWithContext(ctx context.Context) *GetEndpointsParams {
return &GetEndpointsParams{
Context: ctx,
}
}
// NewGetEndpointsParamsWithHTTPClient creates a new GetEndpointsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetEndpointsParamsWithHTTPClient(client *http.Client) *GetEndpointsParams {
return &GetEndpointsParams{
HTTPClient: client,
}
}
/* GetEndpointsParams contains all the parameters to send to the API endpoint
for the get endpoints operation.
Typically these are written to a http.Request.
*/
type GetEndpointsParams struct {
/* EndpointID.
Telnexus Id of the endpoint to be retrieved
*/
EndpointID *string
/* Limit.
How many objects to return at one time (max 300, default 100)
Format: int64
Default: 100
*/
Limit *int64
/* Offset.
How many objects to skip? (default 0)
Format: int64
*/
Offset *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get endpoints params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetEndpointsParams) WithDefaults() *GetEndpointsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get endpoints params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetEndpointsParams) SetDefaults() {
var (
limitDefault = int64(100)
offsetDefault = int64(0)
)
val := GetEndpointsParams{
Limit: &limitDefault,
Offset: &offsetDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the get endpoints params
func (o *GetEndpointsParams) WithTimeout(timeout time.Duration) *GetEndpointsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get endpoints params
func (o *GetEndpointsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get endpoints params
func (o *GetEndpointsParams) WithContext(ctx context.Context) *GetEndpointsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get endpoints params
func (o *GetEndpointsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get endpoints params
func (o *GetEndpointsParams) WithHTTPClient(client *http.Client) *GetEndpointsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get endpoints params
func (o *GetEndpointsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEndpointID adds the endpointID to the get endpoints params
func (o *GetEndpointsParams) WithEndpointID(endpointID *string) *GetEndpointsParams {
o.SetEndpointID(endpointID)
return o
}
// SetEndpointID adds the endpointId to the get endpoints params
func (o *GetEndpointsParams) SetEndpointID(endpointID *string) {
o.EndpointID = endpointID
}
// WithLimit adds the limit to the get endpoints params
func (o *GetEndpointsParams) WithLimit(limit *int64) *GetEndpointsParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the get endpoints params
func (o *GetEndpointsParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithOffset adds the offset to the get endpoints params
func (o *GetEndpointsParams) WithOffset(offset *int64) *GetEndpointsParams {
o.SetOffset(offset)
return o
}
// SetOffset adds the offset to the get endpoints params
func (o *GetEndpointsParams) SetOffset(offset *int64) {
o.Offset = offset
}
// WriteToRequest writes these params to a swagger request
func (o *GetEndpointsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.EndpointID != nil {
// query param endpointId
var qrEndpointID string
if o.EndpointID != nil {
qrEndpointID = *o.EndpointID
}
qEndpointID := qrEndpointID
if qEndpointID != "" {
if err := r.SetQueryParam("endpointId", qEndpointID); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Offset != nil {
// query param offset
var qrOffset int64
if o.Offset != nil {
qrOffset = *o.Offset
}
qOffset := swag.FormatInt64(qrOffset)
if qOffset != "" {
if err := r.SetQueryParam("offset", qOffset); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}