Class: Twilio::REST::Api::V2010::SafelistList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/safelist.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ SafelistList

Initialize the SafelistList

Parameters:

  • version (Version)

    Version that contains the resource



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

Parameters:

Returns:



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

Parameters:

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

Parameters:

Returns:



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_sObject

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