@@ -232,34 +232,35 @@ def fill_with_data(self, data):
232232
233233 return self
234234
235- def fetch (self , options = {}):
236- """Fetch the current project information .
235+ def regenerate_private_key (self , options = {}):
236+ """Regenerate the project private key. Make sure to store the new private key and use it in any future request .
237237 Keyword argument:
238238
239239 options -- Options for the request"""
240240 self .fill_with_data (options )
241241
242242 request = Request (self ._client )
243- path = "/projects/" + quote_plus ( self . id ) + " "
243+ path = "/private-keys "
244244 data = {
245245
246246 }
247247
248- response = Response (request .get (path , data , options ))
248+ response = Response (request .post (path , data , options ))
249249 return_values = []
250250
251251 body = response .body
252252 body = body ["project" ]
253253
254254
255- return_values .append (self .fill_with_data (body ))
255+ obj = processout .Project (self ._client )
256+ return_values .append (obj .fill_with_data (body ))
256257
257258
258259
259260 return return_values [0 ]
260261
261- def save (self , options = {}):
262- """Save the updated project's attributes .
262+ def fetch (self , options = {}):
263+ """Fetch the current project information .
263264 Keyword argument:
264265
265266 options -- Options for the request"""
@@ -271,7 +272,7 @@ def save(self, options = {}):
271272
272273 }
273274
274- response = Response (request .put (path , data , options ))
275+ response = Response (request .get (path , data , options ))
275276 return_values = []
276277
277278 body = response .body
@@ -284,50 +285,49 @@ def save(self, options = {}):
284285
285286 return return_values [0 ]
286287
287- def delete (self , options = {}):
288- """Delete the project. Be careful! Executing this request will prevent any further interaction with the API that uses this project.
288+ def save (self , options = {}):
289+ """Save the updated project's attributes .
289290 Keyword argument:
290291
291292 options -- Options for the request"""
292293 self .fill_with_data (options )
293294
294295 request = Request (self ._client )
295- path = "/projects/{project_id} "
296+ path = "/projects/" + quote_plus ( self . id ) + " "
296297 data = {
297298
298299 }
299300
300- response = Response (request .delete (path , data , options ))
301+ response = Response (request .put (path , data , options ))
301302 return_values = []
302303
303- return_values .append (response .success )
304+ body = response .body
305+ body = body ["project" ]
306+
307+
308+ return_values .append (self .fill_with_data (body ))
309+
304310
305311
306312 return return_values [0 ]
307313
308- def regenerate_private_key (self , options = {}):
309- """Regenerate the project private key. Make sure to store the new private key and use it in any future request .
314+ def delete (self , options = {}):
315+ """Delete the project. Be careful! Executing this request will prevent any further interaction with the API that uses this project .
310316 Keyword argument:
311317
312318 options -- Options for the request"""
313319 self .fill_with_data (options )
314320
315321 request = Request (self ._client )
316- path = "/projects/{project_id}/private-key "
322+ path = "/projects/{project_id}"
317323 data = {
318324
319325 }
320326
321- response = Response (request .post (path , data , options ))
327+ response = Response (request .delete (path , data , options ))
322328 return_values = []
323329
324- body = response .body
325- body = body ["project" ]
326-
327-
328- obj = processout .Project (self ._client )
329- return_values .append (obj .fill_with_data (body ))
330-
330+ return_values .append (response .success )
331331
332332
333333 return return_values [0 ]
0 commit comments