blob: 93db4f9d276947f24470381d6732718aeebd6e34 [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 extras
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// NewExtrasImageAttachmentsListParams creates a new ExtrasImageAttachmentsListParams object
37// with the default values initialized.
38func NewExtrasImageAttachmentsListParams() *ExtrasImageAttachmentsListParams {
39 var ()
40 return &ExtrasImageAttachmentsListParams{
41
42 timeout: cr.DefaultTimeout,
43 }
44}
45
46// NewExtrasImageAttachmentsListParamsWithTimeout creates a new ExtrasImageAttachmentsListParams object
47// with the default values initialized, and the ability to set a timeout on a request
48func NewExtrasImageAttachmentsListParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams {
49 var ()
50 return &ExtrasImageAttachmentsListParams{
51
52 timeout: timeout,
53 }
54}
55
56// NewExtrasImageAttachmentsListParamsWithContext creates a new ExtrasImageAttachmentsListParams object
57// with the default values initialized, and the ability to set a context for a request
58func NewExtrasImageAttachmentsListParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsListParams {
59 var ()
60 return &ExtrasImageAttachmentsListParams{
61
62 Context: ctx,
63 }
64}
65
66// NewExtrasImageAttachmentsListParamsWithHTTPClient creates a new ExtrasImageAttachmentsListParams object
67// with the default values initialized, and the ability to set a custom HTTPClient for a request
68func NewExtrasImageAttachmentsListParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams {
69 var ()
70 return &ExtrasImageAttachmentsListParams{
71 HTTPClient: client,
72 }
73}
74
75/*ExtrasImageAttachmentsListParams contains all the parameters to send to the API endpoint
76for the extras image attachments list operation typically these are written to a http.Request
77*/
78type ExtrasImageAttachmentsListParams struct {
79
80 /*Limit
81 Number of results to return per page.
82
83 */
84 Limit *int64
85 /*Offset
86 The initial index from which to return the results.
87
88 */
89 Offset *int64
90
91 timeout time.Duration
92 Context context.Context
93 HTTPClient *http.Client
94}
95
96// WithTimeout adds the timeout to the extras image attachments list params
97func (o *ExtrasImageAttachmentsListParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams {
98 o.SetTimeout(timeout)
99 return o
100}
101
102// SetTimeout adds the timeout to the extras image attachments list params
103func (o *ExtrasImageAttachmentsListParams) SetTimeout(timeout time.Duration) {
104 o.timeout = timeout
105}
106
107// WithContext adds the context to the extras image attachments list params
108func (o *ExtrasImageAttachmentsListParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsListParams {
109 o.SetContext(ctx)
110 return o
111}
112
113// SetContext adds the context to the extras image attachments list params
114func (o *ExtrasImageAttachmentsListParams) SetContext(ctx context.Context) {
115 o.Context = ctx
116}
117
118// WithHTTPClient adds the HTTPClient to the extras image attachments list params
119func (o *ExtrasImageAttachmentsListParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams {
120 o.SetHTTPClient(client)
121 return o
122}
123
124// SetHTTPClient adds the HTTPClient to the extras image attachments list params
125func (o *ExtrasImageAttachmentsListParams) SetHTTPClient(client *http.Client) {
126 o.HTTPClient = client
127}
128
129// WithLimit adds the limit to the extras image attachments list params
130func (o *ExtrasImageAttachmentsListParams) WithLimit(limit *int64) *ExtrasImageAttachmentsListParams {
131 o.SetLimit(limit)
132 return o
133}
134
135// SetLimit adds the limit to the extras image attachments list params
136func (o *ExtrasImageAttachmentsListParams) SetLimit(limit *int64) {
137 o.Limit = limit
138}
139
140// WithOffset adds the offset to the extras image attachments list params
141func (o *ExtrasImageAttachmentsListParams) WithOffset(offset *int64) *ExtrasImageAttachmentsListParams {
142 o.SetOffset(offset)
143 return o
144}
145
146// SetOffset adds the offset to the extras image attachments list params
147func (o *ExtrasImageAttachmentsListParams) SetOffset(offset *int64) {
148 o.Offset = offset
149}
150
151// WriteToRequest writes these params to a swagger request
152func (o *ExtrasImageAttachmentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
153
154 if err := r.SetTimeout(o.timeout); err != nil {
155 return err
156 }
157 var res []error
158
159 if o.Limit != nil {
160
161 // query param limit
162 var qrLimit int64
163 if o.Limit != nil {
164 qrLimit = *o.Limit
165 }
166 qLimit := swag.FormatInt64(qrLimit)
167 if qLimit != "" {
168 if err := r.SetQueryParam("limit", qLimit); err != nil {
169 return err
170 }
171 }
172
173 }
174
175 if o.Offset != nil {
176
177 // query param offset
178 var qrOffset int64
179 if o.Offset != nil {
180 qrOffset = *o.Offset
181 }
182 qOffset := swag.FormatInt64(qrOffset)
183 if qOffset != "" {
184 if err := r.SetQueryParam("offset", qOffset); err != nil {
185 return err
186 }
187 }
188
189 }
190
191 if len(res) > 0 {
192 return errors.CompositeValidationError(res...)
193 }
194 return nil
195}