18
18
# python 2 and python 3 compatibility library
19
19
import six
20
20
21
- from patch_api .exceptions import ApiTypeError , ApiValueError
21
+ from patch_api .exceptions import (
22
+ ApiTypeError ,
23
+ ApiValueError
24
+ )
22
25
23
26
24
27
class ProjectsApi (object ):
@@ -29,17 +32,17 @@ class ProjectsApi(object):
29
32
"""
30
33
31
34
ALLOWED_QUERY_PARAMS = [
32
- "mass_g" ,
33
- "price_cents_usd" ,
34
- "project_id" ,
35
- "page" ,
36
- "distance_m" ,
37
- "transportation_method" ,
38
- "package_mass_g" ,
39
- "create_order" ,
40
- "model" ,
41
- "make" ,
42
- "year" ,
35
+ "mass_g" ,
36
+ "price_cents_usd" ,
37
+ "project_id" ,
38
+ "page" ,
39
+ "distance_m" ,
40
+ "transportation_method" ,
41
+ "package_mass_g" ,
42
+ "create_order" ,
43
+ "model" ,
44
+ "make" ,
45
+ "year"
43
46
]
44
47
45
48
def __init__ (self , api_client = None ):
@@ -67,7 +70,7 @@ def retrieve_project(self, id={}, **kwargs): # noqa: E501
67
70
If the method is called asynchronously,
68
71
returns the request thread.
69
72
"""
70
- kwargs [" _return_http_data_only" ] = True
73
+ kwargs [' _return_http_data_only' ] = True
71
74
return self .retrieve_project_with_http_info (id , ** kwargs ) # noqa: E501
72
75
73
76
def retrieve_project_with_http_info (self , id , ** kwargs ): # noqa: E501
@@ -97,42 +100,41 @@ def retrieve_project_with_http_info(self, id, **kwargs): # noqa: E501
97
100
98
101
local_var_params = locals ()
99
102
100
- all_params = ["id" ] # noqa: E501
101
- all_params .append (" async_req" )
102
- all_params .append (" _return_http_data_only" )
103
- all_params .append (" _preload_content" )
104
- all_params .append (" _request_timeout" )
105
- all_params .append (" mass_g" )
106
- all_params .append (" price_cents_usd" )
107
- all_params .append (" project_id" )
108
- all_params .append (" metadata" )
109
- all_params .append (" distance_m" )
110
- all_params .append (" transportation_method" )
111
- all_params .append (" package_mass_g" )
112
- all_params .append (" create_order" )
113
- all_params .append (" make" )
114
- all_params .append (" model" )
115
- all_params .append (" year" )
116
-
117
- for key , val in six .iteritems (local_var_params [" kwargs" ]):
103
+ all_params = ['id' ] # noqa: E501
104
+ all_params .append (' async_req' )
105
+ all_params .append (' _return_http_data_only' )
106
+ all_params .append (' _preload_content' )
107
+ all_params .append (' _request_timeout' )
108
+ all_params .append (' mass_g' )
109
+ all_params .append (' price_cents_usd' )
110
+ all_params .append (' project_id' )
111
+ all_params .append (' metadata' )
112
+ all_params .append (' distance_m' )
113
+ all_params .append (' transportation_method' )
114
+ all_params .append (' package_mass_g' )
115
+ all_params .append (' create_order' )
116
+ all_params .append (' make' )
117
+ all_params .append (' model' )
118
+ all_params .append (' year' )
119
+
120
+ for key , val in six .iteritems (local_var_params [' kwargs' ]):
118
121
if key not in all_params :
119
122
raise ApiTypeError (
120
123
"Got an unexpected keyword argument '%s'"
121
124
" to method retrieve_project" % key
122
125
)
123
126
local_var_params [key ] = val
124
- del local_var_params [" kwargs" ]
127
+ del local_var_params [' kwargs' ]
125
128
# verify the required parameter 'id' is set
126
- if "id" not in local_var_params or local_var_params ["id" ] is None :
127
- raise ApiValueError (
128
- "Missing the required parameter `id` when calling `retrieve_project`"
129
- ) # noqa: E501
129
+ if ('id' not in local_var_params or
130
+ local_var_params ['id' ] is None ):
131
+ raise ApiValueError ("Missing the required parameter `id` when calling `retrieve_project`" ) # noqa: E501
130
132
131
133
collection_formats = {}
132
134
133
135
path_params = {}
134
- if "id" in local_var_params :
135
- path_params ["id" ] = local_var_params ["id" ] # noqa: E501
136
+ if 'id' in local_var_params :
137
+ path_params ['id' ] = local_var_params ['id' ] # noqa: E501
136
138
137
139
query_params = []
138
140
for key in kwargs :
@@ -145,32 +147,27 @@ def retrieve_project_with_http_info(self, id, **kwargs): # noqa: E501
145
147
146
148
body_params = None
147
149
# HTTP header `Accept`
148
- header_params ["Accept" ] = self .api_client .select_header_accept (
149
- ["application/json" ]
150
- ) # noqa: E501
150
+ header_params ['Accept' ] = self .api_client .select_header_accept (
151
+ ['application/json' ]) # noqa: E501
151
152
152
153
# Authentication setting
153
- auth_settings = [" bearer_auth" ] # noqa: E501
154
+ auth_settings = [' bearer_auth' ] # noqa: E501
154
155
155
156
return self .api_client .call_api (
156
- "/v1/projects/{id}" ,
157
- "GET" ,
157
+ '/v1/projects/{id}' , 'GET' ,
158
158
path_params ,
159
159
query_params ,
160
160
header_params ,
161
161
body = body_params ,
162
162
post_params = form_params ,
163
163
files = local_var_files ,
164
- response_type = " ProjectResponse" , # noqa: E501
164
+ response_type = ' ProjectResponse' , # noqa: E501
165
165
auth_settings = auth_settings ,
166
- async_req = local_var_params .get ("async_req" ),
167
- _return_http_data_only = local_var_params .get (
168
- "_return_http_data_only"
169
- ), # noqa: E501
170
- _preload_content = local_var_params .get ("_preload_content" , True ),
171
- _request_timeout = local_var_params .get ("_request_timeout" ),
172
- collection_formats = collection_formats ,
173
- )
166
+ async_req = local_var_params .get ('async_req' ),
167
+ _return_http_data_only = local_var_params .get ('_return_http_data_only' ), # noqa: E501
168
+ _preload_content = local_var_params .get ('_preload_content' , True ),
169
+ _request_timeout = local_var_params .get ('_request_timeout' ),
170
+ collection_formats = collection_formats )
174
171
175
172
def retrieve_projects (self , ** kwargs ): # noqa: E501
176
173
"""Retrieves a list of projects # noqa: E501
@@ -194,7 +191,7 @@ def retrieve_projects(self, **kwargs): # noqa: E501
194
191
If the method is called asynchronously,
195
192
returns the request thread.
196
193
"""
197
- kwargs [" _return_http_data_only" ] = True
194
+ kwargs [' _return_http_data_only' ] = True
198
195
return self .retrieve_projects_with_http_info (** kwargs ) # noqa: E501
199
196
200
197
def retrieve_projects_with_http_info (self , ** kwargs ): # noqa: E501
@@ -224,31 +221,31 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501
224
221
225
222
local_var_params = locals ()
226
223
227
- all_params = [" page" ] # noqa: E501
228
- all_params .append (" async_req" )
229
- all_params .append (" _return_http_data_only" )
230
- all_params .append (" _preload_content" )
231
- all_params .append (" _request_timeout" )
232
- all_params .append (" mass_g" )
233
- all_params .append (" price_cents_usd" )
234
- all_params .append (" project_id" )
235
- all_params .append (" metadata" )
236
- all_params .append (" distance_m" )
237
- all_params .append (" transportation_method" )
238
- all_params .append (" package_mass_g" )
239
- all_params .append (" create_order" )
240
- all_params .append (" make" )
241
- all_params .append (" model" )
242
- all_params .append (" year" )
243
-
244
- for key , val in six .iteritems (local_var_params [" kwargs" ]):
224
+ all_params = [' page' ] # noqa: E501
225
+ all_params .append (' async_req' )
226
+ all_params .append (' _return_http_data_only' )
227
+ all_params .append (' _preload_content' )
228
+ all_params .append (' _request_timeout' )
229
+ all_params .append (' mass_g' )
230
+ all_params .append (' price_cents_usd' )
231
+ all_params .append (' project_id' )
232
+ all_params .append (' metadata' )
233
+ all_params .append (' distance_m' )
234
+ all_params .append (' transportation_method' )
235
+ all_params .append (' package_mass_g' )
236
+ all_params .append (' create_order' )
237
+ all_params .append (' make' )
238
+ all_params .append (' model' )
239
+ all_params .append (' year' )
240
+
241
+ for key , val in six .iteritems (local_var_params [' kwargs' ]):
245
242
if key not in all_params :
246
243
raise ApiTypeError (
247
244
"Got an unexpected keyword argument '%s'"
248
245
" to method retrieve_projects" % key
249
246
)
250
247
local_var_params [key ] = val
251
- del local_var_params [" kwargs" ]
248
+ del local_var_params [' kwargs' ]
252
249
253
250
collection_formats = {}
254
251
@@ -257,8 +254,8 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501
257
254
query_params = []
258
255
for key in kwargs :
259
256
query_params .append ([key , kwargs .get (key )])
260
- if " page" in local_var_params :
261
- query_params .append ((" page" , local_var_params [" page" ])) # noqa: E501
257
+ if ' page' in local_var_params :
258
+ query_params .append ((' page' , local_var_params [' page' ])) # noqa: E501
262
259
263
260
header_params = {}
264
261
@@ -267,29 +264,24 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501
267
264
268
265
body_params = None
269
266
# HTTP header `Accept`
270
- header_params ["Accept" ] = self .api_client .select_header_accept (
271
- ["application/json" ]
272
- ) # noqa: E501
267
+ header_params ['Accept' ] = self .api_client .select_header_accept (
268
+ ['application/json' ]) # noqa: E501
273
269
274
270
# Authentication setting
275
- auth_settings = [" bearer_auth" ] # noqa: E501
271
+ auth_settings = [' bearer_auth' ] # noqa: E501
276
272
277
273
return self .api_client .call_api (
278
- "/v1/projects" ,
279
- "GET" ,
274
+ '/v1/projects' , 'GET' ,
280
275
path_params ,
281
276
query_params ,
282
277
header_params ,
283
278
body = body_params ,
284
279
post_params = form_params ,
285
280
files = local_var_files ,
286
- response_type = " ProjectListResponse" , # noqa: E501
281
+ response_type = ' ProjectListResponse' , # noqa: E501
287
282
auth_settings = auth_settings ,
288
- async_req = local_var_params .get ("async_req" ),
289
- _return_http_data_only = local_var_params .get (
290
- "_return_http_data_only"
291
- ), # noqa: E501
292
- _preload_content = local_var_params .get ("_preload_content" , True ),
293
- _request_timeout = local_var_params .get ("_request_timeout" ),
294
- collection_formats = collection_formats ,
295
- )
283
+ async_req = local_var_params .get ('async_req' ),
284
+ _return_http_data_only = local_var_params .get ('_return_http_data_only' ), # noqa: E501
285
+ _preload_content = local_var_params .get ('_preload_content' , True ),
286
+ _request_timeout = local_var_params .get ('_request_timeout' ),
287
+ collection_formats = collection_formats )
0 commit comments