lib/seatsio/domain.rb in seatsio-18 vs lib/seatsio/domain.rb in seatsio-19
- old
+ new
@@ -155,12 +155,27 @@
@settings = AccountSettings.new(data['settings']) if data['settings'] != nil
end
end
class Subaccount < Account
+ attr_reader :workspace
+
+ def initialize(data)
+ super
+ @workspace = Workspace.new(data['workspace']) if data['workspace'] != nil
+ end
end
+ class Workspace
+ attr_reader :id, :key
+
+ def initialize(data)
+ @id = data['id']
+ @key = data['key']
+ end
+ end
+
class ObjectStatus
FREE = 'free'
BOOKED = 'booked'
HELD = 'reservedByToken'
@@ -187,16 +202,17 @@
end
end
class HoldToken
- attr_reader :hold_token, :expires_at, :expires_in_seconds
+ attr_reader :hold_token, :expires_at, :expires_in_seconds, :workspace_key
def initialize(data)
@hold_token = data['holdToken']
@expires_at = Time.parse(data['expiresAt'])
@expires_in_seconds = data['expiresInSeconds']
+ @workspace_key = data['workspaceKey']
end
end
class BestAvailableObjects
@@ -412,19 +428,22 @@
@year.to_s + "-" + @month.to_s.rjust(2, "0")
end
end
class StatusChange
- attr_reader :extra_data, :object_label, :date, :id, :status, :event_id, :origin
+ attr_reader :extra_data, :object_label, :date, :id, :status, :event_id, :origin, :order_id, :quantity, :hold_token
def initialize(data)
@id = data['id']
@status = data['status']
@date = DateTime.iso8601(data['date'])
@object_label = data['objectLabel']
@event_id = data['eventId']
@extra_data = data['extraData']
@origin = StatusChangeOrigin.new(data['origin'])
+ @order_id = data['orderId']
+ @quantity = data['quantity']
+ @hold_token = data['holdToken']
end
end
class StatusChangeOrigin
attr_reader :type, :ip