blob: 116a9f2086b1bc48b2a9c0061cd19a371854aed0 [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// NewDcimDeviceRolesListParams creates a new DcimDeviceRolesListParams object
37// with the default values initialized.
38func NewDcimDeviceRolesListParams() *DcimDeviceRolesListParams {
39 var ()
40 return &DcimDeviceRolesListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimDeviceRolesListParamsWithTimeout creates a new DcimDeviceRolesListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimDeviceRolesListParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesListParams {
49 var ()
50 return &DcimDeviceRolesListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimDeviceRolesListParamsWithContext creates a new DcimDeviceRolesListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimDeviceRolesListParamsWithContext(ctx context.Context) *DcimDeviceRolesListParams {
59 var ()
60 return &DcimDeviceRolesListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimDeviceRolesListParamsWithHTTPClient creates a new DcimDeviceRolesListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimDeviceRolesListParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesListParams {
69 var ()
70 return &DcimDeviceRolesListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimDeviceRolesListParams contains all the parameters to send to the API endpoint
76for the dcim device roles list operation typically these are written to a http.Request
77*/
78type DcimDeviceRolesListParams struct {
79
80 /*Color*/
81 Color *string
82 /*Limit
83 Number of results to return per page.
84
85 */
86 Limit *int64
87 /*Name*/
88 Name *string
89 /*Offset
90 The initial index from which to return the results.
91
92 */
93 Offset *int64
94 /*Slug*/
95 Slug *string
96 /*VMRole*/
97 VMRole *string
98
99 timeout time.Duration
100 Context context.Context
101 HTTPClient *http.Client
102}
103
104// WithTimeout adds the timeout to the dcim device roles list params
105func (o *DcimDeviceRolesListParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesListParams {
106 o.SetTimeout(timeout)
107 return o
108}
109
110// SetTimeout adds the timeout to the dcim device roles list params
111func (o *DcimDeviceRolesListParams) SetTimeout(timeout time.Duration) {
112 o.timeout = timeout
113}
114
115// WithContext adds the context to the dcim device roles list params
116func (o *DcimDeviceRolesListParams) WithContext(ctx context.Context) *DcimDeviceRolesListParams {
117 o.SetContext(ctx)
118 return o
119}
120
121// SetContext adds the context to the dcim device roles list params
122func (o *DcimDeviceRolesListParams) SetContext(ctx context.Context) {
123 o.Context = ctx
124}
125
126// WithHTTPClient adds the HTTPClient to the dcim device roles list params
127func (o *DcimDeviceRolesListParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesListParams {
128 o.SetHTTPClient(client)
129 return o
130}
131
132// SetHTTPClient adds the HTTPClient to the dcim device roles list params
133func (o *DcimDeviceRolesListParams) SetHTTPClient(client *http.Client) {
134 o.HTTPClient = client
135}
136
137// WithColor adds the color to the dcim device roles list params
138func (o *DcimDeviceRolesListParams) WithColor(color *string) *DcimDeviceRolesListParams {
139 o.SetColor(color)
140 return o
141}
142
143// SetColor adds the color to the dcim device roles list params
144func (o *DcimDeviceRolesListParams) SetColor(color *string) {
145 o.Color = color
146}
147
148// WithLimit adds the limit to the dcim device roles list params
149func (o *DcimDeviceRolesListParams) WithLimit(limit *int64) *DcimDeviceRolesListParams {
150 o.SetLimit(limit)
151 return o
152}
153
154// SetLimit adds the limit to the dcim device roles list params
155func (o *DcimDeviceRolesListParams) SetLimit(limit *int64) {
156 o.Limit = limit
157}
158
159// WithName adds the name to the dcim device roles list params
160func (o *DcimDeviceRolesListParams) WithName(name *string) *DcimDeviceRolesListParams {
161 o.SetName(name)
162 return o
163}
164
165// SetName adds the name to the dcim device roles list params
166func (o *DcimDeviceRolesListParams) SetName(name *string) {
167 o.Name = name
168}
169
170// WithOffset adds the offset to the dcim device roles list params
171func (o *DcimDeviceRolesListParams) WithOffset(offset *int64) *DcimDeviceRolesListParams {
172 o.SetOffset(offset)
173 return o
174}
175
176// SetOffset adds the offset to the dcim device roles list params
177func (o *DcimDeviceRolesListParams) SetOffset(offset *int64) {
178 o.Offset = offset
179}
180
181// WithSlug adds the slug to the dcim device roles list params
182func (o *DcimDeviceRolesListParams) WithSlug(slug *string) *DcimDeviceRolesListParams {
183 o.SetSlug(slug)
184 return o
185}
186
187// SetSlug adds the slug to the dcim device roles list params
188func (o *DcimDeviceRolesListParams) SetSlug(slug *string) {
189 o.Slug = slug
190}
191
192// WithVMRole adds the vMRole to the dcim device roles list params
193func (o *DcimDeviceRolesListParams) WithVMRole(vMRole *string) *DcimDeviceRolesListParams {
194 o.SetVMRole(vMRole)
195 return o
196}
197
198// SetVMRole adds the vmRole to the dcim device roles list params
199func (o *DcimDeviceRolesListParams) SetVMRole(vMRole *string) {
200 o.VMRole = vMRole
201}
202
203// WriteToRequest writes these params to a swagger request
204func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
205
206 if err := r.SetTimeout(o.timeout); err != nil {
207 return err
208 }
209 var res []error
210
211 if o.Color != nil {
212
213 // query param color
214 var qrColor string
215 if o.Color != nil {
216 qrColor = *o.Color
217 }
218 qColor := qrColor
219 if qColor != "" {
220 if err := r.SetQueryParam("color", qColor); err != nil {
221 return err
222 }
223 }
224
225 }
226
227 if o.Limit != nil {
228
229 // query param limit
230 var qrLimit int64
231 if o.Limit != nil {
232 qrLimit = *o.Limit
233 }
234 qLimit := swag.FormatInt64(qrLimit)
235 if qLimit != "" {
236 if err := r.SetQueryParam("limit", qLimit); err != nil {
237 return err
238 }
239 }
240
241 }
242
243 if o.Name != nil {
244
245 // query param name
246 var qrName string
247 if o.Name != nil {
248 qrName = *o.Name
249 }
250 qName := qrName
251 if qName != "" {
252 if err := r.SetQueryParam("name", qName); err != nil {
253 return err
254 }
255 }
256
257 }
258
259 if o.Offset != nil {
260
261 // query param offset
262 var qrOffset int64
263 if o.Offset != nil {
264 qrOffset = *o.Offset
265 }
266 qOffset := swag.FormatInt64(qrOffset)
267 if qOffset != "" {
268 if err := r.SetQueryParam("offset", qOffset); err != nil {
269 return err
270 }
271 }
272
273 }
274
275 if o.Slug != nil {
276
277 // query param slug
278 var qrSlug string
279 if o.Slug != nil {
280 qrSlug = *o.Slug
281 }
282 qSlug := qrSlug
283 if qSlug != "" {
284 if err := r.SetQueryParam("slug", qSlug); err != nil {
285 return err
286 }
287 }
288
289 }
290
291 if o.VMRole != nil {
292
293 // query param vm_role
294 var qrVMRole string
295 if o.VMRole != nil {
296 qrVMRole = *o.VMRole
297 }
298 qVMRole := qrVMRole
299 if qVMRole != "" {
300 if err := r.SetQueryParam("vm_role", qVMRole); err != nil {
301 return err
302 }
303 }
304
305 }
306
307 if len(res) > 0 {
308 return errors.CompositeValidationError(res...)
309 }
310 return nil
311}