class Bandwidth::OrderStatus

If requestId exists, the result for that request is returned. See the Examples for details on the various responses that you can receive. Generally, if you see a Response Code of 0 in a result for a TN, information will be available for it. Any other Response Code will indicate no information was available for the TN.

Attributes

failed_telephone_numbers[RW]

The telephone numbers whose lookup failed @return [List of String]

request_id[RW]

The requestId. @return [String]

result[RW]

The carrier information results for the specified telephone number. @return [List of Result]

status[RW]

The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED). @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb, line 51
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash['requestId']
  status = hash['status']
  failed_telephone_numbers = hash['failedTelephoneNumbers']
  # Parameter is an array, so we need to iterate through it
  result = nil
  unless hash['result'].nil?
    result = []
    hash['result'].each do |structure|
      result << (Result.from_hash(structure) if structure)
    end
  end

  # Create object from extracted values.
  OrderStatus.new(request_id,
                  status,
                  failed_telephone_numbers,
                  result)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb, line 31
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'requestId'
  @_hash['status'] = 'status'
  @_hash['failed_telephone_numbers'] = 'failedTelephoneNumbers'
  @_hash['result'] = 'result'
  @_hash
end
new(request_id = nil, status = nil, failed_telephone_numbers = nil, result = nil) click to toggle source
# File lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb, line 40
def initialize(request_id = nil,
               status = nil,
               failed_telephone_numbers = nil,
               result = nil)
  @request_id = request_id
  @status = status
  @failed_telephone_numbers = failed_telephone_numbers
  @result = result
end