<s> from cafe . engine . models . base import BaseModel <EOL> from cloudcafe . openstackcli . common . models . responses import BasePrettyTableResponseModel , BasePrettyTableResponseListModel <EOL> class VolumeResponse ( BasePrettyTableResponseModel ) : <EOL> def __init__ ( <EOL> self , id_ = None , display_name = None , size = None , volume_type = None , <EOL> display_description = None , metadata = None , availability_zone = None , <EOL> snapshot_id = None , attachments = None , created_at = None , status = None ) : <EOL> self . id_ = id_ <EOL> self . display_name = display_name <EOL> self . size = size <EOL> self . volume_type = volume_type <EOL> self . display_description = display_description <EOL> self . metadata = metadata <EOL> self . availability_zone = availability_zone <EOL> self . snapshot_id = snapshot_id <EOL> self . attachments = attachments <EOL> self . created_at = created_at <EOL> self . status = status <EOL> @ classmethod <EOL> def _prettytable_str_to_obj ( cls , prettytable_string ) : <EOL> datatuple = cls . _load_prettytable_string ( prettytable_string ) <EOL> volume_dict = { } <EOL> for datadict in datatuple : <EOL> volume_dict [ datadict [ '<STR_LIT>' ] ] = datadict [ '<STR_LIT>' ] <EOL> kwargs = { <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT:id>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:size>' : volume_dict . get ( '<STR_LIT:size>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : volume_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:status>' : volume_dict . get ( '<STR_LIT:status>' ) } <EOL> return VolumeResponse ( ** kwargs ) <EOL> class _VolumeListItem ( BaseModel ) : <EOL> def __init__ ( <EOL> self , id_ = None , display_name = None , size = None , volume_type = None , <EOL> attached_to = None , status = None , bootable = None ) : <EOL> self . id_ = id_ <EOL> self . display_name = display_name <EOL> self . size = size <EOL> self . volume_type = volume_type <EOL> self . attached_to = attached_to <EOL> self . status = status <EOL> self . bootable = bootable <EOL> class VolumeListResponse ( BasePrettyTableResponseListModel ) : <EOL> @ classmethod <EOL> def _prettytable_str_to_obj ( cls , prettytable_string ) : <EOL> volume_list = VolumeListResponse ( ) <EOL> datatuple = cls . _load_prettytable_string ( prettytable_string ) <EOL> for datadict in datatuple : <EOL> kwargs = { <EOL> '<STR_LIT:status>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:size>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) } <EOL> volume_list . append ( _VolumeListItem ( ** kwargs ) ) <EOL> return volume_list <EOL> class _VolumeTypeListItem ( BaseModel ) : <EOL> def __init__ ( <EOL> self , id_ = None , name = None ) : <EOL> self . id_ = id_ <EOL> self . name = name <EOL> class VolumeTypeListResponse ( BasePrettyTableResponseListModel ) : <EOL> @ classmethod <EOL> def _prettytable_str_to_obj ( cls , prettytable_string ) : <EOL> volume_type_list = VolumeTypeListResponse ( ) <EOL> datatuple = cls . _load_prettytable_string ( prettytable_string ) <EOL> for datadict in datatuple : <EOL> kwargs = { <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:name>' : datadict . get ( '<STR_LIT:Name>' ) } <EOL> volume_type_list . append ( _VolumeTypeListItem ( ** kwargs ) ) <EOL> return volume_type_list <EOL> class SnapshotResponse ( BasePrettyTableResponseModel ) : <EOL> def __init__ ( <EOL> self , id_ = None , created_at = None , display_description = None , <EOL> display_name = None , metadata = None , progress = None , project_id = None , <EOL> size = None , status = None , volume_id = None ) : <EOL> self . id_ = id_ <EOL> self . created_at = created_at <EOL> self . display_description = display_description <EOL> self . display_name = display_name <EOL> self . metadata = metadata <EOL> self . progress = progress <EOL> self . project_id = project_id <EOL> self . size = size <EOL> self . status = status <EOL> self . volume_id = volume_id <EOL> @ classmethod <EOL> def _prettytable_str_to_obj ( cls , prettytable_string ) : <EOL> datatuple = cls . _load_prettytable_string ( prettytable_string ) <EOL> snapshot_dict = { } <EOL> for datadict in datatuple : <EOL> snapshot_dict [ datadict [ '<STR_LIT>' ] ] = datadict [ '<STR_LIT>' ] <EOL> kwargs = { <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT:id>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( <EOL> '<STR_LIT>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( <EOL> '<STR_LIT>' ) , <EOL> '<STR_LIT:size>' : snapshot_dict . get ( '<STR_LIT:size>' ) , <EOL> '<STR_LIT:status>' : snapshot_dict . get ( '<STR_LIT:status>' ) , <EOL> '<STR_LIT>' : snapshot_dict . get ( '<STR_LIT>' ) } <EOL> return SnapshotResponse ( ** kwargs ) <EOL> class _SnapshotListItem ( BaseModel ) : <EOL> def __init__ ( <EOL> self , id_ = None , volume_id = None , status = None , display_name = None , <EOL> size = None ) : <EOL> self . id_ = id_ <EOL> self . volume_id = volume_id <EOL> self . status = status <EOL> self . display_name = display_name <EOL> self . size = size <EOL> class SnapshotListResponse ( BasePrettyTableResponseListModel ) : <EOL> @ classmethod <EOL> def _prettytable_str_to_obj ( cls , prettytable_string ) : <EOL> snapshot_list = SnapshotListResponse ( ) <EOL> datatuple = cls . _load_prettytable_string ( prettytable_string ) <EOL> for datadict in datatuple : <EOL> kwargs = { <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:status>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' : datadict . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:size>' : datadict . get ( '<STR_LIT>' ) } <EOL> snapshot_list . append ( _SnapshotListItem ( ** kwargs ) ) <EOL> return snapshot_list </s>
