Class: Updox::Models::Auth
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- Updox::Models::Auth
- 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 =
'/pingWithApplicationAuth'
- PING_ACCT_ENDPOINT =
'/pingWithAccountAuth'
- PING_FULL_ENDPOINT =
'/pingWithAuth'
Instance Method Summary collapse
- #ping ⇒ Object
- #ping_with_account_auth ⇒ Object
- #ping_with_application_auth ⇒ Object
- #ping_with_full_auth ⇒ Object
- #to_h ⇒ Object
Instance Method Details
#ping ⇒ Object
23 24 25 |
# File 'lib/updox/models/auth.rb', line 23 def ping UpdoxClient.connection.request(endpoint: PING_ENDPOINT, auth: self) end |
#ping_with_account_auth ⇒ Object
31 32 33 |
# File 'lib/updox/models/auth.rb', line 31 def ping_with_account_auth UpdoxClient.connection.request(endpoint: PING_ACCT_ENDPOINT, auth: self, required_auths: AUTH_ACCT) end |
#ping_with_application_auth ⇒ Object
27 28 29 |
# File 'lib/updox/models/auth.rb', line 27 def ping_with_application_auth UpdoxClient.connection.request(endpoint: PING_APP_ENDPOINT, auth: self, required_auths: AUTH_APP) end |
#ping_with_full_auth ⇒ Object
35 36 37 |
# File 'lib/updox/models/auth.rb', line 35 def ping_with_full_auth UpdoxClient.connection.request(endpoint: PING_FULL_ENDPOINT, auth: self, required_auths: AUTH_FULL) end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/updox/models/auth.rb', line 19 def to_h { auth: super.to_h } end |