<s> from __future__ import unicode_literals <EOL> from moto . core . utils import camelcase_to_underscores <EOL> class GenericType ( object ) : <EOL> def __init__ ( self , name , version , ** kwargs ) : <EOL> self . name = name <EOL> self . version = version <EOL> self . status = "<STR_LIT>" <EOL> if "<STR_LIT:description>" in kwargs : <EOL> self . description = kwargs . pop ( "<STR_LIT:description>" ) <EOL> for key , value in kwargs . items ( ) : <EOL> self . __setattr__ ( key , value ) <EOL> for key in self . _configuration_keys : <EOL> attr = camelcase_to_underscores ( key ) <EOL> if not hasattr ( self , attr ) : <EOL> self . __setattr__ ( attr , None ) <EOL> if not hasattr ( self , "<STR_LIT>" ) : <EOL> self . task_list = None <EOL> def __repr__ ( self ) : <EOL> cls = self . __class__ . __name__ <EOL> attrs = "<STR_LIT>" % self . __dict__ <EOL> return "<STR_LIT>" . format ( cls , attrs ) <EOL> @ property <EOL> def kind ( self ) : <EOL> raise NotImplementedError ( ) <EOL> @ property <EOL> def _configuration_keys ( self ) : <EOL> raise NotImplementedError ( ) <EOL> def to_short_dict ( self ) : <EOL> return { <EOL> "<STR_LIT:name>" : self . name , <EOL> "<STR_LIT:version>" : self . version , <EOL> } <EOL> def to_medium_dict ( self ) : <EOL> hsh = { <EOL> "<STR_LIT>" . format ( self . kind ) : self . to_short_dict ( ) , <EOL> "<STR_LIT>" : <NUM_LIT> , <EOL> "<STR_LIT:status>" : self . status , <EOL> } <EOL> if self . status == "<STR_LIT>" : <EOL> hsh [ "<STR_LIT>" ] = <NUM_LIT> <EOL> if hasattr ( self , "<STR_LIT:description>" ) : <EOL> hsh [ "<STR_LIT:description>" ] = self . description <EOL> return hsh <EOL> def to_full_dict ( self ) : <EOL> hsh = { <EOL> "<STR_LIT>" : self . to_medium_dict ( ) , <EOL> "<STR_LIT>" : { } <EOL> } <EOL> if self . task_list : <EOL> hsh [ "<STR_LIT>" ] [ "<STR_LIT>" ] = { "<STR_LIT:name>" : self . task_list } <EOL> for key in self . _configuration_keys : <EOL> attr = camelcase_to_underscores ( key ) <EOL> if not getattr ( self , attr ) : <EOL> continue <EOL> hsh [ "<STR_LIT>" ] [ key ] = getattr ( self , attr ) <EOL> return hsh </s>
