Class: PhraseApp::RequestParams::AuthorizationParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::AuthorizationParams
- Defined in:
- lib/phraseapp-ruby.rb
Overview
AuthorizationParams
Parameters:
- expires_at
-
Expiration date for the authorization token. Null means no expiration date (default).
- note
-
A note to help you remember what the access is used for.
- scopes
-
A list of scopes that the access can be used for.
Instance Method Summary collapse
- #expires_at=(val) ⇒ Object
- #note=(val) ⇒ Object
- #scopes=(val) ⇒ Object
- #to_h ⇒ Object
- #validate ⇒ Object
Instance Method Details
#expires_at=(val) ⇒ Object
307 308 309 |
# File 'lib/phraseapp-ruby.rb', line 307 def expires_at=(val) self.expires_at = Time.parse(val) end |
#note=(val) ⇒ Object
311 312 313 |
# File 'lib/phraseapp-ruby.rb', line 311 def note=(val) self.note = val end |
#scopes=(val) ⇒ Object
315 316 317 |
# File 'lib/phraseapp-ruby.rb', line 315 def scopes=(val) self.scopes = val.split(',') end |
#to_h ⇒ Object
325 326 327 |
# File 'lib/phraseapp-ruby.rb', line 325 def to_h @table.dup end |
#validate ⇒ Object
319 320 321 322 323 |
# File 'lib/phraseapp-ruby.rb', line 319 def validate if self.note == nil || self.note == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"note\" of \"AuthorizationParams\" not set") end end |