blob: cfe18410c5022cf47f8556e7a5a5548836f961ac [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001// Code generated by go-swagger; DO NOT EDIT.
2
3// Copyright 2018 The go-netbox Authors.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17package dcim
18
19// This file was generated by the swagger tool.
20// Editing this file might prove futile when you re-run the swagger generate command
21
22import (
23 "net/http"
24 "time"
25
26 "golang.org/x/net/context"
27
28 "github.com/go-openapi/errors"
29 "github.com/go-openapi/runtime"
30 cr "github.com/go-openapi/runtime/client"
31 "github.com/go-openapi/swag"
32
33 strfmt "github.com/go-openapi/strfmt"
34)
35
36// NewDcimConsolePortsListParams creates a new DcimConsolePortsListParams object
37// with the default values initialized.
38func NewDcimConsolePortsListParams() *DcimConsolePortsListParams {
39 var ()
40 return &DcimConsolePortsListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimConsolePortsListParamsWithTimeout creates a new DcimConsolePortsListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimConsolePortsListParamsWithTimeout(timeout time.Duration) *DcimConsolePortsListParams {
49 var ()
50 return &DcimConsolePortsListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimConsolePortsListParamsWithContext creates a new DcimConsolePortsListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimConsolePortsListParamsWithContext(ctx context.Context) *DcimConsolePortsListParams {
59 var ()
60 return &DcimConsolePortsListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimConsolePortsListParamsWithHTTPClient creates a new DcimConsolePortsListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimConsolePortsListParamsWithHTTPClient(client *http.Client) *DcimConsolePortsListParams {
69 var ()
70 return &DcimConsolePortsListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimConsolePortsListParams contains all the parameters to send to the API endpoint
76for the dcim console ports list operation typically these are written to a http.Request
77*/
78type DcimConsolePortsListParams struct {
79
80 /*Device*/
81 Device *string
82 /*DeviceID*/
83 DeviceID *string
84 /*Limit
85 Number of results to return per page.
86
87 */
88 Limit *int64
89 /*Name*/
90 Name *string
91 /*Offset
92 The initial index from which to return the results.
93
94 */
95 Offset *int64
96
97 timeout time.Duration
98 Context context.Context
99 HTTPClient *http.Client
100}
101
102// WithTimeout adds the timeout to the dcim console ports list params
103func (o *DcimConsolePortsListParams) WithTimeout(timeout time.Duration) *DcimConsolePortsListParams {
104 o.SetTimeout(timeout)
105 return o
106}
107
108// SetTimeout adds the timeout to the dcim console ports list params
109func (o *DcimConsolePortsListParams) SetTimeout(timeout time.Duration) {
110 o.timeout = timeout
111}
112
113// WithContext adds the context to the dcim console ports list params
114func (o *DcimConsolePortsListParams) WithContext(ctx context.Context) *DcimConsolePortsListParams {
115 o.SetContext(ctx)
116 return o
117}
118
119// SetContext adds the context to the dcim console ports list params
120func (o *DcimConsolePortsListParams) SetContext(ctx context.Context) {
121 o.Context = ctx
122}
123
124// WithHTTPClient adds the HTTPClient to the dcim console ports list params
125func (o *DcimConsolePortsListParams) WithHTTPClient(client *http.Client) *DcimConsolePortsListParams {
126 o.SetHTTPClient(client)
127 return o
128}
129
130// SetHTTPClient adds the HTTPClient to the dcim console ports list params
131func (o *DcimConsolePortsListParams) SetHTTPClient(client *http.Client) {
132 o.HTTPClient = client
133}
134
135// WithDevice adds the device to the dcim console ports list params
136func (o *DcimConsolePortsListParams) WithDevice(device *string) *DcimConsolePortsListParams {
137 o.SetDevice(device)
138 return o
139}
140
141// SetDevice adds the device to the dcim console ports list params
142func (o *DcimConsolePortsListParams) SetDevice(device *string) {
143 o.Device = device
144}
145
146// WithDeviceID adds the deviceID to the dcim console ports list params
147func (o *DcimConsolePortsListParams) WithDeviceID(deviceID *string) *DcimConsolePortsListParams {
148 o.SetDeviceID(deviceID)
149 return o
150}
151
152// SetDeviceID adds the deviceId to the dcim console ports list params
153func (o *DcimConsolePortsListParams) SetDeviceID(deviceID *string) {
154 o.DeviceID = deviceID
155}
156
157// WithLimit adds the limit to the dcim console ports list params
158func (o *DcimConsolePortsListParams) WithLimit(limit *int64) *DcimConsolePortsListParams {
159 o.SetLimit(limit)
160 return o
161}
162
163// SetLimit adds the limit to the dcim console ports list params
164func (o *DcimConsolePortsListParams) SetLimit(limit *int64) {
165 o.Limit = limit
166}
167
168// WithName adds the name to the dcim console ports list params
169func (o *DcimConsolePortsListParams) WithName(name *string) *DcimConsolePortsListParams {
170 o.SetName(name)
171 return o
172}
173
174// SetName adds the name to the dcim console ports list params
175func (o *DcimConsolePortsListParams) SetName(name *string) {
176 o.Name = name
177}
178
179// WithOffset adds the offset to the dcim console ports list params
180func (o *DcimConsolePortsListParams) WithOffset(offset *int64) *DcimConsolePortsListParams {
181 o.SetOffset(offset)
182 return o
183}
184
185// SetOffset adds the offset to the dcim console ports list params
186func (o *DcimConsolePortsListParams) SetOffset(offset *int64) {
187 o.Offset = offset
188}
189
190// WriteToRequest writes these params to a swagger request
191func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
192
193 if err := r.SetTimeout(o.timeout); err != nil {
194 return err
195 }
196 var res []error
197
198 if o.Device != nil {
199
200 // query param device
201 var qrDevice string
202 if o.Device != nil {
203 qrDevice = *o.Device
204 }
205 qDevice := qrDevice
206 if qDevice != "" {
207 if err := r.SetQueryParam("device", qDevice); err != nil {
208 return err
209 }
210 }
211
212 }
213
214 if o.DeviceID != nil {
215
216 // query param device_id
217 var qrDeviceID string
218 if o.DeviceID != nil {
219 qrDeviceID = *o.DeviceID
220 }
221 qDeviceID := qrDeviceID
222 if qDeviceID != "" {
223 if err := r.SetQueryParam("device_id", qDeviceID); err != nil {
224 return err
225 }
226 }
227
228 }
229
230 if o.Limit != nil {
231
232 // query param limit
233 var qrLimit int64
234 if o.Limit != nil {
235 qrLimit = *o.Limit
236 }
237 qLimit := swag.FormatInt64(qrLimit)
238 if qLimit != "" {
239 if err := r.SetQueryParam("limit", qLimit); err != nil {
240 return err
241 }
242 }
243
244 }
245
246 if o.Name != nil {
247
248 // query param name
249 var qrName string
250 if o.Name != nil {
251 qrName = *o.Name
252 }
253 qName := qrName
254 if qName != "" {
255 if err := r.SetQueryParam("name", qName); err != nil {
256 return err
257 }
258 }
259
260 }
261
262 if o.Offset != nil {
263
264 // query param offset
265 var qrOffset int64
266 if o.Offset != nil {
267 qrOffset = *o.Offset
268 }
269 qOffset := swag.FormatInt64(qrOffset)
270 if qOffset != "" {
271 if err := r.SetQueryParam("offset", qOffset); err != nil {
272 return err
273 }
274 }
275
276 }
277
278 if len(res) > 0 {
279 return errors.CompositeValidationError(res...)
280 }
281 return nil
282}