class Twilio::REST::Preview::HostedNumbers::HostedNumberOrderContext
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
Public Class Methods
Initialize the HostedNumberOrderContext
@param [Version] version Version
that contains the resource @param [String] sid A 34 character string that uniquely identifies this
HostedNumberOrder.
@return [HostedNumberOrderContext] HostedNumberOrderContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 285 def initialize(version, sid) 286 super(version) 287 288 # Path Solution 289 @solution = {sid: sid, } 290 @uri = "/HostedNumberOrders/#{@solution[:sid]}" 291 end
Public Instance Methods
Delete the HostedNumberOrderInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 305 def delete 306 @version.delete('DELETE', @uri) 307 end
Fetch the HostedNumberOrderInstance
@return [HostedNumberOrderInstance] Fetched HostedNumberOrderInstance
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 296 def fetch 297 payload = @version.fetch('GET', @uri) 298 299 HostedNumberOrderInstance.new(@version, payload, sid: @solution[:sid], ) 300 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 363 def inspect 364 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 365 "#<Twilio.Preview.HostedNumbers.HostedNumberOrderContext #{context}>" 366 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 356 def to_s 357 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 358 "#<Twilio.Preview.HostedNumbers.HostedNumberOrderContext #{context}>" 359 end
Update the HostedNumberOrderInstance
@param [String] friendly_name A 64 character string that is a human readable
text that describes this resource.
@param [String] unique_name Provides a unique and addressable name to be
assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
@param [String] email Email of the owner of this phone number that is being
hosted.
@param [Array] cc_emails Optional. A list of emails that LOA document
for this HostedNumberOrder will be carbon copied to.
@param [hosted_number_order.Status] status User can only post to
`pending-verification` status to transition the HostedNumberOrder to initiate a verification call or verification of ownership with a copy of a phone bill.
@param [String] verification_code A verification code that is given to the user
via a phone call to the phone number that is being hosted.
@param [hosted_number_order.VerificationType] verification_type Optional. The
method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill.
@param [String] verification_document_sid Optional. The unique sid identifier of
the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.
@param [String] extension Digits to dial after connecting the verification call. @param [String] call_delay The number of seconds, between 0 and 60, to delay
before initiating the verification call. Defaults to 0
@return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance
# File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb 335 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) 336 data = Twilio::Values.of({ 337 'FriendlyName' => friendly_name, 338 'UniqueName' => unique_name, 339 'Email' => email, 340 'CcEmails' => Twilio.serialize_list(cc_emails) { |e| e }, 341 'Status' => status, 342 'VerificationCode' => verification_code, 343 'VerificationType' => verification_type, 344 'VerificationDocumentSid' => verification_document_sid, 345 'Extension' => extension, 346 'CallDelay' => call_delay, 347 }) 348 349 payload = @version.update('POST', @uri, data: data) 350 351 HostedNumberOrderInstance.new(@version, payload, sid: @solution[:sid], ) 352 end