Class: PhraseApp::RequestParams::AuthorizationParams

Inherits:
OpenStruct
  • Object
show all
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

Instance Method Details

#expires_at=(val) ⇒ Object



375
376
377
# File 'lib/phraseapp-ruby.rb', line 375

def expires_at=(val)
  super(DateTime.parse(val))
end

#note=(val) ⇒ Object



379
380
381
# File 'lib/phraseapp-ruby.rb', line 379

def note=(val)
  super(val)
end

#scopes=(val) ⇒ Object



383
384
385
# File 'lib/phraseapp-ruby.rb', line 383

def scopes=(val)
  super(val.split(','))
end

#validateObject



387
388
389
390
391
392
# File 'lib/phraseapp-ruby.rb', line 387

def validate
  
  if note == nil || note == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"note\" of \"AuthorizationParams\" not set")
  end
end