Class: Twilio::REST::Accounts::V1::SafelistList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Accounts::V1::SafelistList
- Defined in:
- lib/twilio-ruby/rest/accounts/v1/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
26 27 28 29 30 31 32 |
# File 'lib/twilio-ruby/rest/accounts/v1/safelist.rb', line 26 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/SafeList/Numbers" end |
Instance Method Details
#create(phone_number: nil) ⇒ SafelistInstance
Create the SafelistInstance
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/twilio-ruby/rest/accounts/v1/safelist.rb', line 37 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
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/twilio-ruby/rest/accounts/v1/safelist.rb', line 57 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
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/twilio-ruby/rest/accounts/v1/safelist.rb', line 72 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
91 92 93 |
# File 'lib/twilio-ruby/rest/accounts/v1/safelist.rb', line 91 def to_s '#<Twilio.Accounts.V1.SafelistList>' end |