Class: PowerBI::Report
- Inherits:
-
Object
- Object
- PowerBI::Report
- Defined in:
- lib/power-bi/report.rb
Instance Attribute Summary collapse
-
#dataset_id ⇒ Object
readonly
Returns the value of attribute dataset_id.
-
#embed_url ⇒ Object
readonly
Returns the value of attribute embed_url.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_from_pbix ⇒ Object
readonly
Returns the value of attribute is_from_pbix.
-
#is_owned_by_me ⇒ Object
readonly
Returns the value of attribute is_owned_by_me.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#report_type ⇒ Object
readonly
Returns the value of attribute report_type.
-
#web_url ⇒ Object
readonly
Returns the value of attribute web_url.
-
#workspace ⇒ Object
readonly
Returns the value of attribute workspace.
Instance Method Summary collapse
- #clone(target_workspace, new_report_name) ⇒ Object
-
#initialize(tenant, data) ⇒ Report
constructor
A new instance of Report.
- #rebind(target_dataset) ⇒ Object
Constructor Details
#initialize(tenant, data) ⇒ Report
Returns a new instance of Report.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/power-bi/report.rb', line 5 def initialize(tenant, data) @id = data[:id] @report_type = data[:reportType] @name = data[:name] @web_url = data[:webUrl] @embed_url = data[:embedUrl] @is_from_pbix = data[:isFromPbix] @is_owned_by_me = data[:isOwnedByMe] @dataset_id = data[:datasetId] @workspace = data[:workspace] @tenant = tenant end |
Instance Attribute Details
#dataset_id ⇒ Object (readonly)
Returns the value of attribute dataset_id.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def dataset_id @dataset_id end |
#embed_url ⇒ Object (readonly)
Returns the value of attribute embed_url.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def @embed_url end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def id @id end |
#is_from_pbix ⇒ Object (readonly)
Returns the value of attribute is_from_pbix.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def is_from_pbix @is_from_pbix end |
#is_owned_by_me ⇒ Object (readonly)
Returns the value of attribute is_owned_by_me.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def is_owned_by_me @is_owned_by_me end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def name @name end |
#report_type ⇒ Object (readonly)
Returns the value of attribute report_type.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def report_type @report_type end |
#web_url ⇒ Object (readonly)
Returns the value of attribute web_url.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def web_url @web_url end |
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
3 4 5 |
# File 'lib/power-bi/report.rb', line 3 def workspace @workspace end |
Instance Method Details
#clone(target_workspace, new_report_name) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/power-bi/report.rb', line 18 def clone(target_workspace, new_report_name) data = @tenant.post("/reports/#{@id}/Clone") do |req| req.body = { name: new_report_name, targetWorkspaceId: target_workspace.id }.to_json end target_workspace.reports.reload data[:workspace] = target_workspace Report.new(@tenant, data) end |
#rebind(target_dataset) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/power-bi/report.rb', line 30 def rebind(target_dataset) @tenant.post("/groups/#{workspace.id}/reports/#{id}/Rebind") do |req| req.body = { datasetId: target_dataset.id }.to_json end true end |