Class: CyberSource::Ptsv2paymentsTravelInformationLodging

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Ptsv2paymentsTravelInformationLodging

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 241

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'checkInDate')
    self.check_in_date = attributes[:'checkInDate']
  end

  if attributes.has_key?(:'checkOutDate')
    self.check_out_date = attributes[:'checkOutDate']
  end

  if attributes.has_key?(:'room')
    if (value = attributes[:'room']).is_a?(Array)
      self.room = value
    end
  end

  if attributes.has_key?(:'smokingPreference')
    self.smoking_preference = attributes[:'smokingPreference']
  end

  if attributes.has_key?(:'numberOfRooms')
    self.number_of_rooms = attributes[:'numberOfRooms']
  end

  if attributes.has_key?(:'numberOfGuests')
    self.number_of_guests = attributes[:'numberOfGuests']
  end

  if attributes.has_key?(:'roomBedType')
    self.room_bed_type = attributes[:'roomBedType']
  end

  if attributes.has_key?(:'roomTaxType')
    self.room_tax_type = attributes[:'roomTaxType']
  end

  if attributes.has_key?(:'roomRateType')
    self.room_rate_type = attributes[:'roomRateType']
  end

  if attributes.has_key?(:'guestName')
    self.guest_name = attributes[:'guestName']
  end

  if attributes.has_key?(:'customerServicePhoneNumber')
    self.customer_service_phone_number = attributes[:'customerServicePhoneNumber']
  end

  if attributes.has_key?(:'corporateClientCode')
    self.corporate_client_code = attributes[:'corporateClientCode']
  end

  if attributes.has_key?(:'additionalDiscountAmount')
    self.additional_discount_amount = attributes[:'additionalDiscountAmount']
  end

  if attributes.has_key?(:'roomLocation')
    self.room_location = attributes[:'roomLocation']
  end

  if attributes.has_key?(:'specialProgramCode')
    self.special_program_code = attributes[:'specialProgramCode']
  end

  if attributes.has_key?(:'totalTaxAmount')
    self.total_tax_amount = attributes[:'totalTaxAmount']
  end

  if attributes.has_key?(:'prepaidCost')
    self.prepaid_cost = attributes[:'prepaidCost']
  end

  if attributes.has_key?(:'foodAndBeverageCost')
    self.food_and_beverage_cost = attributes[:'foodAndBeverageCost']
  end

  if attributes.has_key?(:'roomTaxAmount')
    self.room_tax_amount = attributes[:'roomTaxAmount']
  end

  if attributes.has_key?(:'adjustmentAmount')
    self.adjustment_amount = attributes[:'adjustmentAmount']
  end

  if attributes.has_key?(:'phoneCost')
    self.phone_cost = attributes[:'phoneCost']
  end

  if attributes.has_key?(:'restaurantCost')
    self.restaurant_cost = attributes[:'restaurantCost']
  end

  if attributes.has_key?(:'roomServiceCost')
    self.room_service_cost = attributes[:'roomServiceCost']
  end

  if attributes.has_key?(:'miniBarCost')
    self.mini_bar_cost = attributes[:'miniBarCost']
  end

  if attributes.has_key?(:'laundryCost')
    self.laundry_cost = attributes[:'laundryCost']
  end

  if attributes.has_key?(:'miscellaneousCost')
    self.miscellaneous_cost = attributes[:'miscellaneousCost']
  end

  if attributes.has_key?(:'giftShopCost')
    self.gift_shop_cost = attributes[:'giftShopCost']
  end

  if attributes.has_key?(:'movieCost')
    self.movie_cost = attributes[:'movieCost']
  end

  if attributes.has_key?(:'healthClubCost')
    self.health_club_cost = attributes[:'healthClubCost']
  end

  if attributes.has_key?(:'valetParkingCost')
    self.valet_parking_cost = attributes[:'valetParkingCost']
  end

  if attributes.has_key?(:'cashDisbursementCost')
    self.cash_disbursement_cost = attributes[:'cashDisbursementCost']
  end

  if attributes.has_key?(:'nonRoomCost')
    self.non_room_cost = attributes[:'nonRoomCost']
  end

  if attributes.has_key?(:'businessCenterCost')
    self.business_center_cost = attributes[:'businessCenterCost']
  end

  if attributes.has_key?(:'loungeBarCost')
    self.lounge_bar_cost = attributes[:'loungeBarCost']
  end

  if attributes.has_key?(:'transportationCost')
    self.transportation_cost = attributes[:'transportationCost']
  end

  if attributes.has_key?(:'gratuityAmount')
    self.gratuity_amount = attributes[:'gratuityAmount']
  end

  if attributes.has_key?(:'conferenceRoomCost')
    self.conference_room_cost = attributes[:'conferenceRoomCost']
  end

  if attributes.has_key?(:'audioVisualCost')
    self.audio_visual_cost = attributes[:'audioVisualCost']
  end

  if attributes.has_key?(:'banquestCost')
    self.banquest_cost = attributes[:'banquestCost']
  end

  if attributes.has_key?(:'nonRoomTaxAmount')
    self.non_room_tax_amount = attributes[:'nonRoomTaxAmount']
  end

  if attributes.has_key?(:'earlyCheckOutCost')
    self.early_check_out_cost = attributes[:'earlyCheckOutCost']
  end

  if attributes.has_key?(:'internetAccessCost')
    self.internet_access_cost = attributes[:'internetAccessCost']
  end
