<s> from vt_manager . communication . sfa . util . faults import RecordNotFound <EOL> from vt_manager . communication . sfa . util . method import Method <EOL> from vt_manager . communication . sfa . trust . credential import Credential <EOL> from vt_manager . communication . sfa . util . parameter import Parameter , Mixed <EOL> class GetGids ( Method ) : <EOL> """<STR_LIT>""" <EOL> interfaces = [ '<STR_LIT>' ] <EOL> accepts = [ <EOL> Mixed ( Parameter ( str , "<STR_LIT>" ) , <EOL> Parameter ( type ( [ str ] ) , "<STR_LIT>" ) ) , <EOL> Mixed ( Parameter ( str , "<STR_LIT>" ) , <EOL> Parameter ( type ( [ str ] ) , "<STR_LIT>" ) ) , <EOL> ] <EOL> returns = [ Parameter ( dict , "<STR_LIT>" ) ] <EOL> def call ( self , xrns , creds ) : <EOL> valid_creds = self . api . auth . checkCredentials ( creds , '<STR_LIT>' ) <EOL> origin_hrn = Credential ( string = valid_creds [ <NUM_LIT:0> ] ) . get_gid_caller ( ) . get_hrn ( ) <EOL> records = self . api . manager . Resolve ( self . api , xrns , details = False ) <EOL> if not records : <EOL> raise RecordNotFound ( xrns ) <EOL> allowed_fields = [ '<STR_LIT>' , '<STR_LIT:type>' , '<STR_LIT>' ] <EOL> for record in records : <EOL> for key in record . keys ( ) : <EOL> if key not in allowed_fields : <EOL> del ( record [ key ] ) <EOL> return records </s>
