zuora_connect 1.7.30 → 1.7.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/zuora_connect/app_instance_base.rb +28 -0
- data/lib/zuora_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca47847ecc0012579c4750339ba233a232543b89
|
4
|
+
data.tar.gz: c3821144ce11d78431dd2faacecf549a683b5eb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e35be2b03104d41d2c570103452b42964fb87d7f3e4803eaadb0a4d474dad5c7b2e01f7ac93b7553b2aa058cbbaa47021b1a5bf4c1eb2b53bf92a279b1191faa
|
7
|
+
data.tar.gz: a804166c6e8869748a395d7010ae9fa6e832af25c837d563dc47829b79147a8634c1b287cfb694f1ddded44bdf6ab353473ff252112ff13b74a384c4e889b1f0
|
@@ -295,6 +295,34 @@ module ZuoraConnect
|
|
295
295
|
raise
|
296
296
|
end
|
297
297
|
end
|
298
|
+
|
299
|
+
def update_task(options)
|
300
|
+
update_task_count ||= 0
|
301
|
+
response = HTTParty.post(ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}/update_task",:body => {:access_token => self.username}.merge(options))
|
302
|
+
parsed_json = JSON.parse(response.body)
|
303
|
+
if response.code == 200
|
304
|
+
return parsed_json
|
305
|
+
elsif response.code == 400
|
306
|
+
raise ZuoraConnect::Exceptions::APIError.new(message: parsed_json['errors'].join(' '), response: response.body, code: response.code)
|
307
|
+
else
|
308
|
+
raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
|
309
|
+
end
|
310
|
+
rescue Net::ReadTimeout, Net::OpenTimeout, Errno::EPIPE, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => ex
|
311
|
+
if (update_task_count += 1) < 3
|
312
|
+
retry
|
313
|
+
else
|
314
|
+
raise
|
315
|
+
end
|
316
|
+
rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
|
317
|
+
if (update_task_count += 1) < 3
|
318
|
+
if ex.code == 401
|
319
|
+
self.refresh_oauth
|
320
|
+
end
|
321
|
+
retry
|
322
|
+
else
|
323
|
+
raise
|
324
|
+
end
|
325
|
+
end
|
298
326
|
#### END Task Mathods ####
|
299
327
|
|
300
328
|
#### START Connect OAUTH methods ####
|