lib/seatsio/domain.rb in seatsio-22 vs lib/seatsio/domain.rb in seatsio-23
- old
+ new
@@ -116,55 +116,23 @@
@previous_page_ends_before = data.fetch('previous_page_ends_before', nil).to_i
@items = data.fetch('items', [])
end
end
- class ChartValidationSettings
- attr_reader :validate_duplicate_labels, :validate_objects_without_categories,
- :validate_unlabeled_objects
+ class Subaccount
+ attr_reader :id, :secret_key, :designer_key, :public_key, :name, :active
def initialize(data)
- @validate_duplicate_labels = data['VALIDATE_DUPLICATE_LABELS']
- @validate_objects_without_categories = data['VALIDATE_OBJECTS_WITHOUT_CATEGORIES']
- @validate_unlabeled_objects = data['VALIDATE_UNLABELED_OBJECTS']
- end
- end
-
- class AccountSettings
- attr_reader :draft_chart_drawings_enabled, :hold_on_select_for_gas, :chart_validation
-
- def initialize(data)
- @draft_chart_drawings_enabled = data['draftChartDrawingsEnabled']
- @hold_on_select_for_gas = data['holdOnSelectForGAs']
- @chart_validation = ChartValidationSettings.new(data['chartValidation'])
- end
- end
-
- class Account
- attr_reader :id, :secret_key, :designer_key, :name,
- :email, :active, :settings
-
- def initialize(data)
@id = data['id']
+ @public_key = data['publicKey']
@secret_key = data['secretKey']
@designer_key = data['designerKey']
@name = data['name']
- @email = data['email']
@active = data['active']
- @settings = AccountSettings.new(data['settings']) if data['settings'] != nil
end
end
- class Subaccount < Account
- attr_reader :public_key, :workspace
-
- def initialize(data)
- super
- @public_key = data['publicKey']
- end
- end
-
class Workspace
attr_reader :id, :name, :key, :secret_key, :is_test
def initialize(data)
@id = data['id']
@@ -201,10 +169,19 @@
def initialize(data)
@objects = Seatsio::Domain.to_object_details(data['objects']);
end
end
+ class ChangeObjectStatusInBatchResult
+
+ attr_reader :results
+
+ def initialize(data)
+ @results = data['results'].map { |r| ChangeObjectStatusResult.new(r) }
+ end
+ end
+
class HoldToken
attr_reader :hold_token, :expires_at, :expires_in_seconds, :workspace_key
def initialize(data)
@@ -336,11 +313,11 @@
attr_reader :subaccount
def initialize(data)
@subaccount = data['subaccount'] ? UsageSubaccount.new(data['subaccount']) : nil
- @usage_by_chart = data['usageByChart'].map {|usage| UsageByChart.new(usage)}
+ @usage_by_chart = data['usageByChart'].map { |usage| UsageByChart.new(usage) }
end
end
class UsageSubaccount
@@ -354,11 +331,11 @@
class UsageByChart
attr_reader :chart, :usage_by_event
def initialize(data)
- @chart = data['chart'] ? UsageChart.new(data['chart']) : nil
- @usage_by_event = data['usageByEvent'].map {|usage| UsageByEvent.new(usage)}
+ @chart = data['chart'] ? UsageChart.new(data['chart']) : nil
+ @usage_by_event = data['usageByEvent'].map { |usage| UsageByEvent.new(usage) }
end
end
class UsageChart