Class: Twilio::REST::Preview::HostedNumbers::HostedNumberOrderContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::HostedNumbers::HostedNumberOrderContext
- Defined in:
- lib/twilio-ruby/rest/preview/hosted_numbers/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(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset, verification_type: :unset, verification_document_sid: :unset, extension: :unset, call_delay: :unset) ⇒ HostedNumberOrderInstance
Update the HostedNumberOrderInstance.
Constructor Details
#initialize(version, sid) ⇒ HostedNumberOrderContext
Initialize the HostedNumberOrderContext
239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 239 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/HostedNumberOrders/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the HostedNumberOrderInstance
251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 251 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
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 263 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
342 343 344 345 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 342 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.HostedNumbers.HostedNumberOrderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
335 336 337 338 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 335 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.HostedNumbers.HostedNumberOrderContext #{context}>" end |
#update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset, verification_type: :unset, verification_document_sid: :unset, extension: :unset, call_delay: :unset) ⇒ HostedNumberOrderInstance
Update the HostedNumberOrderInstance
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 292 def update( friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset, verification_type: :unset, verification_document_sid: :unset, extension: :unset, call_delay: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'UniqueName' => unique_name, 'Email' => email, 'CcEmails' => Twilio.serialize_list(cc_emails) { |e| e }, 'Status' => status, 'VerificationCode' => verification_code, 'VerificationType' => verification_type, 'VerificationDocumentSid' => verification_document_sid, 'Extension' => extension, 'CallDelay' => call_delay, }) 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 |