Class: PowerBiEmbedded::Authenticate

Inherits:
Base
  • Object
show all
Defined in:
lib/power_bi_embedded/authenticate.rb

Constant Summary collapse

BASE_URL =
"https://login.windows.net/common/oauth2/token"
RESOURCE =
"https://analysis.windows.net/powerbi/api"

Instance Method Summary collapse

Methods inherited from Base

delete, get, parse_response, post, put

Constructor Details

#initialize(username: nil, password: nil, refresh_token: nil, client_id: nil, grant_type: nil) ⇒ Authenticate

Returns a new instance of Authenticate.



7
8
9
10
11
12
13
# File 'lib/power_bi_embedded/authenticate.rb', line 7

def initialize(username: nil, password: nil, refresh_token: nil, client_id: nil, grant_type: nil)
  @username      = username
  @password      = password
  @refresh_token = refresh_token
  @client_id     = client_id
  @grant_type    = grant_type
end

Instance Method Details

#callObject



15
16
17
# File 'lib/power_bi_embedded/authenticate.rb', line 15

def call
  PowerBiEmbedded::Base.post(BASE_URL, build_body, build_headers)
end