1818 RSC_CODE_OBJECT_DOES_NOT_EXIST ,
1919)
2020
21+ # Misc ----
22+
23+
24+ def _not_impl_args_kwargs (args , kwargs ):
25+ return NotImplementedError (
26+ "Additional args and kwargs not supported." f"\n Args: { args } \n Kwargs: { kwargs } "
27+ )
28+
29+
30+ # Bundles ----
31+
2132
2233@dataclass
2334class PinBundleManifestMetadata :
@@ -148,6 +159,7 @@ def put(
148159 rpath ,
149160 recursive = False ,
150161 * args ,
162+ access_type = "acl" ,
151163 deploy = True ,
152164 cls_manifest = PinBundleManifest ,
153165 ** kwargs ,
@@ -160,6 +172,8 @@ def put(
160172 A path to the local bundle directory.
161173 rpath: str
162174 A path to the content where the bundle is being put.
175+ access_type:
176+ Who can use and view this content? Must be one of all, logged_in or acl.
163177 cls_manifest:
164178 If maniest does not exist, a class with an .add_manifest_to_directory()
165179 method.
@@ -168,6 +182,9 @@ def put(
168182
169183 parsed = self .parse_path (rpath )
170184
185+ if len (args ) or len (kwargs ):
186+ raise _not_impl_args_kwargs (args , kwargs )
187+
171188 if recursive is False :
172189 raise NotImplementedError (
173190 "Must set recursive to True in order to put any RSConnect content."
@@ -185,7 +202,7 @@ def put(
185202 # TODO: this could be seen as analogous to mkdir (which gets
186203 # called by pins anyway)
187204 # TODO: hard-coded acl bad?
188- content = self .api .post_content_item (parsed .content , "acl" )
205+ content = self .api .post_content_item (parsed .content , access_type )
189206
190207 # Create bundle (with manifest.json inserted if missing) ----
191208
@@ -265,18 +282,22 @@ def exists(self, path: str, **kwargs) -> bool:
265282 except RsConnectApiMissingContentError :
266283 return False
267284
268- def mkdir (self , path , create_parents = True , ** kwargs ) -> None :
285+ def mkdir (
286+ self , path , create_parents = True , * args , access_type = "acl" , ** kwargs
287+ ) -> None :
269288 parsed = self .parse_path (path )
270289
290+ if len (args ) or len (kwargs ):
291+ raise _not_impl_args_kwargs (args , kwargs )
292+
271293 if not isinstance (parsed , ContentPath ):
272294 raise ValueError (f"Requires path to content, but received: { path } " )
273295
274296 if self .exists (path ):
275297 raise FileExistsError (path )
276298
277299 # TODO: could implement and call makedirs, but seems overkill
278- # TODO: hard-coded "acl"?
279- self .api .post_content_item (parsed .content , "acl" , ** kwargs )
300+ self .api .post_content_item (parsed .content , access_type , ** kwargs )
280301
281302 def info (self , path , ** kwargs ) -> "User | Content | Bundle" :
282303 # TODO: source of fsspec info uses self._parent to check cache?
0 commit comments