<s> import cassiopeia . type . dto . common <EOL> import cassiopeia . type . core . common <EOL> if cassiopeia . type . dto . common . sqlalchemy_imported : <EOL> import sqlalchemy <EOL> import sqlalchemy . orm <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Shard ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . hostname = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . locales = dictionary . get ( "<STR_LIT>" , [ ] ) <EOL> self . name = dictionary . get ( "<STR_LIT:name>" , "<STR_LIT>" ) <EOL> self . region_tag = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . slug = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Translation ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . content = dictionary . get ( "<STR_LIT:content>" , "<STR_LIT>" ) <EOL> self . locale = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . updated_at = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Message ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . author = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . content = dictionary . get ( "<STR_LIT:content>" , "<STR_LIT>" ) <EOL> self . created_at = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . id = dictionary . get ( "<STR_LIT:id>" , <NUM_LIT:0> ) <EOL> self . severity = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . translations = [ ( Translation ( trans ) if not isinstance ( trans , Translation ) else trans ) for trans in dictionary . get ( "<STR_LIT>" , [ ] ) if trans ] <EOL> self . updated_at = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Incident ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . active = dictionary . get ( "<STR_LIT>" , False ) <EOL> self . created_at = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . id = dictionary . get ( "<STR_LIT:id>" , <NUM_LIT:0> ) <EOL> self . updates = [ ( Message ( msg ) if not isinstance ( msg , Message ) else msg ) for msg in dictionary . get ( "<STR_LIT>" , [ ] ) if msg ] <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Service ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . incidents = [ ( Incident ( inc ) if not isinstance ( inc , Incident ) else inc ) for inc in dictionary . get ( "<STR_LIT>" , [ ] ) if inc ] <EOL> self . name = dictionary . get ( "<STR_LIT:name>" , "<STR_LIT>" ) <EOL> self . slug = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . status = dictionary . get ( "<STR_LIT:status>" , "<STR_LIT>" ) <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class ShardStatus ( cassiopeia . type . dto . common . CassiopeiaDto ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dictionary ) : <EOL> self . hostname = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . locales = dictionary . get ( "<STR_LIT>" , [ ] ) <EOL> self . name = dictionary . get ( "<STR_LIT:name>" , "<STR_LIT>" ) <EOL> self . region_tag = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . services = [ ( Service ( srvc ) if not isinstance ( srvc , Service ) else srvc ) for srvc in dictionary . get ( "<STR_LIT>" , [ ] ) if srvc ] <EOL> self . slug = dictionary . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> def _sa_bind_shard ( ) : <EOL> global Shard <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Shard ( Shard , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> hostname = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:50> ) ) <EOL> locales = sqlalchemy . Column ( cassiopeia . type . dto . common . JSONEncoded ) <EOL> name = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> region_tag = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) , primary_key = True ) <EOL> slug = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> def _sa_bind_translation ( ) : <EOL> global Translation <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Translation ( Translation , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> content = sqlalchemy . Column ( sqlalchemy . Text ) <EOL> locale = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> updated_at = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> _id = sqlalchemy . Column ( sqlalchemy . Integer , primary_key = True ) <EOL> _message_id = sqlalchemy . Column ( sqlalchemy . Integer , sqlalchemy . ForeignKey ( "<STR_LIT>" , ondelete = "<STR_LIT>" ) ) <EOL> def _sa_bind_message ( ) : <EOL> global Message <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Message ( Message , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> author = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> content = sqlalchemy . Column ( sqlalchemy . Text ) <EOL> created_at = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> id = sqlalchemy . Column ( sqlalchemy . Integer , primary_key = True ) <EOL> severity = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> translations = sqlalchemy . orm . relationship ( "<STR_LIT>" , cascade = "<STR_LIT>" , passive_deletes = True ) <EOL> updated_at = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> _incident_id = sqlalchemy . Column ( sqlalchemy . Integer , sqlalchemy . ForeignKey ( "<STR_LIT>" , ondelete = "<STR_LIT>" ) ) <EOL> def _sa_bind_incident ( ) : <EOL> global Incident <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Incident ( Incident , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> active = sqlalchemy . Column ( sqlalchemy . Boolean ) <EOL> created_at = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> id = sqlalchemy . Column ( sqlalchemy . Integer , primary_key = True ) <EOL> updates = sqlalchemy . orm . relationship ( "<STR_LIT>" , cascade = "<STR_LIT>" , passive_deletes = True ) <EOL> _service_id = sqlalchemy . Column ( sqlalchemy . Integer , sqlalchemy . ForeignKey ( "<STR_LIT>" , ondelete = "<STR_LIT>" ) ) <EOL> def _sa_bind_service ( ) : <EOL> global Service <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class Service ( Service , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> incidents = sqlalchemy . orm . relationship ( "<STR_LIT>" , cascade = "<STR_LIT>" , passive_deletes = True ) <EOL> name = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> slug = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> status = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> _id = sqlalchemy . Column ( sqlalchemy . Integer , primary_key = True ) <EOL> _shard_id = sqlalchemy . Column ( sqlalchemy . Integer , sqlalchemy . ForeignKey ( "<STR_LIT>" , ondelete = "<STR_LIT>" ) ) <EOL> def _sa_bind_shard_status ( ) : <EOL> global ShardStatus <EOL> @ cassiopeia . type . core . common . inheritdocs <EOL> class ShardStatus ( ShardStatus , cassiopeia . type . dto . common . BaseDB ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> hostname = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:50> ) ) <EOL> locales = sqlalchemy . Column ( cassiopeia . type . dto . common . JSONEncoded ) <EOL> name = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> region_tag = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> services = sqlalchemy . orm . relationship ( "<STR_LIT>" , cascade = "<STR_LIT>" , passive_deletes = True ) <EOL> slug = sqlalchemy . Column ( sqlalchemy . String ( <NUM_LIT:30> ) ) <EOL> _id = sqlalchemy . Column ( sqlalchemy . Integer , primary_key = True ) <EOL> def _sa_bind_all ( ) : <EOL> _sa_bind_shard ( ) <EOL> _sa_bind_translation ( ) <EOL> _sa_bind_message ( ) <EOL> _sa_bind_incident ( ) <EOL> _sa_bind_service ( ) <EOL> _sa_bind_shard_status ( ) </s>
