zuora_api 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/zuora_api/login.rb +5 -5
- data/lib/zuora_api/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: 51dc4d70182c683d9efefd250e5437cf6bbe3d7f
|
|
4
|
+
data.tar.gz: 16c4584c07330360d07e815161f031681f459d00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 445f22fb4afc53de2bbdfc589f734da612df3a4d334b199f1e75b1852aa1f2d5f74a5f8c745a81718a27c3b3771558e16fd22b611a186016cb3af0d7432988f6
|
|
7
|
+
data.tar.gz: 4f412e8e5da646b80cd98d24313af276b0cf326c755c11e4a9394d8745fdc4a38ada3fa666604e9297e7e3c7134b479c1a1e84599d95203bb12f4adabf766cf4
|
data/Gemfile.lock
CHANGED
data/lib/zuora_api/login.rb
CHANGED
|
@@ -263,15 +263,15 @@ module ZuoraAPI
|
|
|
263
263
|
result = "new"
|
|
264
264
|
while result != "completed" do
|
|
265
265
|
sleep(2)#sleep 2 seconds
|
|
266
|
-
response, fullResponse = self.rest_call(method: :get, body: {}, url: self.aqua_endpoint("batch-query/jobs/#{id}")
|
|
267
|
-
result
|
|
266
|
+
response, fullResponse = self.rest_call(method: :get, body: {}, url: self.aqua_endpoint("batch-query/jobs/#{id}"))
|
|
267
|
+
result = response["batches"][0]["status"]
|
|
268
268
|
if result == "error"
|
|
269
269
|
raise "Aqua Error: #{response}"
|
|
270
270
|
break
|
|
271
271
|
end
|
|
272
272
|
end
|
|
273
273
|
fileId = response["batches"][0]["fileId"]
|
|
274
|
-
return self.get_file(file_name: "#{
|
|
274
|
+
return self.get_file(file_name: "#{fileId}.csv", url: self.aqua_endpoint("file/#{fileId}"), headers: {"Authorization" => "ZSession " + self.current_session, 'Content-Type' => "application/json; charset=utf-8"},file_type: "csv")
|
|
275
275
|
end
|
|
276
276
|
|
|
277
277
|
|
|
@@ -361,7 +361,7 @@ module ZuoraAPI
|
|
|
361
361
|
return self
|
|
362
362
|
end
|
|
363
363
|
|
|
364
|
-
def get_file(file_name: 'example.csv', url: nil, headers: {}, count: 3)
|
|
364
|
+
def get_file(file_name: 'example.csv', url: nil, headers: {}, count: 3, file_type: "zip")
|
|
365
365
|
begin
|
|
366
366
|
uri = URI.parse(url)
|
|
367
367
|
filename = File.basename(uri.path)
|
|
@@ -387,7 +387,7 @@ module ZuoraAPI
|
|
|
387
387
|
raise ex
|
|
388
388
|
|
|
389
389
|
when Net::HTTPOK
|
|
390
|
-
temp_file = Tempfile.new([filename.rpartition('.').first, "
|
|
390
|
+
temp_file = Tempfile.new([filename.rpartition('.').first, ".#{file_type}"], "#{Rails.root}/tmp")
|
|
391
391
|
temp_file.binmode
|
|
392
392
|
|
|
393
393
|
size, export_progress = [0, 0]
|
data/lib/zuora_api/version.rb
CHANGED