This repository has been archived by the owner on Jun 4, 2019. It is now read-only.
/
get_cloud_project_service_name_image_parameters.go
235 lines (191 loc) · 7.16 KB
/
get_cloud_project_service_name_image_parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2017 The go-ovh Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewGetCloudProjectServiceNameImageParams creates a new GetCloudProjectServiceNameImageParams object
// with the default values initialized.
func NewGetCloudProjectServiceNameImageParams() *GetCloudProjectServiceNameImageParams {
var ()
return &GetCloudProjectServiceNameImageParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetCloudProjectServiceNameImageParamsWithTimeout creates a new GetCloudProjectServiceNameImageParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetCloudProjectServiceNameImageParamsWithTimeout(timeout time.Duration) *GetCloudProjectServiceNameImageParams {
var ()
return &GetCloudProjectServiceNameImageParams{
timeout: timeout,
}
}
// NewGetCloudProjectServiceNameImageParamsWithContext creates a new GetCloudProjectServiceNameImageParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetCloudProjectServiceNameImageParamsWithContext(ctx context.Context) *GetCloudProjectServiceNameImageParams {
var ()
return &GetCloudProjectServiceNameImageParams{
Context: ctx,
}
}
// NewGetCloudProjectServiceNameImageParamsWithHTTPClient creates a new GetCloudProjectServiceNameImageParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetCloudProjectServiceNameImageParamsWithHTTPClient(client *http.Client) *GetCloudProjectServiceNameImageParams {
var ()
return &GetCloudProjectServiceNameImageParams{
HTTPClient: client,
}
}
/*GetCloudProjectServiceNameImageParams contains all the parameters to send to the API endpoint
for the get cloud project service name image operation typically these are written to a http.Request
*/
type GetCloudProjectServiceNameImageParams struct {
/*FlavorType*/
FlavorType *string
/*OsType*/
OsType *string
/*Region*/
Region *string
/*ServiceName*/
ServiceName string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithTimeout(timeout time.Duration) *GetCloudProjectServiceNameImageParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithContext(ctx context.Context) *GetCloudProjectServiceNameImageParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithHTTPClient(client *http.Client) *GetCloudProjectServiceNameImageParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFlavorType adds the flavorType to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithFlavorType(flavorType *string) *GetCloudProjectServiceNameImageParams {
o.SetFlavorType(flavorType)
return o
}
// SetFlavorType adds the flavorType to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetFlavorType(flavorType *string) {
o.FlavorType = flavorType
}
// WithOsType adds the osType to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithOsType(osType *string) *GetCloudProjectServiceNameImageParams {
o.SetOsType(osType)
return o
}
// SetOsType adds the osType to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetOsType(osType *string) {
o.OsType = osType
}
// WithRegion adds the region to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithRegion(region *string) *GetCloudProjectServiceNameImageParams {
o.SetRegion(region)
return o
}
// SetRegion adds the region to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetRegion(region *string) {
o.Region = region
}
// WithServiceName adds the serviceName to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) WithServiceName(serviceName string) *GetCloudProjectServiceNameImageParams {
o.SetServiceName(serviceName)
return o
}
// SetServiceName adds the serviceName to the get cloud project service name image params
func (o *GetCloudProjectServiceNameImageParams) SetServiceName(serviceName string) {
o.ServiceName = serviceName
}
// WriteToRequest writes these params to a swagger request
func (o *GetCloudProjectServiceNameImageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.FlavorType != nil {
// query param flavorType
var qrFlavorType string
if o.FlavorType != nil {
qrFlavorType = *o.FlavorType
}
qFlavorType := qrFlavorType
if qFlavorType != "" {
if err := r.SetQueryParam("flavorType", qFlavorType); err != nil {
return err
}
}
}
if o.OsType != nil {
// query param osType
var qrOsType string
if o.OsType != nil {
qrOsType = *o.OsType
}
qOsType := qrOsType
if qOsType != "" {
if err := r.SetQueryParam("osType", qOsType); err != nil {
return err
}
}
}
if o.Region != nil {
// query param region
var qrRegion string
if o.Region != nil {
qrRegion = *o.Region
}
qRegion := qrRegion
if qRegion != "" {
if err := r.SetQueryParam("region", qRegion); err != nil {
return err
}
}
}
// path param serviceName
if err := r.SetPathParam("serviceName", o.ServiceName); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}