Class: Twilio::REST::Oauth::V1::DeviceCodeList

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

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ DeviceCodeList

Initialize the DeviceCodeList

Parameters:

  • version (Version)

    Version that contains the resource



25
26
27
28
29
30
31
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 25

def initialize(version)
    super(version)
    # Path Solution
    @solution = {  }
    @uri = "/device/code"
    
end

Instance Method Details

#create(client_sid: nil, scopes: nil, audiences: :unset) ⇒ DeviceCodeInstance

Create the DeviceCodeInstance

Parameters:

  • client_sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this OAuth App.

  • scopes (Array[String]) (defaults to: nil)

    An Array of scopes for authorization request

  • audiences (Array[String]) (defaults to: :unset)

    An array of intended audiences for token requests

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 38

def create(
    client_sid: nil, 
    scopes: nil, 
    audiences: :unset
)

    data = Twilio::Values.of({
        'ClientSid' => client_sid,
        'Scopes' => Twilio.serialize_list(scopes) { |e| e },
        'Audiences' => Twilio.serialize_list(audiences) { |e| e },
    })

    payload = @version.create('POST', @uri, data: data)
    DeviceCodeInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



61
62
63
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 61

def to_s
    '#<Twilio.Oauth.V1.DeviceCodeList>'
end