Class: Twilio::REST::Preview::TrustedComms::DeviceList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Preview::TrustedComms::DeviceList
- Defined in:
- lib/twilio-ruby/rest/preview/trusted_comms/device.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#create(phone_number: nil, push_token: nil) ⇒ DeviceInstance
Retrieve a single page of DeviceInstance records from the API.
-
#initialize(version) ⇒ DeviceList
constructor
Initialize the DeviceList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version) ⇒ DeviceList
Initialize the DeviceList
20 21 22 23 24 25 26 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/device.rb', line 20 def initialize(version) super(version) # Path Solution @solution = {} @uri = "/Devices" end |
Instance Method Details
#create(phone_number: nil, push_token: nil) ⇒ DeviceInstance
Retrieve a single page of DeviceInstance records from the API. Request is executed immediately.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/device.rb', line 37 def create(phone_number: nil, push_token: nil) data = Twilio::Values.of({'PhoneNumber' => phone_number, 'PushToken' => push_token, }) payload = @version.create( 'POST', @uri, data: data ) DeviceInstance.new(@version, payload, ) end |
#to_s ⇒ Object
Provide a user friendly representation
51 52 53 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/device.rb', line 51 def to_s '#<Twilio.Preview.TrustedComms.DeviceList>' end |