Class: PowerBI::Dataset
- Inherits:
-
Object
- Object
- PowerBI::Dataset
- Defined in:
- lib/power-bi/dataset.rb
Instance Attribute Summary collapse
-
#add_rows_API_enabled ⇒ Object
readonly
Returns the value of attribute add_rows_API_enabled.
-
#configured_by ⇒ Object
readonly
Returns the value of attribute configured_by.
-
#datasources ⇒ Object
readonly
Returns the value of attribute datasources.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_effective_identity_required ⇒ Object
readonly
Returns the value of attribute is_effective_identity_required.
-
#is_effective_identity_roles_required ⇒ Object
readonly
Returns the value of attribute is_effective_identity_roles_required.
-
#is_on_prem_gateway_required ⇒ Object
readonly
Returns the value of attribute is_on_prem_gateway_required.
-
#is_refreshable ⇒ Object
readonly
Returns the value of attribute is_refreshable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#refresh_history ⇒ Object
readonly
Returns the value of attribute refresh_history.
-
#target_storage_mode ⇒ Object
readonly
Returns the value of attribute target_storage_mode.
-
#workspace ⇒ Object
readonly
Returns the value of attribute workspace.
Instance Method Summary collapse
- #bind_to_gateway(gateway, gateway_datasource) ⇒ Object
- #delete ⇒ Object
-
#initialize(tenant, data) ⇒ Dataset
constructor
A new instance of Dataset.
- #last_refresh ⇒ Object
- #refresh ⇒ Object
- #update_parameter(name, value) ⇒ Object
Constructor Details
#initialize(tenant, data) ⇒ Dataset
Returns a new instance of Dataset.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/power-bi/dataset.rb', line 7 def initialize(tenant, data) @id = data[:id] @name = data[:name] @add_rows_API_enabled = data[:addRowsAPIEnabled] @configured_by = data[:configuredBy] @is_refreshable = data[:isRefreshable] @is_effective_identity_required = data[:isEffectiveIdentityRequired] @is_effective_identity_roles_required = data[:isEffectiveIdentityRolesRequired] @is_on_prem_gateway_required = data[:isOnPremGatewayRequired] @target_storage_mode = data[:targetStorageMode] @workspace = data[:workspace] @tenant = tenant @datasources = DatasourceArray.new(@tenant, self) @parameters = ParameterArray.new(@tenant, self) @refresh_history = RefreshArray.new(@tenant, self) end |
Instance Attribute Details
#add_rows_API_enabled ⇒ Object (readonly)
Returns the value of attribute add_rows_API_enabled.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def add_rows_API_enabled @add_rows_API_enabled end |
#configured_by ⇒ Object (readonly)
Returns the value of attribute configured_by.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def configured_by @configured_by end |
#datasources ⇒ Object (readonly)
Returns the value of attribute datasources.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def datasources @datasources end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def id @id end |
#is_effective_identity_required ⇒ Object (readonly)
Returns the value of attribute is_effective_identity_required.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def is_effective_identity_required @is_effective_identity_required end |
#is_effective_identity_roles_required ⇒ Object (readonly)
Returns the value of attribute is_effective_identity_roles_required.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def is_effective_identity_roles_required @is_effective_identity_roles_required end |
#is_on_prem_gateway_required ⇒ Object (readonly)
Returns the value of attribute is_on_prem_gateway_required.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def is_on_prem_gateway_required @is_on_prem_gateway_required end |
#is_refreshable ⇒ Object (readonly)
Returns the value of attribute is_refreshable.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def is_refreshable @is_refreshable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def parameters @parameters end |
#refresh_history ⇒ Object (readonly)
Returns the value of attribute refresh_history.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def refresh_history @refresh_history end |
#target_storage_mode ⇒ Object (readonly)
Returns the value of attribute target_storage_mode.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def target_storage_mode @target_storage_mode end |
#workspace ⇒ Object (readonly)
Returns the value of attribute workspace.
3 4 5 |
# File 'lib/power-bi/dataset.rb', line 3 def workspace @workspace end |
Instance Method Details
#bind_to_gateway(gateway, gateway_datasource) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/power-bi/dataset.rb', line 53 def bind_to_gateway(gateway, gateway_datasource) @tenant.post("/groups/#{workspace.id}/datasets/#{id}/Default.BindToGateway") do |req| req.body = { gatewayObjectId: gateway.id, datasourceObjectIds: [gateway_datasource.id] }.to_json end true end |
#delete ⇒ Object
48 49 50 51 |
# File 'lib/power-bi/dataset.rb', line 48 def delete @tenant.delete("/groups/#{workspace.id}/datasets/#{id}") true end |
#last_refresh ⇒ Object
34 35 36 |
# File 'lib/power-bi/dataset.rb', line 34 def last_refresh @refresh_history.first end |
#refresh ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/power-bi/dataset.rb', line 38 def refresh @tenant.post("/groups/#{workspace.id}/datasets/#{id}/refreshes") do |req| req.body = { notifyOption: "NoNotification" }.to_json end @refresh_history.reload true end |
#update_parameter(name, value) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/power-bi/dataset.rb', line 24 def update_parameter(name, value) @tenant.post("/groups/#{workspace.id}/datasets/#{id}/Default.UpdateParameters") do |req| req.body = { updateDetails: [{name: name, newValue: value.to_s}] }.to_json end @parameters.reload true end |