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

  • account_sid (String)

    The SID of the Account that created this DeviceCode resource.

  • sid (String)

    The SID of the Call resource to fetch.



104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 104

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'],
        '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.



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

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.



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

def expires_in
    @properties['expires_in']
end

#inspectObject

Provide a detailed, user friendly representation



163
164
165
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 163

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.



151
152
153
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 151

def interval
    @properties['interval']
end

#to_sObject

Provide a user friendly representation



157
158
159
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 157

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

#user_codeString

Returns The verification code which end user uses to verify authorization request.

Returns:

  • (String)

    The verification code which end user uses to verify authorization request.



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

def user_code
    @properties['user_code']
end

#verification_uriString

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

Returns:

  • (String)

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



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

def verification_uri
    @properties['verification_uri']
end

#verification_uri_completeString

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

Returns:

  • (String)

    The URI with user_code that the end-user alternatively visits to verify authorization request.



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

def verification_uri_complete
    @properties['verification_uri_complete']
end