end

Instance Attribute Details

#additional_discount_amountObject

Amount of an additional coupon or discount.



54
55
56
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 54

def additional_discount_amount
  @additional_discount_amount
end

#adjustment_amountObject

Adjusted amount charged in addition to the reservation amount after the stay is complete.



75
76
77
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 75

def adjustment_amount
  @adjustment_amount
end

#audio_visual_costObject

Cost of audio visual services.



129
130
131
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 129

def audio_visual_cost
  @audio_visual_cost
end

#banquest_costObject

Cost of banquet services.



132
133
134
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 132

def banquest_cost
  @banquest_cost
end

#business_center_costObject

Cost of business center services.



114
115
116
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 114

def business_center_cost
  @business_center_cost
end

#cash_disbursement_costObject

Cost of the cash that was disbursed plus any associated service fees



108
109
110
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 108

def cash_disbursement_cost
  @cash_disbursement_cost
end

#check_in_dateObject

Date on which the guest checked in. In the case of a no-show or a reservation, the scheduled arrival date. Format: ‘MMDDYY`. For best interchange rates, make sure it is a valid date.



18
19
20
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 18

def check_in_date
  @check_in_date
end

#check_out_dateObject

Date on which the guest checked out. Format: ‘MMDDYY`. For best interchange rates, make sure it is a valid date.



21
22
23
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 21

def check_out_date
  @check_out_date
end

#conference_room_costObject

Cost of conference room services.



126
127
128
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 126

def conference_room_cost
  @conference_room_cost
end

#corporate_client_codeObject

Code assigned to a business. You can use this code to identify corporate rates and discounts for guests.



51
52
53
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 51

def corporate_client_code
  @corporate_client_code
end

#customer_service_phone_numberObject

Your toll-free customer service phone number.



48
49
50
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 48

def customer_service_phone_number
  @customer_service_phone_number
end

#early_check_out_costObject

Service fee for early departure.



138
139
140
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 138

def early_check_out_cost
  @early_check_out_cost
end

#food_and_beverage_costObject

Cost for all food and beverages.



69
70
71
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 69

def food_and_beverage_cost
  @food_and_beverage_cost
end

#gift_shop_costObject

Cost of gift shop purchases.



96
97
98
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 96

def gift_shop_cost
  @gift_shop_cost
end

#gratuity_amountObject

Gratuity.



123
124
125
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 123

def gratuity_amount
  @gratuity_amount
end

