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