Class: Asdawqw::RatesAvailabilityResponse
- Defined in:
- lib/asdawqw/models/rates_availability_response.rb
Overview
Rates Availability response
Instance Attribute Summary collapse
-
#code ⇒ String
Code of message.
-
#data ⇒ List of RatesAvailability
List of models.
-
#error_message ⇒ List of String
List of error messages.
-
#is_error ⇒ Boolean
Is error (default = false).
-
#message ⇒ String
text info message.
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(message = nil, error_message = nil, is_error = nil, code = nil, data = nil) ⇒ RatesAvailabilityResponse
constructor
A new instance of RatesAvailabilityResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(message = nil, error_message = nil, is_error = nil, code = nil, data = nil) ⇒ RatesAvailabilityResponse
Returns a new instance of RatesAvailabilityResponse.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 42 def initialize( = nil, = nil, is_error = nil, code = nil, data = nil) @message = @error_message = @is_error = is_error @code = code @data = data end |
Instance Attribute Details
#code ⇒ String
Code of message
23 24 25 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 23 def code @code end |
#data ⇒ List of RatesAvailability
List of models. This is a deprecated field. It will be removed in version 3.3. (This is only for Create and update requests, so you will not get this data in response). On GET request you will get data here.
29 30 31 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 29 def data @data end |
#error_message ⇒ List of String
List of error messages
15 16 17 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 15 def @error_message end |
#is_error ⇒ Boolean
Is error (default = false)
19 20 21 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 19 def is_error @is_error end |
#message ⇒ String
text info message
11 12 13 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 11 def @message end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash['message'] = hash['errorMessage'] is_error = hash['is_error'] code = hash['code'] # Parameter is an array, so we need to iterate through it data = nil unless hash['data'].nil? data = [] hash['data'].each do |structure| data << (RatesAvailability.from_hash(structure) if structure) end end # Create object from extracted values. RatesAvailabilityResponse.new(, , is_error, code, data) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 40 |
# File 'lib/asdawqw/models/rates_availability_response.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['message'] = 'message' @_hash['error_message'] = 'errorMessage' @_hash['is_error'] = 'is_error' @_hash['code'] = 'code' @_hash['data'] = 'data' @_hash end |