Class: Twilio::REST::Messaging::V1::ServiceContext::PhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::ServiceContext::PhoneNumberInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#capabilities ⇒ String
The capabilities.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country_code ⇒ String
The country_code.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the PhoneNumberInstance.
-
#fetch ⇒ PhoneNumberInstance
Fetch a PhoneNumberInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_number ⇒ String
The phone_number.
-
#service_sid ⇒ String
The service_sid.
-
#sid ⇒ String
The sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 222 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'phone_number' => payload['phone_number'], 'country_code' => payload['country_code'], 'capabilities' => payload['capabilities'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid']} end |
Instance Method Details
#account_sid ⇒ String
262 263 264 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 262 def account_sid @properties['account_sid'] end |
#capabilities ⇒ String
298 299 300 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 298 def capabilities @properties['capabilities'] end |
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 247 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version, @params['service_sid'], @params['sid']) end @instance_context end |
#country_code ⇒ String
292 293 294 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 292 def country_code @properties['country_code'] end |
#date_created ⇒ Time
274 275 276 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 274 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
280 281 282 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 280 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the PhoneNumberInstance
311 312 313 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 311 def delete context.delete end |
#fetch ⇒ PhoneNumberInstance
Fetch a PhoneNumberInstance
318 319 320 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 318 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
331 332 333 334 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 331 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.PhoneNumberInstance #{values}>" end |
#phone_number ⇒ String
286 287 288 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 286 def phone_number @properties['phone_number'] end |
#service_sid ⇒ String
268 269 270 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 268 def service_sid @properties['service_sid'] end |
#sid ⇒ String
256 257 258 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 256 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
324 325 326 327 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 324 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.PhoneNumberInstance #{values}>" end |
#url ⇒ String
304 305 306 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb', line 304 def url @properties['url'] end |