Class: Twilio::REST::Numbers::V1::PortingPortInPhoneNumberContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V1::PortingPortInPhoneNumberContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the PortingPortInPhoneNumberInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the PortingPortInPhoneNumberInstanceMetadata.
-
#fetch ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstance.
-
#fetch_with_metadata ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstanceMetadata.
-
#initialize(version, port_in_request_sid, phone_number_sid) ⇒ PortingPortInPhoneNumberContext
constructor
Initialize the PortingPortInPhoneNumberContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, port_in_request_sid, phone_number_sid) ⇒ PortingPortInPhoneNumberContext
Initialize the PortingPortInPhoneNumberContext
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 51 def initialize(version, port_in_request_sid, phone_number_sid) super(version) # Path Solution @solution = { port_in_request_sid: port_in_request_sid, phone_number_sid: phone_number_sid, } @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}/PhoneNumber/#{@solution[:phone_number_sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the PortingPortInPhoneNumberInstance
64 65 66 67 68 69 70 71 72 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 64 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the PortingPortInPhoneNumberInstanceMetadata
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 77 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) portingPortInPhoneNumber_instance = PortingPortInPhoneNumberInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) PortingPortInPhoneNumberInstanceMetadata.new(@version, portingPortInPhoneNumber_instance, response.headers, response.status_code) end |
#fetch ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstance
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 96 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) PortingPortInPhoneNumberInstance.new( @version, payload, port_in_request_sid: @solution[:port_in_request_sid], phone_number_sid: @solution[:phone_number_sid], ) end |
#fetch_with_metadata ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstanceMetadata
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 116 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) porting_port_in_phone_number_instance = PortingPortInPhoneNumberInstance.new( @version, response.body, port_in_request_sid: @solution[:port_in_request_sid], phone_number_sid: @solution[:phone_number_sid], ) PortingPortInPhoneNumberInstanceMetadata.new( @version, porting_port_in_phone_number_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
149 150 151 152 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 149 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
142 143 144 145 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 142 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>" end |