power-bi 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/power-bi/report.rb +13 -0
- data/lib/power-bi/tenant.rb +1 -1
- data/lib/power-bi/user.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5aaadec6cec57b22f4780dd2e1f4c64c55872d49f5a17a59326fcff099844dd
|
4
|
+
data.tar.gz: 1a6bf8c48a1d17333f58519c5ee23ee9a85025c63110c6cc2f2fe9243566f7ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 570af0ad49001778d237e4ce712a8120d879cc83d53a9b4a877d2d51ee6fcc3dde4e913cc8a3c42273ce5de45d31d7922308fee03c895fb6fcbce46332b06288
|
7
|
+
data.tar.gz: 760813b41e3318fc52871f3adc61f4efcf518f9333f93fcf9295c15b9e61d094518cbd3adbbf7fec0c3c7921239d2082460099fc2adffcd4b60c15067e5946e1
|
data/README.md
CHANGED
@@ -34,6 +34,7 @@ Note 2: to limit the number of API calls, it is best to directly use the _getter
|
|
34
34
|
* Clone a report from one workspace to another: `report.clone(src_workspace, new_report_name)`
|
35
35
|
* Rebind report to another dataset: `report.rebind(dataset)`
|
36
36
|
* Export report to file: `report.export_to_file(filename, format: 'PDF')`
|
37
|
+
* Get embed token: `report.embed_token(access_level: 'View', lifetime_in_minutes: 60)`
|
37
38
|
|
38
39
|
## Pages
|
39
40
|
|
data/lib/power-bi/report.rb
CHANGED
@@ -79,6 +79,19 @@ module PowerBI
|
|
79
79
|
File.open(filename, "wb") { |f| f.write(data) }
|
80
80
|
end
|
81
81
|
|
82
|
+
def embed_token(access_level: 'View', lifetime_in_minutes: 60)
|
83
|
+
data = @tenant.post("/groups/#{workspace.id}/reports/#{id}/GenerateToken") do |req|
|
84
|
+
req.body = {
|
85
|
+
accessLevel: access_level,
|
86
|
+
lifetimeInMinutes: lifetime_in_minutes
|
87
|
+
}.to_json
|
88
|
+
end
|
89
|
+
{
|
90
|
+
token: data[:token],
|
91
|
+
expiration: Time.parse(data[:expiration])
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
82
95
|
end
|
83
96
|
|
84
97
|
class ReportArray < Array
|
data/lib/power-bi/tenant.rb
CHANGED
@@ -14,7 +14,7 @@ module PowerBI
|
|
14
14
|
##################
|
15
15
|
@retry_options = {
|
16
16
|
max: retries,
|
17
|
-
exceptions: [Errno::ETIMEDOUT, Timeout::Error, Faraday::TimeoutError, Faraday::RetriableResponse],
|
17
|
+
exceptions: [Errno::ETIMEDOUT, Timeout::Error, Faraday::TimeoutError, Faraday::RetriableResponse, Faraday::ConnectionFailed],
|
18
18
|
methods: [:get, :post, :patch, :delete],
|
19
19
|
retry_statuses: [500], # internal server error
|
20
20
|
interval: 0.2,
|
data/lib/power-bi/user.rb
CHANGED