Class: Twilio::REST::Trunking::V1::TrunkContext::OriginationUrlInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Trunking::V1::TrunkContext::OriginationUrlInstance
- Defined in:
- lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account that owns this Origination URL.
-
#context ⇒ OriginationUrlContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Activity was created.
-
#date_updated ⇒ Time
The date this Activity was updated.
-
#delete ⇒ Boolean
Deletes the OriginationUrlInstance.
-
#enabled ⇒ Boolean
A boolean value indicating whether the URL is enabled or disabled.
-
#fetch ⇒ OriginationUrlInstance
Fetch a OriginationUrlInstance.
-
#friendly_name ⇒ String
A human readable descriptive text, up to 64 characters long.
-
#initialize(version, payload, trunk_sid: nil, sid: nil) ⇒ OriginationUrlInstance
constructor
Initialize the OriginationUrlInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#priority ⇒ String
Priority ranks the importance of the URI.
-
#sid ⇒ String
A 34 character string that uniquely identifies the Origination URL in this Twilio Trunk.
-
#sip_url ⇒ String
The SIP address you want Twilio to route your Origination calls to.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trunk_sid ⇒ String
The unique ID of the Trunk that owns this Origination URL.
-
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance.
-
#url ⇒ String
The URL for this resource, relative to trunking.
-
#weight ⇒ String
Weight is used to determine the share of load when more than one URI has the same priority.
Constructor Details
#initialize(version, payload, trunk_sid: nil, sid: nil) ⇒ OriginationUrlInstance
Initialize the OriginationUrlInstance
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 276 def initialize(version, payload, trunk_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'trunk_sid' => payload['trunk_sid'], 'weight' => payload['weight'].to_i, 'enabled' => payload['enabled'], 'sip_url' => payload['sip_url'], 'friendly_name' => payload['friendly_name'], 'priority' => payload['priority'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'trunk_sid' => trunk_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account that owns this Origination URL.
312 313 314 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 312 def account_sid @properties['account_sid'] end |
#context ⇒ OriginationUrlContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
303 304 305 306 307 308 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 303 def context unless @instance_context @instance_context = OriginationUrlContext.new(@version, @params['trunk_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Activity was created.
360 361 362 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 360 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Activity was updated.
366 367 368 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 366 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the OriginationUrlInstance
386 387 388 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 386 def delete context.delete end |
#enabled ⇒ Boolean
Returns A boolean value indicating whether the URL is enabled or disabled.
336 337 338 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 336 def enabled @properties['enabled'] end |
#fetch ⇒ OriginationUrlInstance
Fetch a OriginationUrlInstance
379 380 381 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 379 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable descriptive text, up to 64 characters long.
348 349 350 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 348 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
424 425 426 427 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 424 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" end |
#priority ⇒ String
Returns Priority ranks the importance of the URI.
354 355 356 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 354 def priority @properties['priority'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies the Origination URL in this Twilio Trunk.
318 319 320 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 318 def sid @properties['sid'] end |
#sip_url ⇒ String
Returns The SIP address you want Twilio to route your Origination calls to.
342 343 344 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 342 def sip_url @properties['sip_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
417 418 419 420 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 417 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" end |
#trunk_sid ⇒ String
Returns The unique ID of the Trunk that owns this Origination URL.
324 325 326 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 324 def trunk_sid @properties['trunk_sid'] end |
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance
405 406 407 408 409 410 411 412 413 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 405 def update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) context.update( weight: weight, priority: priority, enabled: enabled, friendly_name: friendly_name, sip_url: sip_url, ) end |
#url ⇒ String
Returns The URL for this resource, relative to trunking.
372 373 374 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 372 def url @properties['url'] end |
#weight ⇒ String
Returns Weight is used to determine the share of load when more than one URI has the same priority.
330 331 332 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 330 def weight @properties['weight'] end |