Class: Asdawqw::CancelReservationNotificationObject
- Defined in:
- lib/asdawqw/models/cancel_reservation_notification_object.rb
Overview
CancelReservationNotificationObject Model.
Instance Attribute Summary collapse
-
#adult ⇒ Integer
Number of adults.
-
#agent_name ⇒ String
Agent name/Channel name.
-
#child ⇒ Integer
Number of children.
-
#confirmation_id ⇒ String
Channel confirmation code.
-
#credit_card_type ⇒ String
Credit card type.
-
#customer_name ⇒ String
Guest full name (in format firstName, lastName).
-
#email ⇒ String
Guest email.
-
#from_date ⇒ Date
Reservation date from.
-
#new_state ⇒ String
It will always be “Cancelled” in this request.
-
#notes ⇒ String
Guest notes.
-
#phone ⇒ String
Guest phone.
-
#product_id ⇒ String
Id of the product in BookingPal.
-
#reservation_id ⇒ String
Id of the reservation in BookingPal.
-
#supplier_id ⇒ Integer
Id of the property manager.
-
#to_date ⇒ Date
Reservation date to.
-
#total ⇒ Float
Best available rate (This is the total value that guests will pay, including rate, fees, taxes, and all commissions. ).
-
#unique_key ⇒ String
Unique code to identify that the request is from BookingPal.
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(reservation_id = nil, product_id = nil, supplier_id = nil, agent_name = nil, confirmation_id = nil, unique_key = nil, new_state = nil, customer_name = nil, from_date = nil, to_date = nil, adult = nil, child = nil, email = nil, total = nil, phone = nil, notes = nil, credit_card_type = nil) ⇒ CancelReservationNotificationObject
constructor
A new instance of CancelReservationNotificationObject.
Methods inherited from BaseModel
Constructor Details
#initialize(reservation_id = nil, product_id = nil, supplier_id = nil, agent_name = nil, confirmation_id = nil, unique_key = nil, new_state = nil, customer_name = nil, from_date = nil, to_date = nil, adult = nil, child = nil, email = nil, total = nil, phone = nil, notes = nil, credit_card_type = nil) ⇒ CancelReservationNotificationObject
Returns a new instance of CancelReservationNotificationObject.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 102 def initialize(reservation_id = nil, product_id = nil, supplier_id = nil, agent_name = nil, confirmation_id = nil, unique_key = nil, new_state = nil, customer_name = nil, from_date = nil, to_date = nil, adult = nil, child = nil, email = nil, total = nil, phone = nil, notes = nil, credit_card_type = nil) @reservation_id = reservation_id @product_id = product_id @supplier_id = supplier_id @agent_name = agent_name @confirmation_id = confirmation_id @unique_key = unique_key @new_state = new_state @customer_name = customer_name @from_date = from_date @to_date = to_date @adult = adult @child = child @email = email @phone = phone @notes = notes @credit_card_type = credit_card_type @total = total end |
Instance Attribute Details
#adult ⇒ Integer
Number of adults
52 53 54 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 52 def adult @adult end |
#agent_name ⇒ String
Agent name/Channel name
23 24 25 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 23 def agent_name @agent_name end |
#child ⇒ Integer
Number of children
56 57 58 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 56 def child @child end |
#confirmation_id ⇒ String
Channel confirmation code
27 28 29 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 27 def confirmation_id @confirmation_id end |
#credit_card_type ⇒ String
Credit card type
72 73 74 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 72 def credit_card_type @credit_card_type end |
#customer_name ⇒ String
Guest full name (in format firstName, lastName)
40 41 42 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 40 def customer_name @customer_name end |
#email ⇒ String
Guest email
60 61 62 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 60 def email @email end |
#from_date ⇒ Date
Reservation date from. Date is in format “yyyy-MM-dd”
44 45 46 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 44 def from_date @from_date end |
#new_state ⇒ String
It will always be “Cancelled” in this request
36 37 38 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 36 def new_state @new_state end |
#notes ⇒ String
Guest notes
68 69 70 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 68 def notes @notes end |
#phone ⇒ String
Guest phone
64 65 66 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 64 def phone @phone end |
#product_id ⇒ String
Id of the product in BookingPal
15 16 17 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 15 def product_id @product_id end |
#reservation_id ⇒ String
Id of the reservation in BookingPal
11 12 13 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 11 def reservation_id @reservation_id end |
#supplier_id ⇒ Integer
Id of the property manager
19 20 21 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 19 def supplier_id @supplier_id end |
#to_date ⇒ Date
Reservation date to. Date is in format “yyyy-MM-dd”
48 49 50 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 48 def to_date @to_date end |
#total ⇒ Float
Best available rate (This is the total value that guests will pay, including rate, fees, taxes, and all commissions. )
77 78 79 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 77 def total @total end |
#unique_key ⇒ String
Unique code to identify that the request is from BookingPal. This value is unique for every PMS (and it will be different in different environments).
32 33 34 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 32 def unique_key @unique_key end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 139 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reservation_id = hash['reservationId'] product_id = hash['productId'] supplier_id = hash['supplierId'] agent_name = hash['agentName'] confirmation_id = hash['confirmationId'] unique_key = hash['uniqueKey'] new_state = hash['newState'] customer_name = hash['customerName'] from_date = hash['fromDate'] to_date = hash['toDate'] adult = hash['adult'] child = hash['child'] email = hash['email'] total = hash['total'] phone = hash['phone'] notes = hash['notes'] credit_card_type = hash['creditCardType'] # Create object from extracted values. CancelReservationNotificationObject.new(reservation_id, product_id, supplier_id, agent_name, confirmation_id, unique_key, new_state, customer_name, from_date, to_date, adult, child, email, total, phone, notes, credit_card_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/asdawqw/models/cancel_reservation_notification_object.rb', line 80 def self.names @_hash = {} if @_hash.nil? @_hash['reservation_id'] = 'reservationId' @_hash['product_id'] = 'productId' @_hash['supplier_id'] = 'supplierId' @_hash['agent_name'] = 'agentName' @_hash['confirmation_id'] = 'confirmationId' @_hash['unique_key'] = 'uniqueKey' @_hash['new_state'] = 'newState' @_hash['customer_name'] = 'customerName' @_hash['from_date'] = 'fromDate' @_hash['to_date'] = 'toDate' @_hash['adult'] = 'adult' @_hash['child'] = 'child' @_hash['email'] = 'email' @_hash['phone'] = 'phone' @_hash['notes'] = 'notes' @_hash['credit_card_type'] = 'creditCardType' @_hash['total'] = 'total' @_hash end |