#guest_nameObject

Name of the guest under which the room is reserved.



45
46
47
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 45

def guest_name
  @guest_name
end

#health_club_costObject

Cost of health club services.



102
103
104
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 102

def health_club_cost
  @health_club_cost
end

#internet_access_costObject

Cost of Internet access.



141
142
143
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 141

def internet_access_cost
  @internet_access_cost
end

#laundry_costObject

Cost of laundry services.



90
91
92
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 90

def laundry_cost
  @laundry_cost
end

#lounge_bar_costObject

Cost of lounge and bar purchases.



117
118
119
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 117

def lounge_bar_cost
  @lounge_bar_cost
end

#mini_bar_costObject

Cost of mini-bar purchases.



87
88
89
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 87

def mini_bar_cost
  @mini_bar_cost
end

#miscellaneous_costObject

Miscellaneous costs.



93
94
95
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 93

def miscellaneous_cost
  @miscellaneous_cost
end

#movie_costObject

Cost of movies.



99
100
101
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 99

def movie_cost
  @movie_cost
end

#non_room_costObject

Cost of non-room purchases, such as meals and gifts.



111
112
113
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 111

def non_room_cost
  @non_room_cost
end

#non_room_tax_amountObject

Tax on non-room purchases.



135
136
137
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 135

def non_room_tax_amount
  @non_room_tax_amount
end

#number_of_guestsObject

Number of guests staying in the room.



33
34
35
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 33

def number_of_guests
  @number_of_guests
end

#number_of_roomsObject

Number of rooms booked by the cardholder.



30
31
32
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 30

def number_of_rooms
  @number_of_rooms
end

#phone_costObject

Cost of telephone services.



78
79
80
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 78

def phone_cost
  @phone_cost
end

#prepaid_costObject

Prepaid amount, such as a deposit.



66
67
68
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 66

def prepaid_cost
  @prepaid_cost
end

#restaurant_costObject

Cost of restaurant purchases



81
82
83
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 81

def restaurant_cost
  @restaurant_cost
end

#roomObject

The object containing the number of nights and the daily rate that applies for that no of nights.



24
25
26
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 24

def room
  @room
end

#room_bed_typeObject

Type of room, such as queen, king, or two doubles.



36
37
38
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 36

def room_bed_type
  @room_bed_type
end

#room_locationObject

Location of room, such as lake view or ocean view.



57
58
59
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 57

def room_location
  @room_location
end

#room_rate_typeObject

Type of rate, such as corporate or senior citizen.



42
43
44
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 42

def room_rate_type
  @room_rate_type
end

#room_service_costObject

Cost of room service.



84
85
86
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 84

def room_service_cost
  @room_service_cost
end

#room_tax_amountObject

Total tax for the room.



72
73
74
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 72

def room_tax_amount
  @room_tax_amount
end

#room_tax_typeObject

Type of tax, such as tourist or hotel.



39
40
41
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 39

def room_tax_type
  @room_tax_type
end

#smoking_preferenceObject

Smoking preference of the guest. Possible values: - ‘Y`: smoking room - `N`: non-smoking room



27
28
29
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 27

def smoking_preference
  @smoking_preference
end

#special_program_codeObject

Code that identifies special circumstances. Possible values: - ‘1`: lodging (default) - `2`: no show reservation - `3`: advanced deposit



60
61
62
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 60

def special_program_code
  @special_program_code
end

#total_tax_amountObject

Total tax amount.



63
64
65
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 63

def total_tax_amount
  @total_tax_amount
end

#transportation_costObject

Cost of transportation services.



120
121
122
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 120

def transportation_cost
  @transportation_cost
end

#valet_parking_costObject

Cost of valet parking services.



105
106
107
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 105

def valet_parking_cost
  @valet_parking_cost
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
180
181
182
183
184
185
186
187
188
189
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 144

