diff --git a/cs3client/auth.py b/cs3client/auth.py index 7ac13c6..019f025 100644 --- a/cs3client/auth.py +++ b/cs3client/auth.py @@ -76,7 +76,7 @@ def get_token(self) -> tuple[str, str]: if not self._client_secret: self._log.error("Attempted to authenticate, client secret was not set") - raise SecretNotSetException("The client secret (e.g. token, passowrd) is not set") + raise SecretNotSetException("The client secret (e.g. token, password) is not set") try: self.check_token(self._token) diff --git a/cs3client/file.py b/cs3client/file.py index c7e684a..0e1a289 100644 --- a/cs3client/file.py +++ b/cs3client/file.py @@ -690,3 +690,21 @@ def unlock(self, auth_token: tuple, resource: Resource, app_name, lock_id: Union self._status_code_handler.handle_errors(res.status, "unlock", resource.get_file_ref_str()) self._log.debug(f'msg="Invoked Unlock" {resource.get_file_ref_str()} result="{res.status.trace}" ' f'value="{lock_id}"') + + @handle_grpc_error + def get_quota(self, auth_token: tuple, resource: Resource): + """ + Get the quota for a given path + :param auth_token: tuple in the form ('x-access-token', ) (see auth.get_token/auth.check_token) + :param resource: Resource to get the quota for. + :return: The quota for the given resource. + :raises: NotFoundException (File not found) + :raises: AuthenticationException (Authentication Failed) + :raises: UnknownException (Unknown Error) + """ + + get_quota_request = cs3spr.GetQuotaRequest(ref=resource.ref) + res = self._gateway.GetQuota(request=get_quota_request, metadata=[auth_token]) + self._status_code_handler.handle_errors(res.status, "get quota", resource.get_file_ref_str()) + self._log.debug(f'msg="Invoked GetQuota" trace="{res.status.trace}"') + return res \ No newline at end of file diff --git a/cs3client/group.py b/cs3client/group.py index f351598..a6a27c8 100644 --- a/cs3client/group.py +++ b/cs3client/group.py @@ -131,7 +131,8 @@ def create_find_group_filter(cls, filter_type: str, query: Optional[str], group_ Create a filter for finding groups. :param filter_type: The type of filter to create. Supported types: TYPE_GROUPTYPE, TYPE_QUERY. - :param query: The query string for TYPE_QUERY filter, or GROUP_TYPE_FEDERATED/GROUP_TYPE_REGULAR for TYPE_GROUPTYPE. + :param query: The query string for TYPE_QUERY filter. + :param group_type: The group type for the TYPE_GROUPTYPE filter, GROUP_TYPE_FEDERATED or GROUP_TYPE_REGULAR. :return: A filter object. :raises: ValueError (Unsupported filter type) """ diff --git a/cs3client/share.py b/cs3client/share.py index 510d4c2..e06fba3 100644 --- a/cs3client/share.py +++ b/cs3client/share.py @@ -222,7 +222,6 @@ def list_received_existing_shares( ) -> list: """ List received existing shares. - NOTE: Filters for received shares are not yet implemented (14/08/2024) :param auth_token: tuple in the form ('x-access-token', ) (see auth.get_token/auth.check_token) :param filter: Filter object to filter the shares, see create_share_filter. @@ -494,6 +493,9 @@ def remove_public_share(self, auth_token: tuple, token: Optional[str] = None, op :param token: Share token (SEMI-OPTIONAL). :param opaque_id: Opaque share id (SEMI-OPTIONAL). :return: None + :raises: NotFoundException (Share not found) + :raises: AuthenticationException (Operation not permitted) + :raises: UnknownException (Unknown error) :raises: ValueError if token or opaque_id is not provided. """ ref = None