def _translate_snapshot_summary_view(snapshot):
 d = {}
 d['id'] = snapshot['id']
 d['created_at'] = snapshot['created_at']
 d['display_name'] = snapshot['display_name']
 d['display_description'] = snapshot['display_description']
 d['volume_id'] = snapshot['volume_id']
 d['status'] = snapshot['status']
 d['size'] = snapshot['volume_size']
 if (snapshot.get('metadata') and isinstance(snapshot.get('metadata'), dict)):
  d['metadata'] = snapshot['metadata']
 else:
  d['metadata'] = {}
 return d

def _translate_snapshot_summary_view ( snapshot ) : d = { } d [ 'id' ] = snapshot [ 'id' ] d [ 'created_at' ] = snapshot [ 'created_at' ] d [ 'display_name' ] = snapshot [ 'display_name' ] d [ 'display_description' ] = snapshot [ 'display_description' ] d [ 'volume_id' ] = snapshot [ 'volume_id' ] d [ 'status' ] = snapshot [ 'status' ] d [ 'size' ] = snapshot [ 'volume_size' ] if ( snapshot . get ( 'metadata' ) and isinstance ( snapshot . get ( 'metadata' ) , dict ) ) : d [ 'metadata' ] = snapshot [ 'metadata' ] else : d [ 'metadata' ] = { } return d
maps keys for snapshots summary view .