Class: PowerBI::GatewayDatasourceUserArray
- Inherits:
-
Array
- Object
- Array
- PowerBI::GatewayDatasourceUserArray
show all
- Defined in:
- lib/power-bi/gateway_datasource_user.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Array
#reload
Constructor Details
Returns a new instance of GatewayDatasourceUserArray.
25
26
27
28
|
# File 'lib/power-bi/gateway_datasource_user.rb', line 25
def initialize(tenant, gateway_datasource)
super(tenant, gateway_datasource)
@gateway_datasource = gateway_datasource
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class PowerBI::Array
Instance Method Details
#add_service_principal_profile_user(profile_id, principal_object_id, datasource_access_right: "Read") ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/power-bi/gateway_datasource_user.rb', line 35
def add_service_principal_profile_user(profile_id, principal_object_id, datasource_access_right: "Read")
@tenant.post("/gateways/#{@gateway_datasource.gateway.id}/datasources/#{@gateway_datasource.id}/users", use_profile: false) do |req|
req.body = {
datasourceAccessRight: datasource_access_right,
identifier: principal_object_id,
principalType: "App",
profile: {id: profile_id},
}.to_json
end
self.reload
end
|
47
48
49
|
# File 'lib/power-bi/gateway_datasource_user.rb', line 47
def get_data
@tenant.get("/gateways/#{@gateway_datasource.gateway.id}/datasources/#{@gateway_datasource.id}/users", use_profile: false)[:value]
end
|