def self.attribute_map
  {
    :'check_in_date' => :'checkInDate',
    :'check_out_date' => :'checkOutDate',
    :'room' => :'room',
    :'smoking_preference' => :'smokingPreference',
    :'number_of_rooms' => :'numberOfRooms',
    :'number_of_guests' => :'numberOfGuests',
    :'room_bed_type' => :'roomBedType',
    :'room_tax_type' => :'roomTaxType',
    :'room_rate_type' => :'roomRateType',
    :'guest_name' => :'guestName',
    :'customer_service_phone_number' => :'customerServicePhoneNumber',
    :'corporate_client_code' => :'corporateClientCode',
    :'additional_discount_amount' => :'additionalDiscountAmount',
    :'room_location' => :'roomLocation',
    :'special_program_code' => :'specialProgramCode',
    :'total_tax_amount' => :'totalTaxAmount',
    :'prepaid_cost' => :'prepaidCost',
    :'food_and_beverage_cost' => :'foodAndBeverageCost',
    :'room_tax_amount' => :'roomTaxAmount',
    :'adjustment_amount' => :'adjustmentAmount',
    :'phone_cost' => :'phoneCost',
    :'restaurant_cost' => :'restaurantCost',
    :'room_service_cost' => :'roomServiceCost',
    :'mini_bar_cost' => :'miniBarCost',
    :'laundry_cost' => :'laundryCost',
    :'miscellaneous_cost' => :'miscellaneousCost',
    :'gift_shop_cost' => :'giftShopCost',
    :'movie_cost' => :'movieCost',
    :'health_club_cost' => :'healthClubCost',
    :'valet_parking_cost' => :'valetParkingCost',
    :'cash_disbursement_cost' => :'cashDisbursementCost',
    :'non_room_cost' => :'nonRoomCost',
    :'business_center_cost' => :'businessCenterCost',
    :'lounge_bar_cost' => :'loungeBarCost',
    :'transportation_cost' => :'transportationCost',
    :'gratuity_amount' => :'gratuityAmount',
    :'conference_room_cost' => :'conferenceRoomCost',
    :'audio_visual_cost' => :'audioVisualCost',
    :'banquest_cost' => :'banquestCost',
    :'non_room_tax_amount' => :'nonRoomTaxAmount',
    :'early_check_out_cost' => :'earlyCheckOutCost',
    :'internet_access_cost' => :'internetAccessCost'
  }
end

.swagger_typesObject

Attribute type mapping.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 192

