Class: PowerBI::GatewayDatasource
- Inherits:
-
Object
- Object
- PowerBI::GatewayDatasource
- Defined in:
- lib/power-bi/gateway_datasource.rb
Instance Attribute Summary collapse
-
#connection_details ⇒ Object
readonly
Returns the value of attribute connection_details.
-
#credential_type ⇒ Object
readonly
Returns the value of attribute credential_type.
-
#datasource_name ⇒ Object
readonly
Returns the value of attribute datasource_name.
-
#datasource_type ⇒ Object
readonly
Returns the value of attribute datasource_type.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#gateway_id ⇒ Object
readonly
Returns the value of attribute gateway_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(tenant, data) ⇒ GatewayDatasource
constructor
A new instance of GatewayDatasource.
- #update_credentials(encrypted_credentials) ⇒ Object
Constructor Details
#initialize(tenant, data) ⇒ GatewayDatasource
Returns a new instance of GatewayDatasource.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/power-bi/gateway_datasource.rb', line 5 def initialize(tenant, data) @gateway_id = data[:gatewayId] @datasource_type = data[:datasourceType] @datasource_name = data[:datasourceName] @connection_details = data[:connectionDetails] @id = data[:id] @credential_type = data[:credentialType] @gateway = data[:gateway] @tenant = tenant end |
Instance Attribute Details
#connection_details ⇒ Object (readonly)
Returns the value of attribute connection_details.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def connection_details @connection_details end |
#credential_type ⇒ Object (readonly)
Returns the value of attribute credential_type.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def credential_type @credential_type end |
#datasource_name ⇒ Object (readonly)
Returns the value of attribute datasource_name.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def datasource_name @datasource_name end |
#datasource_type ⇒ Object (readonly)
Returns the value of attribute datasource_type.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def datasource_type @datasource_type end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def gateway @gateway end |
#gateway_id ⇒ Object (readonly)
Returns the value of attribute gateway_id.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def gateway_id @gateway_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/power-bi/gateway_datasource.rb', line 3 def id @id end |
Instance Method Details
#delete ⇒ Object
33 34 35 36 37 |
# File 'lib/power-bi/gateway_datasource.rb', line 33 def delete @tenant.delete("/gateways/#{gateway.id}/datasources/#{id}") @tenant.workspaces.reload true end |
#update_credentials(encrypted_credentials) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/power-bi/gateway_datasource.rb', line 16 def update_credentials(encrypted_credentials) response = @tenant.patch("/gateways/#{gateway.id}/datasources/#{id}") do |req| req.body = { credentialDetails: { credentialType: "Basic", credentials: encrypted_credentials, encryptedConnection: "Encrypted", encryptionAlgorithm: "RSA-OAEP", privacyLevel: "Organizational", useCallerAADIdentity: false, useEndUserOAuth2Credentials: false, }, }.to_json end true end |