Skip to content

Commit

Permalink
Merge pull request #35 from Qiskit/add-files-methods
Browse files Browse the repository at this point in the history
Add files methods
  • Loading branch information
korgan00 authored Nov 6, 2024
2 parents 868d225 + e7c43ef commit cf6bdef
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions qiskit_ibm_catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,30 @@ def get_job_by_id(self, job_id: str) -> Optional[Job]:
)
return self.job(job_id=job_id)

def files(self, provider: Optional[str] = None) -> List[str]:
"""Returns list of available files produced by programs to download."""
return self._client.files(provider)

def file_download(
self,
file: str,
target_name: Optional[str] = None,
download_location: str = "./",
provider: Optional[str] = None,
):
"""Download file."""
return self._client.file_download(
file, target_name, download_location, provider
)

def file_delete(self, file: str, provider: Optional[str] = None):
"""Deletes file uploaded or produced by the programs,"""
return self._client.file_delete(file, provider)

def file_upload(self, file: str, provider: Optional[str] = None):
"""Upload file."""
return self._client.file_upload(file, provider)

def __repr__(self) -> str:
return "<QiskitFunctionsCatalog>"

Expand Down
24 changes: 24 additions & 0 deletions qiskit_ibm_catalog/serverless.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@ def get_job_by_id(self, job_id: str) -> Optional[Job]:
)
return self.job(job_id=job_id)

def files(self, provider: Optional[str] = None) -> List[str]:
"""Returns list of available files produced by programs to download."""
return self._client.files(provider)

def file_download(
self,
file: str,
target_name: Optional[str] = None,
download_location: str = "./",
provider: Optional[str] = None,
):
"""Download file."""
return self._client.file_download(
file, target_name, download_location, provider
)

def file_delete(self, file: str, provider: Optional[str] = None):
"""Deletes file uploaded or produced by the programs,"""
return self._client.file_delete(file, provider)

def file_upload(self, file: str, provider: Optional[str] = None):
"""Upload file."""
return self._client.file_upload(file, provider)

def __repr__(self) -> str:
return "<QiskitServerless>"

Expand Down

0 comments on commit cf6bdef

Please sign in to comment.