Class: Twilio::REST::Verify::V2::SafelistInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::SafelistInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/safelist.rb
Instance Method Summary collapse
-
#context ⇒ SafelistContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the SafelistInstance.
-
#fetch ⇒ SafelistInstance
Fetch the SafelistInstance.
-
#initialize(version, payload, phone_number: nil) ⇒ SafelistInstance
constructor
Initialize the SafelistInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_number ⇒ String
The phone number in SafeList.
-
#sid ⇒ String
The unique string that we created to identify the SafeList resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the SafeList resource.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ SafelistInstance
Initialize the SafelistInstance
158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 158 def initialize(version, payload , phone_number: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'phone_number' => payload['phone_number'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'phone_number' => phone_number || @properties['phone_number'] , } end |
Instance Method Details
#context ⇒ SafelistContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
177 178 179 180 181 182 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 177 def context unless @instance_context @instance_context = SafelistContext.new(@version , @params['phone_number']) end @instance_context end |
#delete ⇒ Boolean
Delete the SafelistInstance
205 206 207 208 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 205 def delete context.delete end |
#fetch ⇒ SafelistInstance
Fetch the SafelistInstance
213 214 215 216 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 213 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
227 228 229 230 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 227 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.SafelistInstance #{values}>" end |
#phone_number ⇒ String
192 193 194 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 192 def phone_number @properties['phone_number'] end |
#sid ⇒ String
186 187 188 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 186 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
220 221 222 223 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 220 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.SafelistInstance #{values}>" end |
#url ⇒ String
198 199 200 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 198 def url @properties['url'] end |