Class: Asdawqw::ValidationAsynchronousPushMessageRequest
- Defined in:
- lib/asdawqw/models/validation_asynchronous_push_message_request.rb
Overview
Request for validation messages which BookingPal push asynchronous (webhooks request)
Instance Attribute Summary collapse
-
#supplier_id ⇒ Integer
Id of supplier in BookingPal.
-
#type ⇒ AsynchronousPushMessageTypeEnum
push message type.
-
#validation ⇒ List of AsynchronousValidationModel
Validation Model.
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(supplier_id = nil, type = nil, validation = nil) ⇒ ValidationAsynchronousPushMessageRequest
constructor
A new instance of ValidationAsynchronousPushMessageRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(supplier_id = nil, type = nil, validation = nil) ⇒ ValidationAsynchronousPushMessageRequest
Returns a new instance of ValidationAsynchronousPushMessageRequest.
31 32 33 34 35 36 37 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 31 def initialize(supplier_id = nil, type = nil, validation = nil) @supplier_id = supplier_id @type = type @validation = validation end |
Instance Attribute Details
#supplier_id ⇒ Integer
Id of supplier in BookingPal
12 13 14 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 12 def supplier_id @supplier_id end |
#type ⇒ AsynchronousPushMessageTypeEnum
push message type. BP_VALIDATION
16 17 18 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 16 def type @type end |
#validation ⇒ List of AsynchronousValidationModel
Validation Model
20 21 22 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 20 def validation @validation end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 40 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. supplier_id = hash['supplierId'] type = hash['type'] # Parameter is an array, so we need to iterate through it validation = nil unless hash['validation'].nil? validation = [] hash['validation'].each do |structure| validation << (AsynchronousValidationModel.from_hash(structure) if structure) end end # Create object from extracted values. ValidationAsynchronousPushMessageRequest.new(supplier_id, type, validation) end |
.names ⇒ Object
A mapping from model property names to API property names.
23 24 25 26 27 28 29 |
# File 'lib/asdawqw/models/validation_asynchronous_push_message_request.rb', line 23 def self.names @_hash = {} if @_hash.nil? @_hash['supplier_id'] = 'supplierId' @_hash['type'] = 'type' @_hash['validation'] = 'validation' @_hash end |