Class: Gonebusy::EntitiesBookingResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/gonebusy/models/entities_booking_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id = nil, owner_id = nil, workflow_state = nil, name = nil, time_window = nil, resource_id = nil, service_id = nil, description = nil, external_link = nil, collaborative_link = nil) ⇒ EntitiesBookingResponse

Returns a new instance of EntitiesBookingResponse.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/gonebusy/models/entities_booking_response.rb', line 63

def initialize(id = nil,
               owner_id = nil,
               workflow_state = nil,
               name = nil,
               time_window = nil,
               resource_id = nil,
               service_id = nil,
               description = nil,
               external_link = nil,
               collaborative_link = nil)
  @id = id
  @owner_id = owner_id
  @workflow_state = workflow_state
  @name = name
  @time_window = time_window
  @resource_id = resource_id
  @service_id = service_id
  @description = description
  @external_link = external_link
  @collaborative_link = collaborative_link
end

Instance Attribute Details

video chat or other link associated with Booking, if any

Returns:



43
44
45
# File 'lib/gonebusy/models/entities_booking_response.rb', line 43

def collaborative_link
  @collaborative_link
end

#descriptionString

description for Booking, if any

Returns:



35
36
37
# File 'lib/gonebusy/models/entities_booking_response.rb', line 35

def description
  @description
end

external management link for Booking, if any

Returns:



39
40
41
# File 'lib/gonebusy/models/entities_booking_response.rb', line 39

def external_link
  @external_link
end

#idInteger

id of Booking

Returns:

  • (Integer)


7
8
9
# File 'lib/gonebusy/models/entities_booking_response.rb', line 7

def id
  @id
end

#nameString

name of Booking, if any

Returns:



19
20
21
# File 'lib/gonebusy/models/entities_booking_response.rb', line 19

def name
  @name
end

#owner_idInteger

id of owner of Booking

Returns:

  • (Integer)


11
12
13
# File 'lib/gonebusy/models/entities_booking_response.rb', line 11

def owner_id
  @owner_id
end

#resource_idInteger

id of Resource performing Booking

Returns:

  • (Integer)


27
28
29
# File 'lib/gonebusy/models/entities_booking_response.rb', line 27

def resource_id
  @resource_id
end

#service_idInteger

id of Service booked

Returns:

  • (Integer)


31
32
33
# File 'lib/gonebusy/models/entities_booking_response.rb', line 31

def service_id
  @service_id
end

#time_windowEntitiesTimeWindowResponse

TimeWindow corresponding to Booking



23
24
25
# File 'lib/gonebusy/models/entities_booking_response.rb', line 23

def time_window
  @time_window
end

#workflow_stateString

status of Booking

Returns:



15
16
17
# File 'lib/gonebusy/models/entities_booking_response.rb', line 15

def workflow_state
  @workflow_state
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/gonebusy/models/entities_booking_response.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash
  id = hash['id']
  owner_id = hash['owner_id']
  workflow_state = hash['workflow_state']
  name = hash['name']
  time_window = EntitiesTimeWindowResponse.from_hash(hash['time_window']) if hash['time_window']
  resource_id = hash['resource_id']
  service_id = hash['service_id']
  description = hash['description']
  external_link = hash['external_link']
  collaborative_link = hash['collaborative_link']

  # Create object from extracted values
  EntitiesBookingResponse.new(id,
                              owner_id,
                              workflow_state,
                              name,
                              time_window,
                              resource_id,
                              service_id,
                              description,
                              external_link,
                              collaborative_link)
end

.namesObject

A mapping from model property names to API property names



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/gonebusy/models/entities_booking_response.rb', line 46

def self.names
  if @_hash.nil?
    @_hash = {}
    @_hash["id"] = "id"
    @_hash["owner_id"] = "owner_id"
    @_hash["workflow_state"] = "workflow_state"
    @_hash["name"] = "name"
    @_hash["time_window"] = "time_window"
    @_hash["resource_id"] = "resource_id"
    @_hash["service_id"] = "service_id"
    @_hash["description"] = "description"
    @_hash["external_link"] = "external_link"
    @_hash["collaborative_link"] = "collaborative_link"
  end
  @_hash
end