Class: PowerBI::GatewayDatasourceUser
- Defined in:
- lib/power-bi/gateway_datasource_user.rb
Instance Attribute Summary collapse
-
#gateway_datasource ⇒ Object
readonly
Returns the value of attribute gateway_datasource.
Attributes inherited from Object
Instance Method Summary collapse
- #data_to_attributes(data) ⇒ Object
-
#delete ⇒ Object
currently only implemented for users or service principals (not yet service principal profiles).
-
#initialize(tenant, parent, id = nil) ⇒ GatewayDatasourceUser
constructor
A new instance of GatewayDatasourceUser.
Methods inherited from Object
instantiate_from_data, #reload, #set_attributes
Constructor Details
#initialize(tenant, parent, id = nil) ⇒ GatewayDatasourceUser
Returns a new instance of GatewayDatasourceUser.
5 6 7 8 |
# File 'lib/power-bi/gateway_datasource_user.rb', line 5 def initialize(tenant, parent, id = nil) super(tenant, id) @gateway_datasource = parent end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PowerBI::Object
Instance Attribute Details
#gateway_datasource ⇒ Object (readonly)
Returns the value of attribute gateway_datasource.
3 4 5 |
# File 'lib/power-bi/gateway_datasource_user.rb', line 3 def gateway_datasource @gateway_datasource end |
Instance Method Details
#data_to_attributes(data) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/power-bi/gateway_datasource_user.rb', line 10 def data_to_attributes(data) { datasource_access_right: data[:datasourceAccessRight], display_name: data[:displayName], email_address: data[:emailAddress], identifier: data[:identifier], principal_type: data[:principalType], profile: data[:profile], } end |
#delete ⇒ Object
currently only implemented for users or service principals (not yet service principal profiles)
22 23 24 25 26 27 |
# File 'lib/power-bi/gateway_datasource_user.rb', line 22 def delete email_address_or_object_id = email_address || identifier @tenant.delete("/gateways/#{@gateway_datasource.gateway.id}/datasources/#{@gateway_datasource.id}/users/#{email_address_or_object_id}", use_profile: false) @gateway_datasource.gateway_datasource_users.reload true end |