Skip to content

Commit

Permalink
Add embargo option to create_dandiset()
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Feb 29, 2024
1 parent b4ccbee commit 939cbf1
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,24 @@ def get_dandisets(
):
yield RemoteDandiset.from_data(self, data)

def create_dandiset(self, name: str, metadata: dict[str, Any]) -> RemoteDandiset:
"""Creates a Dandiset with the given name & metadata"""
def create_dandiset(
self, name: str, metadata: dict[str, Any], *, embargo: bool = False
) -> RemoteDandiset:
"""
Creates a Dandiset with the given name & metadata. If ``embargo`` is
`True`, the resulting Dandiset will be embargoed.
.. versionchanged:: 0.61.0
``embargo`` argument added
"""
return RemoteDandiset.from_data(
self, self.post("/dandisets/", json={"name": name, "metadata": metadata})
self,
self.post(
"/dandisets/",
json={"name": name, "metadata": metadata},
params={"embargo": "true" if embargo else "false"},
),
)

def check_schema_version(self, schema_version: str | None = None) -> None:
Expand Down

0 comments on commit 939cbf1

Please sign in to comment.