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



18
19
20
21
22
23
24
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 18

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:



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 34

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



48
49
50
# File 'lib/twilio-ruby/rest/oauth/v1/device_code.rb', line 48

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