Class: Bandwidth::OrderStatus
- Defined in:
- lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb
Overview
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.
Instance Attribute Summary collapse
-
#failed_telephone_numbers ⇒ List of String
The telephone numbers whose lookup failed.
-
#request_id ⇒ String
The requestId.
-
#result ⇒ List of Result
The carrier information results for the specified telephone number.
-
#status ⇒ String
The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(request_id = nil, status = nil, failed_telephone_numbers = nil, result = nil) ⇒ OrderStatus
constructor
A new instance of OrderStatus.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(request_id = nil, status = nil, failed_telephone_numbers = nil, result = nil) ⇒ OrderStatus
Returns a new instance of OrderStatus.
58 59 60 61 62 63 64 65 66 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 58 def initialize(request_id = nil, status = nil, failed_telephone_numbers = nil, result = nil) @request_id = request_id unless request_id == SKIP @status = status unless status == SKIP @failed_telephone_numbers = failed_telephone_numbers unless failed_telephone_numbers == SKIP @result = result unless result == SKIP end |
Instance Attribute Details
#failed_telephone_numbers ⇒ List of String
The telephone numbers whose lookup failed
27 28 29 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 27 def failed_telephone_numbers @failed_telephone_numbers end |
#request_id ⇒ String
The requestId.
18 19 20 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 18 def request_id @request_id end |
#result ⇒ List of Result
The carrier information results for the specified telephone number.
31 32 33 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 31 def result @result end |
#status ⇒ String
The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).
23 24 25 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 23 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('requestId') ? hash['requestId'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP failed_telephone_numbers = hash.key?('failedTelephoneNumbers') ? hash['failedTelephoneNumbers'] : SKIP # 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 result = SKIP unless hash.key?('result') # Create object from extracted values. OrderStatus.new(request_id, status, failed_telephone_numbers, result) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'requestId' @_hash['status'] = 'status' @_hash['failed_telephone_numbers'] = 'failedTelephoneNumbers' @_hash['result'] = 'result' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 54 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/bandwidth/phone_number_lookup_lib/phone_number_lookup/models/order_status.rb', line 44 def optionals %w[ request_id status failed_telephone_numbers result ] end |