class Seatsio::Event

def self.create_list(list = [])

def self.create_list(list = [])
  result = []
  list.each do |item|
    result << Event.from_json(item)
  end
  result
end

def self.from_json(data)

def self.from_json(data)
  if data['isSeason']
    Season.new(data)
  else
    Event.new(data)
  end
end

def initialize(data)

def initialize(data)
  @id = data['id']
  @key = data['key']
  @chart_key = data['chartKey']
  @supports_best_available = data['supportsBestAvailable']
  @table_booking_config = TableBookingConfig::from_json(data['tableBookingConfig'])
  @for_sale_config = ForSaleConfig.new(data['forSaleConfig']) if data['forSaleConfig']
  @created_on = parse_date(data['createdOn'])
  @updated_on = parse_date(data['updatedOn'])
  @channels = data['channels'].map {
    |d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects'])
  } if data['channels']
  @social_distancing_ruleset_key = data['socialDistancingRulesetKey']
  @is_top_level_season = data['isTopLevelSeason']
  @is_partial_season = data['isPartialSeason']
  @is_event_in_season = data['isEventInSeason']
  @top_level_season_key = data['topLevelSeasonKey']
  @object_categories = data['objectCategories']
  @categories = Category.create_list(data['categories']) if data['categories']
end

def is_season

def is_season
  false
end