async def ls_single( self, container: FileContainer, path: str ) -> List[FileEntryInfo]: response = await self.stub.ls( LsRequest(path=path, container=file_container_to_grpc(container)) ) return [FileEntryInfo(path=file.path) for file in response.files]
async def ls(self, container: FileContainer, path: str) -> List[FileEntryInfo]: response = await self.stub.ls( LsRequest( bundle_id=file_container_to_bundle_id_deprecated(container), path=path, container=file_container_to_grpc(container), )) return [FileEntryInfo(path=file.path) for file in response.files]
async def ls(self, container: FileContainer, paths: List[str]) -> List[FileListing]: response = await self.stub.ls( LsRequest(paths=paths, container=file_container_to_grpc(container)) ) return [ FileListing( parent=listing.parent.path, entries=[FileEntryInfo(path=entry.path) for entry in listing.files], ) for listing in response.listings ]
async def ls(self, bundle_id: str, path: str) -> List[FileEntryInfo]: async with self.get_stub() as stub: response = await stub.ls(LsRequest(bundle_id=bundle_id, path=path)) return [FileEntryInfo(path=file.path) for file in response.files]
async def client( client: CompanionClient, bundle_id: str, path: str ) -> List[FileEntryInfo]: response = await client.stub.ls(LsRequest(bundle_id=bundle_id, path=path)) return [FileEntryInfo(path=file.path) for file in response.files]