Class: Twilio::REST::Numbers::V1::PortingPortabilityContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V1::PortingPortabilityContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v1/porting_portability.rb
Instance Method Summary collapse
-
#fetch(target_account_sid: :unset, address_sid: :unset) ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance.
-
#initialize(version, phone_number) ⇒ PortingPortabilityContext
constructor
Initialize the PortingPortabilityContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, phone_number) ⇒ PortingPortabilityContext
Initialize the PortingPortabilityContext
49 50 51 52 53 54 55 56 57 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 49 def initialize(version, phone_number) super(version) # Path Solution @solution = { phone_number: phone_number, } @uri = "/Porting/Portability/PhoneNumber/#{CGI.escape(@solution[:phone_number]).gsub("+", "%20")}" end |
Instance Method Details
#fetch(target_account_sid: :unset, address_sid: :unset) ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 63 def fetch( target_account_sid: :unset, address_sid: :unset ) params = Twilio::Values.of({ 'TargetAccountSid' => target_account_sid, 'AddressSid' => address_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) PortingPortabilityInstance.new( @version, payload, phone_number: @solution[:phone_number], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
96 97 98 99 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 96 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V1.PortingPortabilityContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
89 90 91 92 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 89 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V1.PortingPortabilityContext #{context}>" end |