Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 1 | // 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 | |
| 17 | package 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 | |
| 22 | import ( |
| 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 | // NewIPAMAggregatesListParams creates a new IPAMAggregatesListParams object |
| 37 | // with the default values initialized. |
| 38 | func NewIPAMAggregatesListParams() *IPAMAggregatesListParams { |
| 39 | var () |
| 40 | return &IPAMAggregatesListParams{ |
| 41 | |
| 42 | timeout: cr.DefaultTimeout, |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // NewIPAMAggregatesListParamsWithTimeout creates a new IPAMAggregatesListParams object |
| 47 | // with the default values initialized, and the ability to set a timeout on a request |
| 48 | func NewIPAMAggregatesListParamsWithTimeout(timeout time.Duration) *IPAMAggregatesListParams { |
| 49 | var () |
| 50 | return &IPAMAggregatesListParams{ |
| 51 | |
| 52 | timeout: timeout, |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // NewIPAMAggregatesListParamsWithContext creates a new IPAMAggregatesListParams object |
| 57 | // with the default values initialized, and the ability to set a context for a request |
| 58 | func NewIPAMAggregatesListParamsWithContext(ctx context.Context) *IPAMAggregatesListParams { |
| 59 | var () |
| 60 | return &IPAMAggregatesListParams{ |
| 61 | |
| 62 | Context: ctx, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // NewIPAMAggregatesListParamsWithHTTPClient creates a new IPAMAggregatesListParams object |
| 67 | // with the default values initialized, and the ability to set a custom HTTPClient for a request |
| 68 | func NewIPAMAggregatesListParamsWithHTTPClient(client *http.Client) *IPAMAggregatesListParams { |
| 69 | var () |
| 70 | return &IPAMAggregatesListParams{ |
| 71 | HTTPClient: client, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /*IPAMAggregatesListParams contains all the parameters to send to the API endpoint |
| 76 | for the ipam aggregates list operation typically these are written to a http.Request |
| 77 | */ |
| 78 | type IPAMAggregatesListParams struct { |
| 79 | |
| 80 | /*DateAdded*/ |
| 81 | DateAdded *string |
| 82 | /*Family*/ |
| 83 | Family *string |
| 84 | /*IDIn |
| 85 | Multiple values may be separated by commas. |
| 86 | |
| 87 | */ |
| 88 | IDIn *string |
| 89 | /*Limit |
| 90 | Number of results to return per page. |
| 91 | |
| 92 | */ |
| 93 | Limit *int64 |
| 94 | /*Offset |
| 95 | The initial index from which to return the results. |
| 96 | |
| 97 | */ |
| 98 | Offset *int64 |
| 99 | /*Q*/ |
| 100 | Q *string |
| 101 | /*Rir*/ |
| 102 | Rir *string |
| 103 | /*RirID*/ |
| 104 | RirID *string |
| 105 | |
| 106 | timeout time.Duration |
| 107 | Context context.Context |
| 108 | HTTPClient *http.Client |
| 109 | } |
| 110 | |
| 111 | // WithTimeout adds the timeout to the ipam aggregates list params |
| 112 | func (o *IPAMAggregatesListParams) WithTimeout(timeout time.Duration) *IPAMAggregatesListParams { |
| 113 | o.SetTimeout(timeout) |
| 114 | return o |
| 115 | } |
| 116 | |
| 117 | // SetTimeout adds the timeout to the ipam aggregates list params |
| 118 | func (o *IPAMAggregatesListParams) SetTimeout(timeout time.Duration) { |
| 119 | o.timeout = timeout |
| 120 | } |
| 121 | |
| 122 | // WithContext adds the context to the ipam aggregates list params |
| 123 | func (o *IPAMAggregatesListParams) WithContext(ctx context.Context) *IPAMAggregatesListParams { |
| 124 | o.SetContext(ctx) |
| 125 | return o |
| 126 | } |
| 127 | |
| 128 | // SetContext adds the context to the ipam aggregates list params |
| 129 | func (o *IPAMAggregatesListParams) SetContext(ctx context.Context) { |
| 130 | o.Context = ctx |
| 131 | } |
| 132 | |
| 133 | // WithHTTPClient adds the HTTPClient to the ipam aggregates list params |
| 134 | func (o *IPAMAggregatesListParams) WithHTTPClient(client *http.Client) *IPAMAggregatesListParams { |
| 135 | o.SetHTTPClient(client) |
| 136 | return o |
| 137 | } |
| 138 | |
| 139 | // SetHTTPClient adds the HTTPClient to the ipam aggregates list params |
| 140 | func (o *IPAMAggregatesListParams) SetHTTPClient(client *http.Client) { |
| 141 | o.HTTPClient = client |
| 142 | } |
| 143 | |
| 144 | // WithDateAdded adds the dateAdded to the ipam aggregates list params |
| 145 | func (o *IPAMAggregatesListParams) WithDateAdded(dateAdded *string) *IPAMAggregatesListParams { |
| 146 | o.SetDateAdded(dateAdded) |
| 147 | return o |
| 148 | } |
| 149 | |
| 150 | // SetDateAdded adds the dateAdded to the ipam aggregates list params |
| 151 | func (o *IPAMAggregatesListParams) SetDateAdded(dateAdded *string) { |
| 152 | o.DateAdded = dateAdded |
| 153 | } |
| 154 | |
| 155 | // WithFamily adds the family to the ipam aggregates list params |
| 156 | func (o *IPAMAggregatesListParams) WithFamily(family *string) *IPAMAggregatesListParams { |
| 157 | o.SetFamily(family) |
| 158 | return o |
| 159 | } |
| 160 | |
| 161 | // SetFamily adds the family to the ipam aggregates list params |
| 162 | func (o *IPAMAggregatesListParams) SetFamily(family *string) { |
| 163 | o.Family = family |
| 164 | } |
| 165 | |
| 166 | // WithIDIn adds the iDIn to the ipam aggregates list params |
| 167 | func (o *IPAMAggregatesListParams) WithIDIn(iDIn *string) *IPAMAggregatesListParams { |
| 168 | o.SetIDIn(iDIn) |
| 169 | return o |
| 170 | } |
| 171 | |
| 172 | // SetIDIn adds the idIn to the ipam aggregates list params |
| 173 | func (o *IPAMAggregatesListParams) SetIDIn(iDIn *string) { |
| 174 | o.IDIn = iDIn |
| 175 | } |
| 176 | |
| 177 | // WithLimit adds the limit to the ipam aggregates list params |
| 178 | func (o *IPAMAggregatesListParams) WithLimit(limit *int64) *IPAMAggregatesListParams { |
| 179 | o.SetLimit(limit) |
| 180 | return o |
| 181 | } |
| 182 | |
| 183 | // SetLimit adds the limit to the ipam aggregates list params |
| 184 | func (o *IPAMAggregatesListParams) SetLimit(limit *int64) { |
| 185 | o.Limit = limit |
| 186 | } |
| 187 | |
| 188 | // WithOffset adds the offset to the ipam aggregates list params |
| 189 | func (o *IPAMAggregatesListParams) WithOffset(offset *int64) *IPAMAggregatesListParams { |
| 190 | o.SetOffset(offset) |
| 191 | return o |
| 192 | } |
| 193 | |
| 194 | // SetOffset adds the offset to the ipam aggregates list params |
| 195 | func (o *IPAMAggregatesListParams) SetOffset(offset *int64) { |
| 196 | o.Offset = offset |
| 197 | } |
| 198 | |
| 199 | // WithQ adds the q to the ipam aggregates list params |
| 200 | func (o *IPAMAggregatesListParams) WithQ(q *string) *IPAMAggregatesListParams { |
| 201 | o.SetQ(q) |
| 202 | return o |
| 203 | } |
| 204 | |
| 205 | // SetQ adds the q to the ipam aggregates list params |
| 206 | func (o *IPAMAggregatesListParams) SetQ(q *string) { |
| 207 | o.Q = q |
| 208 | } |
| 209 | |
| 210 | // WithRir adds the rir to the ipam aggregates list params |
| 211 | func (o *IPAMAggregatesListParams) WithRir(rir *string) *IPAMAggregatesListParams { |
| 212 | o.SetRir(rir) |
| 213 | return o |
| 214 | } |
| 215 | |
| 216 | // SetRir adds the rir to the ipam aggregates list params |
| 217 | func (o *IPAMAggregatesListParams) SetRir(rir *string) { |
| 218 | o.Rir = rir |
| 219 | } |
| 220 | |
| 221 | // WithRirID adds the rirID to the ipam aggregates list params |
| 222 | func (o *IPAMAggregatesListParams) WithRirID(rirID *string) *IPAMAggregatesListParams { |
| 223 | o.SetRirID(rirID) |
| 224 | return o |
| 225 | } |
| 226 | |
| 227 | // SetRirID adds the rirId to the ipam aggregates list params |
| 228 | func (o *IPAMAggregatesListParams) SetRirID(rirID *string) { |
| 229 | o.RirID = rirID |
| 230 | } |
| 231 | |
| 232 | // WriteToRequest writes these params to a swagger request |
| 233 | func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { |
| 234 | |
| 235 | if err := r.SetTimeout(o.timeout); err != nil { |
| 236 | return err |
| 237 | } |
| 238 | var res []error |
| 239 | |
| 240 | if o.DateAdded != nil { |
| 241 | |
| 242 | // query param date_added |
| 243 | var qrDateAdded string |
| 244 | if o.DateAdded != nil { |
| 245 | qrDateAdded = *o.DateAdded |
| 246 | } |
| 247 | qDateAdded := qrDateAdded |
| 248 | if qDateAdded != "" { |
| 249 | if err := r.SetQueryParam("date_added", qDateAdded); err != nil { |
| 250 | return err |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | } |
| 255 | |
| 256 | if o.Family != nil { |
| 257 | |
| 258 | // query param family |
| 259 | var qrFamily string |
| 260 | if o.Family != nil { |
| 261 | qrFamily = *o.Family |
| 262 | } |
| 263 | qFamily := qrFamily |
| 264 | if qFamily != "" { |
| 265 | if err := r.SetQueryParam("family", qFamily); err != nil { |
| 266 | return err |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | } |
| 271 | |
| 272 | if o.IDIn != nil { |
| 273 | |
| 274 | // query param id__in |
| 275 | var qrIDIn string |
| 276 | if o.IDIn != nil { |
| 277 | qrIDIn = *o.IDIn |
| 278 | } |
| 279 | qIDIn := qrIDIn |
| 280 | if qIDIn != "" { |
| 281 | if err := r.SetQueryParam("id__in", qIDIn); err != nil { |
| 282 | return err |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | } |
| 287 | |
| 288 | if o.Limit != nil { |
| 289 | |
| 290 | // query param limit |
| 291 | var qrLimit int64 |
| 292 | if o.Limit != nil { |
| 293 | qrLimit = *o.Limit |
| 294 | } |
| 295 | qLimit := swag.FormatInt64(qrLimit) |
| 296 | if qLimit != "" { |
| 297 | if err := r.SetQueryParam("limit", qLimit); err != nil { |
| 298 | return err |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | } |
| 303 | |
| 304 | if o.Offset != nil { |
| 305 | |
| 306 | // query param offset |
| 307 | var qrOffset int64 |
| 308 | if o.Offset != nil { |
| 309 | qrOffset = *o.Offset |
| 310 | } |
| 311 | qOffset := swag.FormatInt64(qrOffset) |
| 312 | if qOffset != "" { |
| 313 | if err := r.SetQueryParam("offset", qOffset); err != nil { |
| 314 | return err |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | } |
| 319 | |
| 320 | if o.Q != nil { |
| 321 | |
| 322 | // query param q |
| 323 | var qrQ string |
| 324 | if o.Q != nil { |
| 325 | qrQ = *o.Q |
| 326 | } |
| 327 | qQ := qrQ |
| 328 | if qQ != "" { |
| 329 | if err := r.SetQueryParam("q", qQ); err != nil { |
| 330 | return err |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | } |
| 335 | |
| 336 | if o.Rir != nil { |
| 337 | |
| 338 | // query param rir |
| 339 | var qrRir string |
| 340 | if o.Rir != nil { |
| 341 | qrRir = *o.Rir |
| 342 | } |
| 343 | qRir := qrRir |
| 344 | if qRir != "" { |
| 345 | if err := r.SetQueryParam("rir", qRir); err != nil { |
| 346 | return err |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | } |
| 351 | |
| 352 | if o.RirID != nil { |
| 353 | |
| 354 | // query param rir_id |
| 355 | var qrRirID string |
| 356 | if o.RirID != nil { |
| 357 | qrRirID = *o.RirID |
| 358 | } |
| 359 | qRirID := qrRirID |
| 360 | if qRirID != "" { |
| 361 | if err := r.SetQueryParam("rir_id", qRirID); err != nil { |
| 362 | return err |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | } |
| 367 | |
| 368 | if len(res) > 0 { |
| 369 | return errors.CompositeValidationError(res...) |
| 370 | } |
| 371 | return nil |
| 372 | } |