@@ -37,11 +37,41 @@ class ProjectSetting(ProjectSettingSynchronousProtocol):
3737 is supported. Default: ``"upload"``.
3838 locations: The list of storage location IDs for upload. The first ID is the
3939 default upload destination. A project may have at most 10 storage locations.
40+ To obtain a storage location ID, create a
41+ [StorageLocation][synapseclient.models.StorageLocation] and use its
42+ `storage_location_id`. See
43+ [StorageLocationType][synapseclient.models.StorageLocationType] for the
44+ available storage backend types.
4045 concrete_type: (Read Only) The concrete type returned by the Synapse REST API.
4146 etag: (Read Only) Synapse employs an Optimistic Concurrency Control (OCC)
4247 scheme. The etag changes every time the setting is updated; it must be
4348 included on updates.
4449
50+ Example: Creating a project setting from a new storage location:
51+ Create a StorageLocation first, then use its ID when creating the
52+ project setting:
53+
54+ from synapseclient.models import (
55+ ProjectSetting,
56+ StorageLocation,
57+ StorageLocationType,
58+ )
59+
60+ import synapseclient
61+ synapseclient.login()
62+
63+ storage = StorageLocation(
64+ storage_type=StorageLocationType.EXTERNAL_S3,
65+ bucket="my-bucket",
66+ base_key="my/prefix",
67+ ).store()
68+
69+ setting = ProjectSetting(
70+ project_id="syn123",
71+ locations=[storage.storage_location_id],
72+ ).store()
73+ print(f"Created setting ID: {setting.id}")
74+
4575 Example: Creating a project setting:
4676
4777 from synapseclient.models import ProjectSetting
@@ -95,7 +125,11 @@ class ProjectSetting(ProjectSettingSynchronousProtocol):
95125
96126 locations : List [int ] = field (default_factory = list )
97127 """The list of storage location IDs for upload. The first ID is the default upload
98- destination. A project may have at most 10 storage locations."""
128+ destination. A project may have at most 10 storage locations. To obtain a storage
129+ location ID, create a [StorageLocation][synapseclient.models.StorageLocation] and
130+ use its `storage_location_id`. See
131+ [StorageLocationType][synapseclient.models.StorageLocationType] for the available
132+ storage backend types."""
99133
100134 concrete_type : Optional [str ] = field (default = None , compare = False )
101135 """(Read Only) The concrete type returned by the Synapse REST API."""
0 commit comments