def self.swagger_types
  {
    :'check_in_date' => :'String',
    :'check_out_date' => :'String',
    :'room' => :'Array<Ptsv2paymentsTravelInformationLodgingRoom>',
    :'smoking_preference' => :'String',
    :'number_of_rooms' => :'Integer',
    :'number_of_guests' => :'Integer',
    :'room_bed_type' => :'String',
    :'room_tax_type' => :'String',
    :'room_rate_type' => :'String',
    :'guest_name' => :'String',
    :'customer_service_phone_number' => :'String',
    :'corporate_client_code' => :'String',
    :'additional_discount_amount' => :'String',
    :'room_location' => :'String',
    :'special_program_code' => :'String',
    :'total_tax_amount' => :'String',
    :'prepaid_cost' => :'String',
    :'food_and_beverage_cost' => :'String',
    :'room_tax_amount' => :'String',
    :'adjustment_amount' => :'String',
    :'phone_cost' => :'String',
    :'restaurant_cost' => :'String',
    :'room_service_cost' => :'String',
    :'mini_bar_cost' => :'String',
    :'laundry_cost' => :'String',
    :'miscellaneous_cost' => :'String',
    :'gift_shop_cost' => :'String',
    :'movie_cost' => :'String',
    :'health_club_cost' => :'String',
    :'valet_parking_cost' => :'String',
    :'cash_disbursement_cost' => :'String',
    :'non_room_cost' => :'String',
    :'business_center_cost' => :'String',
    :'lounge_bar_cost' => :'String',
    :'transportation_cost' => :'String',
    :'gratuity_amount' => :'String',
    :'conference_room_cost' => :'String',
    :'audio_visual_cost' => :'String',
    :'banquest_cost' => :'String',
    :'non_room_tax_amount' => :'String',
    :'early_check_out_cost' => :'String',
    :'internet_access_cost' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1066

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      check_in_date == o.check_in_date &&
      check_out_date == o.check_out_date &&
      room == o.room &&
      smoking_preference == o.smoking_preference &&
      number_of_rooms == o.number_of_rooms &&
      number_of_guests == o.number_of_guests &&
      room_bed_type == o.room_bed_type &&
      room_tax_type == o.room_tax_type &&
      room_rate_type == o.room_rate_type &&
      guest_name == o.guest_name &&
      customer_service_phone_number == o.customer_service_phone_number &&
      corporate_client_code == o.corporate_client_code &&
      additional_discount_amount == o.additional_discount_amount &&
      room_location == o.room_location &&
      special_program_code == o.special_program_code &&
      total_tax_amount == o.total_tax_amount &&
      prepaid_cost == o.prepaid_cost &&
      food_and_beverage_cost == o.food_and_beverage_cost &&
      room_tax_amount == o.room_tax_amount &&
      adjustment_amount == o.adjustment_amount &&
      phone_cost == o.phone_cost &&
      restaurant_cost == o.restaurant_cost &&
      room_service_cost == o.room_service_cost &&
      mini_bar_cost == o.mini_bar_cost &&
      laundry_cost == o.laundry_cost &&
      miscellaneous_cost == o.miscellaneous_cost &&
      gift_shop_cost == o.gift_shop_cost &&
      movie_cost == o.movie_cost &&
      health_club_cost == o.health_club_cost &&
      valet_parking_cost == o.valet_parking_cost &&
      cash_disbursement_cost == o.cash_disbursement_cost &&
      non_room_cost == o.non_room_cost &&
      business_center_cost == o.business_center_cost &&
      lounge_bar_cost == o.lounge_bar_cost &&
      transportation_cost == o.transportation_cost &&
      gratuity_amount == o.gratuity_amount &&
      conference_room_cost == o.conference_room_cost &&
      audio_visual_cost == o.audio_visual_cost &&
      banquest_cost == o.banquest_cost &&
      non_room_tax_amount == o.non_room_tax_amount &&
      early_check_out_cost == o.early_check_out_cost &&
      internet_access_cost == o.internet_access_cost
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1149

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1215

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1128

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


1115
1116
1117
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1115

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



1121
1122
1123
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1121

def hash
  [check_in_date, check_out_date, room, smoking_preference, number_of_rooms, number_of_guests, room_bed_type, room_tax_type, room_rate_type, guest_name, customer_service_phone_number, corporate_client_code, additional_discount_amount, room_location, special_program_code, total_tax_amount, prepaid_cost, food_and_beverage_cost, room_tax_amount, adjustment_amount, phone_cost, restaurant_cost, room_service_cost, mini_bar_cost, laundry_cost, miscellaneous_cost, gift_shop_cost, movie_cost, health_club_cost, valet_parking_cost, cash_disbursement_cost, non_room_cost, business_center_cost, lounge_bar_cost, transportation_cost, gratuity_amount, conference_room_cost, audio_visual_cost, banquest_cost, non_room_tax_amount, early_check_out_cost, internet_access_cost].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 420

def list_invalid_properties
  invalid_properties = Array.new
  if !@check_in_date.nil? && @check_in_date.to_s.length > 6
    invalid_properties.push('invalid value for "check_in_date", the character length must be smaller than or equal to 6.')
  end

  if !@check_out_date.nil? && @check_out_date.to_s.length > 6
    invalid_properties.push('invalid value for "check_out_date", the character length must be smaller than or equal to 6.')
  end

  if !@smoking_preference.nil? && @smoking_preference.to_s.length > 1
    invalid_properties.push('invalid value for "smoking_preference", the character length must be smaller than or equal to 1.')
  end

  if !@number_of_rooms.nil? && @number_of_rooms > 99
    invalid_properties.push('invalid value for "number_of_rooms", must be smaller than or equal to 99.')
  end

  if !@number_of_rooms.nil? && @number_of_rooms < 1
    invalid_properties.push('invalid value for "number_of_rooms", must be greater than or equal to 1.')
  end

  if !@number_of_guests.nil? && @number_of_guests > 99
    invalid_properties.push('invalid value for "number_of_guests", must be smaller than or equal to 99.')
  end

  if !@number_of_guests.nil? && @number_of_guests < 1
    invalid_properties.push('invalid value for "number_of_guests", must be greater than or equal to 1.')
  end

  if !@room_bed_type.nil? && @room_bed_type.to_s.length > 12
    invalid_properties.push('invalid value for "room_bed_type", the character length must be smaller than or equal to 12.')
  end

  if !@room_tax_type.nil? && @room_tax_type.to_s.length > 10
    invalid_properties.push('invalid value for "room_tax_type", the character length must be smaller than or equal to 10.')
  end

  if !@room_rate_type.nil? && @room_rate_type.to_s.length > 12
    invalid_properties.push('invalid value for "room_rate_type", the character length must be smaller than or equal to 12.')
  end

  if !@guest_name.nil? && @guest_name.to_s.length > 40
    invalid_properties.push('invalid value for "guest_name", the character length must be smaller than or equal to 40.')
  end

  if !@customer_service_phone_number.nil? && @customer_service_phone_number.to_s.length > 17
    invalid_properties.push('invalid value for "customer_service_phone_number", the character length must be smaller than or equal to 17.')
  end

  if !@corporate_client_code.nil? && @corporate_client_code.to_s.length > 17
    invalid_properties.push('invalid value for "corporate_client_code", the character length must be smaller than or equal to 17.')
  end

  if !@additional_discount_amount.nil? && @additional_discount_amount.to_s.length > 12
    invalid_properties.push('invalid value for "additional_discount_amount", the character length must be smaller than or equal to 12.')
  end

  if !@room_location.nil? && @room_location.to_s.length > 10
    invalid_properties.push('invalid value for "room_location", the character length must be smaller than or equal to 10.')
  end

  if !@special_program_code.nil? && @special_program_code.to_s.length > 1
    invalid_properties.push('invalid value for "special_program_code", the character length must be smaller than or equal to 1.')
  end

  if !@total_tax_amount.nil? && @total_tax_amount.to_s.length > 12
    invalid_properties.push('invalid value for "total_tax_amount", the character length must be smaller than or equal to 12.')
  end

  if !@prepaid_cost.nil? && @prepaid_cost.to_s.length > 12
    invalid_properties.push('invalid value for "prepaid_cost", the character length must be smaller than or equal to 12.')
  end

  if !@food_and_beverage_cost.nil? && @food_and_beverage_cost.to_s.length > 12
    invalid_properties.push('invalid value for "food_and_beverage_cost", the character length must be smaller than or equal to 12.')
  end

  if !@room_tax_amount.nil? && @room_tax_amount.to_s.length > 12
    invalid_properties.push('invalid value for "room_tax_amount", the character length must be smaller than or equal to 12.')
  end

  if !@adjustment_amount.nil? && @adjustment_amount.to_s.length > 12
    invalid_properties.push('invalid value for "adjustment_amount", the character length must be smaller than or equal to 12.')
  end

  if !@phone_cost.nil? && @phone_cost.to_s.length > 12
    invalid_properties.push('invalid value for "phone_cost", the character length must be smaller than or equal to 12.')
  end

  if !@restaurant_cost.nil? && @restaurant_cost.to_s.length > 12
    invalid_properties.push('invalid value for "restaurant_cost", the character length must be smaller than or equal to 12.')
  end

  if !@room_service_cost.nil? && @room_service_cost.to_s.length > 12
    invalid_properties.push('invalid value for "room_service_cost", the character length must be smaller than or equal to 12.')
  end

  if !@mini_bar_cost.nil? && @mini_bar_cost.to_s.length > 12
    invalid_properties.push('invalid value for "mini_bar_cost", the character length must be smaller than or equal to 12.')
  end

  if !@laundry_cost.nil? && @laundry_cost.to_s.length > 12
    invalid_properties.push('invalid value for "laundry_cost", the character length must be smaller than or equal to 12.')
  end

  if !@miscellaneous_cost.nil? && @miscellaneous_cost.to_s.length > 12
    invalid_properties.push('invalid value for "miscellaneous_cost", the character length must be smaller than or equal to 12.')
  end

  if !@gift_shop_cost.nil? && @gift_shop_cost.to_s.length > 12
    invalid_properties.push('invalid value for "gift_shop_cost", the character length must be smaller than or equal to 12.')
  end

  if !@movie_cost.nil? && @movie_cost.to_s.length > 12
    invalid_properties.push('invalid value for "movie_cost", the character length must be smaller than or equal to 12.')
  end

  if !@health_club_cost.nil? && @health_club_cost.to_s.length > 12
    invalid_properties.push('invalid value for "health_club_cost", the character length must be smaller than or equal to 12.')
  end

  if !@valet_parking_cost.nil? && @valet_parking_cost.to_s.length > 12
    invalid_properties.push('invalid value for "valet_parking_cost", the character length must be smaller than or equal to 12.')
  end

  if !@cash_disbursement_cost.nil? && @cash_disbursement_cost.to_s.length > 12
    invalid_properties.push('invalid value for "cash_disbursement_cost", the character length must be smaller than or equal to 12.')
  end

  if !@non_room_cost.nil? && @non_room_cost.to_s.length > 12
    invalid_properties.push('invalid value for "non_room_cost", the character length must be smaller than or equal to 12.')
  end

  if !@business_center_cost.nil? && @business_center_cost.to_s.length > 12
    invalid_properties.push('invalid value for "business_center_cost", the character length must be smaller than or equal to 12.')
  end

  if !@lounge_bar_cost.nil? && @lounge_bar_cost.to_s.length > 12
    invalid_properties.push('invalid value for "lounge_bar_cost", the character length must be smaller than or equal to 12.')
  end

  if !@transportation_cost.nil? && @transportation_cost.to_s.length > 12
    invalid_properties.push('invalid value for "transportation_cost", the character length must be smaller than or equal to 12.')
  end

  if !@gratuity_amount.nil? && @gratuity_amount.to_s.length > 12
    invalid_properties.push('invalid value for "gratuity_amount", the character length must be smaller than or equal to 12.')
  end

  if !@conference_room_cost.nil? && @conference_room_cost.to_s.length > 12
    invalid_properties.push('invalid value for "conference_room_cost", the character length must be smaller than or equal to 12.')
  end

  if !@audio_visual_cost.nil? && @audio_visual_cost.to_s.length > 12
    invalid_properties.push('invalid value for "audio_visual_cost", the character length must be smaller than or equal to 12.')
  end

  if !@banquest_cost.nil? && @banquest_cost.to_s.length > 12
    invalid_properties.push('invalid value for "banquest_cost", the character length must be smaller than or equal to 12.')
  end

  if !@non_room_tax_amount.nil? && @non_room_tax_amount.to_s.length > 12
    invalid_properties.push('invalid value for "non_room_tax_amount", the character length must be smaller than or equal to 12.')
  end

  if !@early_check_out_cost.nil? && @early_check_out_cost.to_s.length > 12
    invalid_properties.push('invalid value for "early_check_out_cost", the character length must be smaller than or equal to 12.')
  end

  if !@internet_access_cost.nil? && @internet_access_cost.to_s.length > 12
    invalid_properties.push('invalid value for "internet_access_cost", the character length must be smaller than or equal to 12.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



1195
1196
1197
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1195

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



1201
1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1201

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



1189
1190
1191
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 1189

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_lodging.rb', line 599

def valid?
  return false if !@check_in_date.nil? && @check_in_date.to_s.length > 6
  return false if !@check_out_date.nil? && @check_out_date.to_s.length > 6
  return false if !@smoking_preference.nil? && @smoking_preference.to_s.length > 1
  return false if !@number_of_rooms.nil? && @number_of_rooms > 99
  return false if !@number_of_rooms.nil? && @number_of_rooms < 1
  return false if !@number_of_guests.nil? && @number_of_guests > 99
  return false if !@number_of_guests.nil? && @number_of_guests < 1
  return false if !@room_bed_type.nil? && @room_bed_type.to_s.length > 12
  return false if !@room_tax_type.nil? && @room_tax_type.to_s.length > 10
  return false if !@room_rate_type.nil? && @room_rate_type.to_s.length > 12
  return false if !@guest_name.nil? && @guest_name.to_s.length > 40
  return false if !@customer_service_phone_number.nil? && @customer_service_phone_number.to_s.length > 17
  return false if !@corporate_client_code.nil? && @corporate_client_code.to_s.length > 17
  return false if !@additional_discount_amount.nil? && @additional_discount_amount.to_s.length > 12
  return false if !@room_location.nil? && @room_location.to_s.length > 10
  return false if !@special_program_code.nil? && @special_program_code.to_s.length > 1
  return false if !@total_tax_amount.nil? && @total_tax_amount.to_s.length > 12
  return false if !@prepaid_cost.nil? && @prepaid_cost.to_s.length > 12
  return false if !@food_and_beverage_cost.nil? && @food_and_beverage_cost.to_s.length > 12
  return false if !@room_tax_amount.nil? && @room_tax_amount.to_s.length > 12
  return false if !@adjustment_amount.nil? && @adjustment_amount.to_s.length > 12
  return false if !@phone_cost.nil? && @phone_cost.to_s.length > 12
  return false if !@restaurant_cost.nil? && @restaurant_cost.to_s.length > 12
  return false if !@room_service_cost.nil? && @room_service_cost.to_s.length > 12
  return false if !@mini_bar_cost.nil? && @mini_bar_cost.to_s.length > 12
  return false if !@laundry_cost.nil? && @laundry_cost.to_s.length > 12
  return false if !@miscellaneous_cost.nil? && @miscellaneous_cost.to_s.length > 12
  return false if !@gift_shop_cost.nil? && @gift_shop_cost.to_s.length > 12
  return false if !@movie_cost.nil? && @movie_cost.to_s.length > 12
  return false if !@health_club_cost.nil? && @health_club_cost.to_s.length > 12
  return false if !@valet_parking_cost.nil? && @valet_parking_cost.to_s.length > 12
  return false if !@cash_disbursement_cost.nil? && @cash_disbursement_cost.to_s.length > 12
  return false if !@non_room_cost.nil? && @non_room_cost.to_s.length > 12
  return false if !@business_center_cost.nil? && @business_center_cost.to_s.length > 12
  return false if !@lounge_bar_cost.nil? && @lounge_bar_cost.to_s.length > 12
  return false if !@transportation_cost.nil? && @transportation_cost.to_s.length > 12
  return false if !@gratuity_amount.nil? && @gratuity_amount.to_s.length > 12
  return false if !@conference_room_cost.nil? && @conference_room_cost.to_s.length > 12
  return false if !@audio_visual_cost.nil? && @audio_visual_cost.to_s.length > 12
  return false if !@banquest_cost.nil? && @banquest_cost.to_s.length > 12
  return false if !@non_room_tax_amount.nil? && @non_room_tax_amount.to_s.length > 12
  return false if !@early_check_out_cost.nil? && @early_check_out_cost.to_s.length > 12
  return false if !@internet_access_cost.nil? && @internet_access_cost.to_s.length > 12
  true
end