Class: Twilio::REST::Routes::V2::PhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Routes::V2::PhoneNumberInstance
- Defined in:
- lib/twilio-ruby/rest/routes/v2/phone_number.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid.
-
#context ⇒ PhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this phone number was assigned an Inbound Processing Region.
-
#date_updated ⇒ Time
The date that the Inbound Processing Region was updated for this phone number.
-
#fetch ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance.
-
#friendly_name ⇒ String
A human readable description of the Inbound Processing Region assignments for this phone number.
-
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
constructor
Initialize the PhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_number ⇒ String
The phone number.
-
#sid ⇒ String
A string that uniquely identifies the Inbound Processing Region assignments for this phone number.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(voice_region: :unset, friendly_name: :unset) ⇒ PhoneNumberInstance
Update the PhoneNumberInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#voice_region ⇒ String
The Inbound Processing Region used for this phone number for voice.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance
Initialize the PhoneNumberInstance
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 121 def initialize(version, payload, phone_number: nil) super(version) # Marshaled Properties @properties = { 'phone_number' => payload['phone_number'], 'url' => payload['url'], 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'voice_region' => payload['voice_region'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = {'phone_number' => phone_number || @properties['phone_number'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
172 173 174 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 172 def account_sid @properties['account_sid'] 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
145 146 147 148 149 150 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 145 def context unless @instance_context @instance_context = PhoneNumberContext.new(@version, @params['phone_number'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this phone number was assigned an Inbound Processing Region.
190 191 192 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 190 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that the Inbound Processing Region was updated for this phone number.
196 197 198 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 196 def date_updated @properties['date_updated'] end |
#fetch ⇒ PhoneNumberInstance
Fetch the PhoneNumberInstance
214 215 216 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 214 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of the Inbound Processing Region assignments for this phone number.
178 179 180 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 178 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
227 228 229 230 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 227 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V2.PhoneNumberInstance #{values}>" end |
#phone_number ⇒ String
Returns The phone number.
154 155 156 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 154 def phone_number @properties['phone_number'] end |
#sid ⇒ String
Returns A string that uniquely identifies the Inbound Processing Region assignments for this phone number.
166 167 168 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 166 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
220 221 222 223 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 220 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V2.PhoneNumberInstance #{values}>" end |
#update(voice_region: :unset, friendly_name: :unset) ⇒ PhoneNumberInstance
Update the PhoneNumberInstance
207 208 209 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 207 def update(voice_region: :unset, friendly_name: :unset) context.update(voice_region: voice_region, friendly_name: friendly_name, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
160 161 162 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 160 def url @properties['url'] end |
#voice_region ⇒ String
Returns The Inbound Processing Region used for this phone number for voice.
184 185 186 |
# File 'lib/twilio-ruby/rest/routes/v2/phone_number.rb', line 184 def voice_region @properties['voice_region'] end |