Class: Updox::Models::Auth

Inherits:
Hashie::Trash
  • Object
show all
Defined in:
lib/updox/models/auth.rb

Constant Summary collapse

AUTH_NONE =
[]
AUTH_APP =
[:applicationId, :applicationPassword]
AUTH_ACCT =
AUTH_APP + [:accountId]
AUTH_FULL =
AUTH_ACCT + [:userId]
PING_ENDPOINT =
'/Ping'
PING_APP_ENDPOINT =
PING_ENDPOINT + 'WithApplicationAuth'
PING_ACCT_ENDPOINT =
PING_ENDPOINT + 'WithAccountAuth'
PING_FULL_ENDPOINT =
PING_ENDPOINT + 'WithAuth'

Instance Method Summary collapse

Instance Method Details

#pingObject



28
29
30
# File 'lib/updox/models/auth.rb', line 28

def ping
  Model.request(endpoint: PING_ENDPOINT, auth: self)
end

#ping_with_account_authObject



36
37
38
# File 'lib/updox/models/auth.rb', line 36

def 
  Model.request(endpoint: PING_ACCT_ENDPOINT, auth: self, required_auths: AUTH_ACCT)
end

#ping_with_application_authObject



32
33
34
# File 'lib/updox/models/auth.rb', line 32

def ping_with_application_auth
  Model.request(endpoint: PING_APP_ENDPOINT, auth: self, required_auths: AUTH_APP)
end

#ping_with_full_authObject



40
41
42
# File 'lib/updox/models/auth.rb', line 40

def ping_with_full_auth
  Model.request(endpoint: PING_FULL_ENDPOINT, auth: self, required_auths: AUTH_FULL)
end

#to_hObject



24
25
26
# File 'lib/updox/models/auth.rb', line 24

def to_h
  { auth: super.to_h }
end