Class: Twilio::REST::Numbers::V2::HostedNumberOrderContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V2::HostedNumberOrderContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the HostedNumberOrderInstance.
-
#fetch ⇒ HostedNumberOrderInstance
Fetch the HostedNumberOrderInstance.
-
#initialize(version, sid) ⇒ HostedNumberOrderContext
constructor
Initialize the HostedNumberOrderContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil, verification_call_delay: :unset, verification_call_extension: :unset) ⇒ HostedNumberOrderInstance
Update the HostedNumberOrderInstance.
Constructor Details
#initialize(version, sid) ⇒ HostedNumberOrderContext
Initialize the HostedNumberOrderContext
236 237 238 239 240 241 242 243 244 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 236 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/HostedNumber/Orders/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the HostedNumberOrderInstance
248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 248 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ HostedNumberOrderInstance
Fetch the HostedNumberOrderInstance
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 260 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) HostedNumberOrderInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
318 319 320 321 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 318 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.HostedNumberOrderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
311 312 313 314 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 311 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.HostedNumberOrderContext #{context}>" end |
#update(status: nil, verification_call_delay: :unset, verification_call_extension: :unset) ⇒ HostedNumberOrderInstance
Update the HostedNumberOrderInstance
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 282 def update( status: nil, verification_call_delay: :unset, verification_call_extension: :unset ) data = Twilio::Values.of({ 'Status' => status, 'VerificationCallDelay' => verification_call_delay, 'VerificationCallExtension' => verification_call_extension, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) HostedNumberOrderInstance.new( @version, payload, sid: @solution[:sid], ) end |