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 SID of the [Account](www.twilio.com/docs/iam/api/account) that created the OriginationUrl resource.
-
#context ⇒ OriginationUrlContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the OriginationUrlInstance.
-
#enabled ⇒ Boolean
Whether the URL is enabled.
-
#fetch ⇒ OriginationUrlInstance
Fetch the OriginationUrlInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, trunk_sid: nil, sid: nil) ⇒ OriginationUrlInstance
constructor
Initialize the OriginationUrlInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#priority ⇒ String
The relative importance of the URI.
-
#sid ⇒ String
The unique string that we created to identify the OriginationUrl resource.
-
#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 SID of the Trunk that owns the Origination URL.
-
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#weight ⇒ String
The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority.
Constructor Details
#initialize(version, payload, trunk_sid: nil, sid: nil) ⇒ OriginationUrlInstance
Initialize the OriginationUrlInstance
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 586 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'] == nil ? payload['weight'] : payload['weight'].to_i, 'enabled' => payload['enabled'], 'sip_url' => payload['sip_url'], 'friendly_name' => payload['friendly_name'], 'priority' => payload['priority'] == nil ? payload['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 || @properties['trunk_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the OriginationUrl resource.
623 624 625 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 623 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
614 615 616 617 618 619 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 614 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 and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
671 672 673 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 671 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
677 678 679 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 677 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the OriginationUrlInstance
690 691 692 693 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 690 def delete context.delete end |
#enabled ⇒ Boolean
Returns Whether the URL is enabled. The default is ‘true`.
647 648 649 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 647 def enabled @properties['enabled'] end |
#fetch ⇒ OriginationUrlInstance
Fetch the OriginationUrlInstance
698 699 700 701 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 698 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
659 660 661 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 659 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
737 738 739 740 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 737 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" end |
#priority ⇒ String
Returns 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.
665 666 667 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 665 def priority @properties['priority'] end |
#sid ⇒ String
Returns The unique string that we created to identify the OriginationUrl resource.
629 630 631 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 629 def sid @properties['sid'] end |
#sip_url ⇒ String
Returns The SIP address you want Twilio to route your Origination calls to. This must be a ‘sip:` schema.
653 654 655 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 653 def sip_url @properties['sip_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
730 731 732 733 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 730 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.OriginationUrlInstance #{values}>" end |
#trunk_sid ⇒ String
Returns The SID of the Trunk that owns the Origination URL.
635 636 637 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 635 def trunk_sid @properties['trunk_sid'] end |
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 711 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 absolute URL of the resource.
683 684 685 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 683 def url @properties['url'] end |
#weight ⇒ String
Returns 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.
641 642 643 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 641 def weight @properties['weight'] end |