def create_gs_key_async(filename, rpc=None):
 if (not isinstance(filename, basestring)):
  raise TypeError(('filename must be str: %s' % filename))
 if (not filename.startswith(GS_PREFIX)):
  raise ValueError(('filename must start with "/gs/": %s' % filename))
 if (not ('/' in filename[4:])):
  raise ValueError(('filename must have the format "/gs/bucket_name/object_name": %s' % filename))
 request = blobstore_service_pb.CreateEncodedGoogleStorageKeyRequest()
 response = blobstore_service_pb.CreateEncodedGoogleStorageKeyResponse()
 request.set_filename(filename)
 return _make_async_call(rpc, 'CreateEncodedGoogleStorageKey', request, response, _get_result_hook, (lambda rpc: rpc.response.blob_key()))

def create_gs_key_async ( filename , rpc = None ) : if ( not isinstance ( filename , basestring ) ) : raise TypeError ( ( 'filename must be str: %s' % filename ) ) if ( not filename . startswith ( GS_PREFIX ) ) : raise ValueError ( ( 'filename must start with "/gs/": %s' % filename ) ) if ( not ( '/' in filename [ 4 : ] ) ) : raise ValueError ( ( 'filename must have the format "/gs/bucket_name/object_name": %s' % filename ) ) request = blobstore_service_pb . CreateEncodedGoogleStorageKeyRequest ( ) response = blobstore_service_pb . CreateEncodedGoogleStorageKeyResponse ( ) request . set_filename ( filename ) return _make_async_call ( rpc , 'CreateEncodedGoogleStorageKey' , request , response , _get_result_hook , ( lambda rpc : rpc . response . blob_key ( ) ) )
create an encoded key for a google storage file - async version .