class Twilio::REST::Trunking::V1::TrunkContext::OriginationUrlInstance
Public Class Methods
Initialize the OriginationUrlInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] trunk_sid
The SID of the Trunk that owns the Origination URL. @param [String] sid The unique string that we created to identify the
OriginationUrl resource to fetch.
@return [OriginationUrlInstance] OriginationUrlInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 269 def initialize(version, payload, trunk_sid: nil, sid: nil) 270 super(version) 271 272 # Marshaled Properties 273 @properties = { 274 'account_sid' => payload['account_sid'], 275 'sid' => payload['sid'], 276 'trunk_sid' => payload['trunk_sid'], 277 'weight' => payload['weight'].to_i, 278 'enabled' => payload['enabled'], 279 'sip_url' => payload['sip_url'], 280 'friendly_name' => payload['friendly_name'], 281 'priority' => payload['priority'].to_i, 282 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 283 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 284 'url' => payload['url'], 285 } 286 287 # Context 288 @instance_context = nil 289 @params = {'trunk_sid' => trunk_sid, 'sid' => sid || @properties['sid'], } 290 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 305 def account_sid 306 @properties['account_sid'] 307 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [OriginationUrlContext] OriginationUrlContext
for this OriginationUrlInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 296 def context 297 unless @instance_context 298 @instance_context = OriginationUrlContext.new(@version, @params['trunk_sid'], @params['sid'], ) 299 end 300 @instance_context 301 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 353 def date_created 354 @properties['date_created'] 355 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 359 def date_updated 360 @properties['date_updated'] 361 end
Delete the OriginationUrlInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 379 def delete 380 context.delete 381 end
@return [Boolean] Whether the URL is enabled
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 329 def enabled 330 @properties['enabled'] 331 end
Fetch the OriginationUrlInstance
@return [OriginationUrlInstance] Fetched OriginationUrlInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 372 def fetch 373 context.fetch 374 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 341 def friendly_name 342 @properties['friendly_name'] 343 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 417 def inspect 418 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 419 "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" 420 end
@return [String] The relative importance of the URI
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 347 def priority 348 @properties['priority'] 349 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 311 def sid 312 @properties['sid'] 313 end
@return [String] The SIP address you want Twilio
to route your Origination calls to
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 335 def sip_url 336 @properties['sip_url'] 337 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 410 def to_s 411 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 412 "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" 413 end
@return [String] The SID of the Trunk that owns the Origination URL
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 317 def trunk_sid 318 @properties['trunk_sid'] 319 end
Update the OriginationUrlInstance
@param [String] weight The value that determines the relative share of the load
the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority.
@param [String] priority The relative importance of the URI. Can be an integer
from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI.
@param [Boolean] enabled Whether the URL is enabled. The default is `true`. @param [String] friendly_name
A descriptive string that you create to describe
the resource. It can be up to 64 characters long.
@param [String] sip_url
The SIP address you want Twilio
to route your
Origination calls to. This must be a `sip:` schema. `sips` is NOT supported.
@return [OriginationUrlInstance] Updated OriginationUrlInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 398 def update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) 399 context.update( 400 weight: weight, 401 priority: priority, 402 enabled: enabled, 403 friendly_name: friendly_name, 404 sip_url: sip_url, 405 ) 406 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 365 def url 366 @properties['url'] 367 end
@return [String] The value that determines the relative load the URI should receive compared to others with the same priority
# File lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb 323 def weight 324 @properties['weight'] 325 end