Class: WorkOS::DeviceAuthorizationResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/user_management/device_authorization_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  device_code: :device_code,
  user_code: :user_code,
  verification_uri: :verification_uri,
  verification_uri_complete: :verification_uri_complete,
  expires_in: :expires_in,
  interval: :interval
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ DeviceAuthorizationResponse

Returns a new instance of DeviceAuthorizationResponse.



24
25
26
27
28
29
30
31
32
# File 'lib/workos/user_management/device_authorization_response.rb', line 24

def initialize(json)
  hash = self.class.normalize(json)
  @device_code = hash[:device_code]
  @user_code = hash[:user_code]
  @verification_uri = hash[:verification_uri]
  @verification_uri_complete = hash[:verification_uri_complete]
  @expires_in = hash[:expires_in]
  @interval = hash[:interval]
end

Instance Attribute Details

#device_codeObject

Returns the value of attribute device_code.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def device_code
  @device_code
end

#expires_inObject

Returns the value of attribute expires_in.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def expires_in
  @expires_in
end

#intervalObject

Returns the value of attribute interval.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def interval
  @interval
end

#user_codeObject

Returns the value of attribute user_code.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def user_code
  @user_code
end

#verification_uriObject

Returns the value of attribute verification_uri.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def verification_uri
  @verification_uri
end

#verification_uri_completeObject

Returns the value of attribute verification_uri_complete.



16
17
18
# File 'lib/workos/user_management/device_authorization_response.rb', line 16

def verification_uri_complete
  @verification_uri_complete
end