blob: b967bcf90d8b0acab43dbd1317d32302d7989bd8 [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// NewDcimDeviceBayTemplatesListParams creates a new DcimDeviceBayTemplatesListParams object
37// with the default values initialized.
38func NewDcimDeviceBayTemplatesListParams() *DcimDeviceBayTemplatesListParams {
39 var ()
40 return &DcimDeviceBayTemplatesListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewDcimDeviceBayTemplatesListParamsWithTimeout creates a new DcimDeviceBayTemplatesListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewDcimDeviceBayTemplatesListParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams {
49 var ()
50 return &DcimDeviceBayTemplatesListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewDcimDeviceBayTemplatesListParamsWithContext creates a new DcimDeviceBayTemplatesListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewDcimDeviceBayTemplatesListParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams {
59 var ()
60 return &DcimDeviceBayTemplatesListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewDcimDeviceBayTemplatesListParamsWithHTTPClient creates a new DcimDeviceBayTemplatesListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewDcimDeviceBayTemplatesListParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams {
69 var ()
70 return &DcimDeviceBayTemplatesListParams{
71 HTTPClient: client,
72 }
73}
74
75/*DcimDeviceBayTemplatesListParams contains all the parameters to send to the API endpoint
76for the dcim device bay templates list operation typically these are written to a http.Request
77*/
78type DcimDeviceBayTemplatesListParams struct {
79
80 /*DevicetypeID*/
81 DevicetypeID *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
95 timeout time.Duration
96 Context context.Context
97 HTTPClient *http.Client
98}
99
100// WithTimeout adds the timeout to the dcim device bay templates list params
101func (o *DcimDeviceBayTemplatesListParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams {
102 o.SetTimeout(timeout)
103 return o
104}
105
106// SetTimeout adds the timeout to the dcim device bay templates list params
107func (o *DcimDeviceBayTemplatesListParams) SetTimeout(timeout time.Duration) {
108 o.timeout = timeout
109}
110
111// WithContext adds the context to the dcim device bay templates list params
112func (o *DcimDeviceBayTemplatesListParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams {
113 o.SetContext(ctx)
114 return o
115}
116
117// SetContext adds the context to the dcim device bay templates list params
118func (o *DcimDeviceBayTemplatesListParams) SetContext(ctx context.Context) {
119 o.Context = ctx
120}
121
122// WithHTTPClient adds the HTTPClient to the dcim device bay templates list params
123func (o *DcimDeviceBayTemplatesListParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams {
124 o.SetHTTPClient(client)
125 return o
126}
127
128// SetHTTPClient adds the HTTPClient to the dcim device bay templates list params
129func (o *DcimDeviceBayTemplatesListParams) SetHTTPClient(client *http.Client) {
130 o.HTTPClient = client
131}
132
133// WithDevicetypeID adds the devicetypeID to the dcim device bay templates list params
134func (o *DcimDeviceBayTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimDeviceBayTemplatesListParams {
135 o.SetDevicetypeID(devicetypeID)
136 return o
137}
138
139// SetDevicetypeID adds the devicetypeId to the dcim device bay templates list params
140func (o *DcimDeviceBayTemplatesListParams) SetDevicetypeID(devicetypeID *string) {
141 o.DevicetypeID = devicetypeID
142}
143
144// WithLimit adds the limit to the dcim device bay templates list params
145func (o *DcimDeviceBayTemplatesListParams) WithLimit(limit *int64) *DcimDeviceBayTemplatesListParams {
146 o.SetLimit(limit)
147 return o
148}
149
150// SetLimit adds the limit to the dcim device bay templates list params
151func (o *DcimDeviceBayTemplatesListParams) SetLimit(limit *int64) {
152 o.Limit = limit
153}
154
155// WithName adds the name to the dcim device bay templates list params
156func (o *DcimDeviceBayTemplatesListParams) WithName(name *string) *DcimDeviceBayTemplatesListParams {
157 o.SetName(name)
158 return o
159}
160
161// SetName adds the name to the dcim device bay templates list params
162func (o *DcimDeviceBayTemplatesListParams) SetName(name *string) {
163 o.Name = name
164}
165
166// WithOffset adds the offset to the dcim device bay templates list params
167func (o *DcimDeviceBayTemplatesListParams) WithOffset(offset *int64) *DcimDeviceBayTemplatesListParams {
168 o.SetOffset(offset)
169 return o
170}
171
172// SetOffset adds the offset to the dcim device bay templates list params
173func (o *DcimDeviceBayTemplatesListParams) SetOffset(offset *int64) {
174 o.Offset = offset
175}
176
177// WriteToRequest writes these params to a swagger request
178func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
179
180 if err := r.SetTimeout(o.timeout); err != nil {
181 return err
182 }
183 var res []error
184
185 if o.DevicetypeID != nil {
186
187 // query param devicetype_id
188 var qrDevicetypeID string
189 if o.DevicetypeID != nil {
190 qrDevicetypeID = *o.DevicetypeID
191 }
192 qDevicetypeID := qrDevicetypeID
193 if qDevicetypeID != "" {
194 if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil {
195 return err
196 }
197 }
198
199 }
200
201 if o.Limit != nil {
202
203 // query param limit
204 var qrLimit int64
205 if o.Limit != nil {
206 qrLimit = *o.Limit
207 }
208 qLimit := swag.FormatInt64(qrLimit)
209 if qLimit != "" {
210 if err := r.SetQueryParam("limit", qLimit); err != nil {
211 return err
212 }
213 }
214
215 }
216
217 if o.Name != nil {
218
219 // query param name
220 var qrName string
221 if o.Name != nil {
222 qrName = *o.Name
223 }
224 qName := qrName
225 if qName != "" {
226 if err := r.SetQueryParam("name", qName); err != nil {
227 return err
228 }
229 }
230
231 }
232
233 if o.Offset != nil {
234
235 // query param offset
236 var qrOffset int64
237 if o.Offset != nil {
238 qrOffset = *o.Offset
239 }
240 qOffset := swag.FormatInt64(qrOffset)
241 if qOffset != "" {
242 if err := r.SetQueryParam("offset", qOffset); err != nil {
243 return err
244 }
245 }
246
247 }
248
249 if len(res) > 0 {
250 return errors.CompositeValidationError(res...)
251 }
252 return nil
253}