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