Class: Twilio::REST::Proxy::V1::ServiceContext::ShortCodeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Proxy::V1::ServiceContext::ShortCodeInstance
- Defined in:
- lib/twilio-ruby/rest/proxy/v1/service/short_code.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
Account Sid.
-
#capabilities ⇒ String
A list of capabilities.
-
#context ⇒ ShortCodeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Short Code was added to the service.
-
#date_updated ⇒ Time
The date this Short Code was updated.
-
#delete ⇒ Boolean
Deletes the ShortCodeInstance.
-
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ ShortCodeInstance
constructor
Initialize the ShortCodeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#is_reserved ⇒ Boolean
Reserve for manual assignment to participants only.
-
#iso_country ⇒ String
ISO Country Code,.
-
#service_sid ⇒ String
Service Sid.
-
#short_code ⇒ String
Shortcode.
-
#sid ⇒ String
A string that uniquely identifies this Short Code.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(is_reserved: :unset) ⇒ ShortCodeInstance
Update the ShortCodeInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ ShortCodeInstance
Initialize the ShortCodeInstance
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 244 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']), 'short_code' => payload['short_code'], 'iso_country' => payload['iso_country'], 'capabilities' => payload['capabilities'], 'url' => payload['url'], 'is_reserved' => payload['is_reserved'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
285 286 287 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 285 def account_sid @properties['account_sid'] end |
#capabilities ⇒ String
Returns A list of capabilities.
321 322 323 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 321 def capabilities @properties['capabilities'] end |
#context ⇒ ShortCodeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
270 271 272 273 274 275 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 270 def context unless @instance_context @instance_context = ShortCodeContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Short Code was added to the service.
297 298 299 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 297 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Short Code was updated.
303 304 305 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 303 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ShortCodeInstance
340 341 342 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 340 def delete context.delete end |
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance
347 348 349 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 347 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
369 370 371 372 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 369 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ShortCodeInstance #{values}>" end |
#is_reserved ⇒ Boolean
Returns Reserve for manual assignment to participants only.
333 334 335 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 333 def is_reserved @properties['is_reserved'] end |
#iso_country ⇒ String
Returns ISO Country Code,.
315 316 317 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 315 def iso_country @properties['iso_country'] end |
#service_sid ⇒ String
Returns Service Sid.
291 292 293 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 291 def service_sid @properties['service_sid'] end |
#short_code ⇒ String
Returns Shortcode.
309 310 311 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 309 def short_code @properties['short_code'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Short Code.
279 280 281 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 279 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
362 363 364 365 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 362 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ShortCodeInstance #{values}>" end |
#update(is_reserved: :unset) ⇒ ShortCodeInstance
Update the ShortCodeInstance
356 357 358 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 356 def update(is_reserved: :unset) context.update(is_reserved: is_reserved, ) end |
#url ⇒ String
Returns The URL of this resource.
327 328 329 |
# File 'lib/twilio-ruby/rest/proxy/v1/service/short_code.rb', line 327 def url @properties['url'] end |