Class: Twilio::REST::Api::V2010::SafelistList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Api::V2010::SafelistList
- Defined in:
- lib/twilio-ruby/rest/api/v2010/safelist.rb
Instance Method Summary collapse
-
#create(phone_number: nil) ⇒ SafelistInstance
Create the SafelistInstance.
-
#delete(phone_number: :unset) ⇒ Boolean
Delete the SafelistInstance.
-
#fetch(phone_number: :unset) ⇒ SafelistInstance
Fetch the SafelistInstance.
-
#initialize(version) ⇒ SafelistList
constructor
Initialize the SafelistList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version) ⇒ SafelistList
Initialize the SafelistList
25 26 27 28 29 30 31 |
# File 'lib/twilio-ruby/rest/api/v2010/safelist.rb', line 25 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/SafeList/Numbers.json" end |
Instance Method Details
#create(phone_number: nil) ⇒ SafelistInstance
Create the SafelistInstance
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/twilio-ruby/rest/api/v2010/safelist.rb', line 36 def create( phone_number: nil ) data = Twilio::Values.of({ 'PhoneNumber' => phone_number, }) payload = @version.create('POST', @uri, data: data) SafelistInstance.new( @version, payload, ) end |
#delete(phone_number: :unset) ⇒ Boolean
Delete the SafelistInstance
55 56 57 58 59 60 61 62 63 |
# File 'lib/twilio-ruby/rest/api/v2010/safelist.rb', line 55 def delete( phone_number: :unset ) params = Twilio::Values.of({ 'PhoneNumber' => phone_number, }) @version.delete('DELETE', @uri, params: params) end |
#fetch(phone_number: :unset) ⇒ SafelistInstance
Fetch the SafelistInstance
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/twilio-ruby/rest/api/v2010/safelist.rb', line 69 def fetch( phone_number: :unset ) params = Twilio::Values.of({ 'PhoneNumber' => phone_number, }) payload = @version.fetch('GET', @uri, params: params) SafelistInstance.new( @version, payload, ) end |
#to_s ⇒ Object
Provide a user friendly representation
87 88 89 |
# File 'lib/twilio-ruby/rest/api/v2010/safelist.rb', line 87 def to_s '#<Twilio.Api.V2010.SafelistList>' end |