Class: Twilio::REST::Oauth::V1::DeviceCodeInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/oauth/v1/device_code.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ DeviceCodeInstance

Initialize the DeviceCodeInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio



88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 88

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'device_code' => payload['device_code'],
      'user_code' => payload['user_code'],
      'verification_uri' => payload['verification_uri'],
      'verification_uri_complete' => payload['verification_uri_complete'],
      'expires_in' => payload['expires_in'] == nil ? payload['expires_in'] : payload['expires_in'].to_i,
      'interval' => payload['interval'] == nil ? payload['interval'] : payload['interval'].to_i,
  }
end

Instance Method Details

#device_codeString

Returns The device verification code.

Returns:

  • (String)

    The device verification code



104
105
106
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 104

def device_code
  @properties['device_code']
end

#expires_inString

Returns The expiration time of the device_code and user_code in seconds.

Returns:

  • (String)

    The expiration time of the device_code and user_code in seconds



128
129
130
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 128

def expires_in
  @properties['expires_in']
end

#inspectObject

Provide a detailed, user friendly representation



146
147
148
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 146

def inspect
  "<Twilio.Oauth.V1.DeviceCodeInstance>"
end

#intervalString

Returns The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint.

Returns:

  • (String)

    The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint



134
135
136
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 134

def interval
  @properties['interval']
end

#to_sObject

Provide a user friendly representation



140
141
142
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 140

def to_s
  "<Twilio.Oauth.V1.DeviceCodeInstance>"
end

#user_codeString

Returns The verification code for the end user.

Returns:

  • (String)

    The verification code for the end user



110
111
112
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 110

def user_code
  @properties['user_code']
end

#verification_uriString

Returns The URI that the end user visits to verify request.

Returns:

  • (String)

    The URI that the end user visits to verify request



116
117
118
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 116

def verification_uri
  @properties['verification_uri']
end

#verification_uri_completeString

Returns he URI with user_code that the end-user alternatively visits to verify request.

Returns:

  • (String)

    he URI with user_code that the end-user alternatively visits to verify request



122
123
124
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 122

def verification_uri_complete
  @properties['verification_uri_complete']
end