77"""
88
99import logging
10+ from typing import Optional
11+
1012import cs3 .sharing .collaboration .v1beta1 .collaboration_api_pb2 as cs3scapi
1113from cs3 .gateway .v1beta1 .gateway_api_pb2_grpc import GatewayAPIStub
1214import cs3 .sharing .collaboration .v1beta1 .resources_pb2 as cs3scr
@@ -87,7 +89,7 @@ def create_share(
8789 return res .share
8890
8991 def list_existing_shares (
90- self , auth_token : tuple , filter_list : list [cs3scr .Filter ] = None , page_size : int = 0 , page_token : str = None
92+ self , auth_token : tuple , filter_list : list [cs3scr .Filter ] = None , page_size : int = 0 , page_token : Optional [ str ] = None
9193 ) -> list [cs3scr .Share ]:
9294 """
9395 List shares based on a filter.
@@ -109,7 +111,7 @@ def list_existing_shares(
109111 )
110112 return (res .share_infos , res .next_page_token )
111113
112- def get_share (self , auth_token : tuple , opaque_id : str = None , share_key : cs3scr .ShareKey = None ) -> cs3scr .Share :
114+ def get_share (self , auth_token : tuple , opaque_id : Optional [ str ] = None , share_key : Optional [ cs3scr .ShareKey ] = None ) -> cs3scr .Share :
113115 """
114116 Get a share by its opaque id or share key (combination of resource_id, grantee and owner),
115117 one of them is required.
@@ -141,7 +143,7 @@ def get_share(self, auth_token: tuple, opaque_id: str = None, share_key: cs3scr.
141143 )
142144 return res .share
143145
144- def remove_share (self , auth_token : tuple , opaque_id : str = None , share_key : cs3scr .ShareKey = None ) -> None :
146+ def remove_share (self , auth_token : tuple , opaque_id : Optional [ str ] = None , share_key : Optional [ cs3scr .ShareKey ] = None ) -> None :
145147 """
146148 Remove a share by its opaque id or share key (combination of resource_id, grantee and owner),
147149 one of them is required.
@@ -175,9 +177,9 @@ def remove_share(self, auth_token: tuple, opaque_id: str = None, share_key: cs3s
175177 def update_share (
176178 self , auth_token : tuple ,
177179 role : str ,
178- opaque_id : str = None ,
179- share_key : cs3scr .ShareKey = None ,
180- display_name : str = None
180+ opaque_id : Optional [ str ] = None ,
181+ share_key : Optional [ cs3scr .ShareKey ] = None ,
182+ display_name : Optional [ str ] = None
181183 ) -> cs3scr .Share :
182184 """
183185 Update a share by its opaque id.
@@ -216,7 +218,7 @@ def update_share(
216218 return res .share
217219
218220 def list_received_existing_shares (
219- self , auth_token : tuple , filter_list : list = None , page_size : int = 0 , page_token : str = None
221+ self , auth_token : tuple , filter_list : Optional [ list ] = None , page_size : int = 0 , page_token : Optional [ str ] = None
220222 ) -> list :
221223 """
222224 List received existing shares.
@@ -240,7 +242,7 @@ def list_received_existing_shares(
240242 return (res .share_infos , res .next_page_token )
241243
242244 def get_received_share (
243- self , auth_token : tuple , opaque_id : str = None , share_key : cs3scr .ShareKey = None
245+ self , auth_token : tuple , opaque_id : Optional [ str ] = None , share_key : Optional [ cs3scr .ShareKey ] = None
244246 ) -> cs3scr .ReceivedShare :
245247 """
246248 Get a received share by its opaque id or share key (combination of resource_id, grantee and owner),
@@ -313,12 +315,12 @@ def create_public_share(
313315 auth_token : tuple ,
314316 resource_info : cs3spr .ResourceInfo ,
315317 role : str ,
316- password : str = None ,
317- expiration : cs3types .Timestamp = None ,
318- description : str = None ,
318+ password : Optional [ str ] = None ,
319+ expiration : Optional [ cs3types .Timestamp ] = None ,
320+ description : Optional [ str ] = None ,
319321 internal : bool = False ,
320322 notify_uploads : bool = False ,
321- notify_uploads_extra_recipients : list = None ,
323+ notify_uploads_extra_recipients : Optional [ list ] = None ,
322324 ) -> cs3slr .PublicShare :
323325 """
324326 Create a public share.
@@ -358,7 +360,7 @@ def create_public_share(
358360 return res .share
359361
360362 def list_existing_public_shares (
361- self , auth_token : tuple , filter_list : list = None , page_size : int = 0 , page_token : str = None , sign : bool = None
363+ self , auth_token : tuple , filter_list : Optional [ list ] = None , page_size : int = 0 , page_token : Optional [ str ] = None , sign : bool = False
362364 ) -> list :
363365 """
364366 List existing public shares.
@@ -385,7 +387,7 @@ def list_existing_public_shares(
385387 return (res .share_infos , res .next_page_token )
386388
387389 def get_public_share (
388- self , auth_token : tuple , opaque_id : str = None , token : str = None , sign : bool = False
390+ self , auth_token : tuple , opaque_id : Optional [ str ] = None , token : Optional [ str ] = None , sign : bool = False
389391 ) -> cs3slr .PublicShare :
390392 """
391393 Get a public share by its opaque id or token, one of them is required.
@@ -423,14 +425,14 @@ def update_public_share(
423425 auth_token : tuple ,
424426 type : str ,
425427 role : str ,
426- opaque_id : str = None ,
427- token : str = None ,
428- password : str = None ,
429- expiration : cs3types .Timestamp = None ,
430- notify_uploads_extra_recipients : str = None ,
431- description : str = None ,
432- display_name : str = None ,
433- notify_uploads : bool = None ,
428+ opaque_id : Optional [ str ] = None ,
429+ token : Optional [ str ] = None ,
430+ password : Optional [ str ] = None ,
431+ expiration : Optional [ cs3types .Timestamp ] = None ,
432+ notify_uploads_extra_recipients : Optional [ str ] = None ,
433+ description : Optional [ str ] = None ,
434+ display_name : Optional [ str ] = None ,
435+ notify_uploads : bool = False ,
434436 ) -> None :
435437 """
436438 Update a public share by its opaque id or token. (one of them is required), role and type are required,
@@ -486,7 +488,7 @@ def update_public_share(
486488 )
487489 return res .share
488490
489- def remove_public_share (self , auth_token : tuple , token : str = None , opaque_id : str = None ) -> None :
491+ def remove_public_share (self , auth_token : tuple , token : Optional [ str ] = None , opaque_id : Optional [ str ] = None ) -> None :
490492 """
491493 Remove a public share by its token or opaque id, one of them is required.
492494
@@ -520,12 +522,12 @@ def _create_public_share_update(
520522 cls ,
521523 type : str ,
522524 role : str ,
523- password : str = None ,
524- expiration : cs3types .Timestamp = None ,
525- display_name : str = None ,
526- description : str = None ,
527- notify_uploads : bool = None ,
528- notify_uploads_extra_recipients : str = None ,
525+ password : Optional [ str ] = None ,
526+ expiration : Optional [ cs3types .Timestamp ] = None ,
527+ display_name : Optional [ str ] = None ,
528+ description : Optional [ str ] = None ,
529+ notify_uploads : bool = False ,
530+ notify_uploads_extra_recipients : Optional [ str ] = None ,
529531 ) -> cs3slr .PublicShare :
530532 """
531533 Create a public share update object, based on the type the property will be updated,
@@ -567,7 +569,7 @@ def _create_public_share_update(
567569
568570 @classmethod
569571 def _create_share_grant (
570- cls , opaque_id : str , idp : str , role : str , grantee_type : str , expiration : cs3types .Timestamp = None
572+ cls , opaque_id : str , idp : str , role : str , grantee_type : str , expiration : Optional [ cs3types .Timestamp ] = None
571573 ) -> cs3scr .ShareGrant :
572574 """
573575 Create a share grant object.
@@ -643,10 +645,10 @@ def create_public_share_filter(
643645 cls ,
644646 filter_type : str ,
645647 resource_id : cs3spr .ResourceId = None ,
646- owner_idp : str = None ,
647- owner_opaque_id : str = None ,
648- creator_idp : str = None ,
649- creator_opaque_id : str = None ,
648+ owner_idp : Optional [ str ] = None ,
649+ owner_opaque_id : Optional [ str ] = None ,
650+ creator_idp : Optional [ str ] = None ,
651+ creator_opaque_id : Optional [ str ] = None ,
650652 ) -> cs3slapi .ListPublicSharesRequest .Filter :
651653 """
652654 Create a public share filter object, based on the filter type (can be TYPE_RESOURCE_ID, TYPE_OWNER,
@@ -688,13 +690,13 @@ def create_share_filter(
688690 cls ,
689691 filter_type : str ,
690692 resource_id : cs3spr .ResourceId = None ,
691- owner_idp : str = None ,
692- owner_opaque_id : str = None ,
693- creator_idp : str = None ,
694- creator_opaque_id : str = None ,
695- grantee_type : str = None ,
696- space_id : str = None ,
697- share_state : str = None ,
693+ owner_idp : Optional [ str ] = None ,
694+ owner_opaque_id : Optional [ str ] = None ,
695+ creator_idp : Optional [ str ] = None ,
696+ creator_opaque_id : Optional [ str ] = None ,
697+ grantee_type : Optional [ str ] = None ,
698+ space_id : Optional [ str ] = None ,
699+ share_state : Optional [ str ] = None ,
698700 ) -> cs3scr .Filter :
699701 """
700702 Create a share filter object, based on the filter type (can be TYPE_RESOURCE_ID, TYPE_OWNER, TYPE_CREATOR,
0 commit comments