Class: Asdawqw::FunctionsRequestToBook

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/asdawqw/models/functions_request_to_book.rb

Overview

Request to book answer model

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(request_to_book_type = nil, reservation_id = nil, request_to_book_decline_reason_type = nil, decline_message_to_guest = nil) ⇒ FunctionsRequestToBook

Returns a new instance of FunctionsRequestToBook.



37
38
39
40
41
42
43
44
45
46
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 37

def initialize(request_to_book_type = nil,
               reservation_id = nil,
               request_to_book_decline_reason_type = nil,
               decline_message_to_guest = nil)
  @request_to_book_type = request_to_book_type
  @request_to_book_decline_reason_type =
    request_to_book_decline_reason_type
  @decline_message_to_guest = decline_message_to_guest
  @reservation_id = reservation_id
end

Instance Attribute Details

#decline_message_to_guestString

Message to guest

Returns:



20
21
22
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 20

def decline_message_to_guest
  @decline_message_to_guest
end

#request_to_book_decline_reason_typeRequestToBookDeclineReasonTypeEnum

Request to book decline Reason type {DATES_NOT_AVAILABLE, NOT_A_GOOD_FIT,WAITING_FOR_BETTER_RESERVATION, NOT_COMFORTABLE }



16
17
18
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 16

def request_to_book_decline_reason_type
  @request_to_book_decline_reason_type
end

#request_to_book_typeRequestToBookTypeEnum

Request to book type DENY



11
12
13
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 11

def request_to_book_type
  @request_to_book_type
end

#reservation_idInteger

Reservation for request to book

Returns:

  • (Integer)


24
25
26
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 24

def reservation_id
  @reservation_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 49

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_to_book_type = hash['requestToBookType']
  reservation_id = hash['reservationId']
  request_to_book_decline_reason_type =
    hash['requestToBookDeclineReasonType']
  decline_message_to_guest = hash['declineMessageToGuest']

  # Create object from extracted values.
  FunctionsRequestToBook.new(request_to_book_type,
                             reservation_id,
                             request_to_book_decline_reason_type,
                             decline_message_to_guest)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
34
35
# File 'lib/asdawqw/models/functions_request_to_book.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_to_book_type'] = 'requestToBookType'
  @_hash['request_to_book_decline_reason_type'] =
    'requestToBookDeclineReasonType'
  @_hash['decline_message_to_guest'] = 'declineMessageToGuest'
  @_hash['reservation_id'] = 'reservationId'
  @_hash
end