geobox 2.0.1__py3-none-any.whl → 2.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. geobox/__init__.py +61 -63
  2. geobox/aio/__init__.py +61 -63
  3. geobox/aio/api.py +489 -473
  4. geobox/aio/apikey.py +263 -263
  5. geobox/aio/attachment.py +341 -339
  6. geobox/aio/base.py +261 -262
  7. geobox/aio/basemap.py +196 -196
  8. geobox/aio/dashboard.py +340 -342
  9. geobox/aio/feature.py +23 -33
  10. geobox/aio/field.py +315 -321
  11. geobox/aio/file.py +72 -72
  12. geobox/aio/layout.py +340 -341
  13. geobox/aio/log.py +23 -23
  14. geobox/aio/map.py +1033 -1034
  15. geobox/aio/model3d.py +415 -415
  16. geobox/aio/mosaic.py +696 -696
  17. geobox/aio/plan.py +314 -314
  18. geobox/aio/query.py +693 -693
  19. geobox/aio/raster.py +907 -869
  20. geobox/aio/raster_analysis.py +740 -0
  21. geobox/aio/route.py +4 -4
  22. geobox/aio/scene.py +340 -342
  23. geobox/aio/settings.py +18 -18
  24. geobox/aio/task.py +404 -402
  25. geobox/aio/tile3d.py +337 -339
  26. geobox/aio/tileset.py +102 -103
  27. geobox/aio/usage.py +52 -51
  28. geobox/aio/user.py +506 -507
  29. geobox/aio/vector_tool.py +1968 -0
  30. geobox/aio/vectorlayer.py +315 -306
  31. geobox/aio/version.py +272 -273
  32. geobox/aio/view.py +1019 -983
  33. geobox/aio/workflow.py +340 -341
  34. geobox/api.py +18 -2
  35. geobox/apikey.py +262 -262
  36. geobox/attachment.py +336 -337
  37. geobox/base.py +384 -384
  38. geobox/basemap.py +194 -194
  39. geobox/dashboard.py +339 -341
  40. geobox/enums.py +432 -348
  41. geobox/feature.py +5 -5
  42. geobox/field.py +320 -320
  43. geobox/file.py +4 -4
  44. geobox/layout.py +339 -340
  45. geobox/log.py +4 -4
  46. geobox/map.py +1031 -1032
  47. geobox/model3d.py +410 -410
  48. geobox/mosaic.py +696 -696
  49. geobox/plan.py +313 -313
  50. geobox/query.py +691 -691
  51. geobox/raster.py +907 -863
  52. geobox/raster_analysis.py +737 -0
  53. geobox/scene.py +341 -342
  54. geobox/settings.py +194 -194
  55. geobox/task.py +399 -400
  56. geobox/tile3d.py +337 -338
  57. geobox/tileset.py +4 -4
  58. geobox/usage.py +3 -3
  59. geobox/user.py +503 -503
  60. geobox/vector_tool.py +1968 -0
  61. geobox/vectorlayer.py +5 -5
  62. geobox/version.py +272 -272
  63. geobox/view.py +981 -981
  64. geobox/workflow.py +338 -339
  65. {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/METADATA +15 -1
  66. geobox-2.2.0.dist-info/RECORD +72 -0
  67. geobox-2.0.1.dist-info/RECORD +0 -68
  68. {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/WHEEL +0 -0
  69. {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/licenses/LICENSE +0 -0
  70. {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/top_level.txt +0 -0
geobox/vectorlayer.py CHANGED
@@ -8,7 +8,7 @@ from .field import Field, FieldType
8
8
  from .feature import Feature
9
9
  from .enums import LayerType
10
10
  from .task import Task
11
- from .enums import InputGeomType, FileOutputFormat
11
+ from .enums import InputGeomType, FileOutputFormat, AnalysisDataType
12
12
  from .version import VectorLayerVersion
13
13
 
14
14
  if TYPE_CHECKING:
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
18
18
  from .file import File
19
19
  from .attachment import Attachment
20
20
  from .aio import AsyncGeoboxClient
21
- from .aio.vectorlayer import VectorLayer as AsyncVectorLayer
21
+ from .aio.vectorlayer import AsyncVectorLayer
22
22
 
23
23
 
24
24
  class VectorLayer(Base):
@@ -333,7 +333,7 @@ class VectorLayer(Base):
333
333
  >>> layer = VectorLayer.get_vector(api=client, uuid="12345678-1234-5678-1234-567812345678")
334
334
  >>> layer.delete()
335
335
  """
336
- super().delete(endpoint=self.endpoint)
336
+ super()._delete(endpoint=self.endpoint)
337
337
 
338
338
 
339
339
  def make_permanent(self) -> None:
@@ -1347,7 +1347,7 @@ class VectorLayer(Base):
1347
1347
  async_client (AsyncGeoboxClient): The async version of the GeoboxClient instance for making requests.
1348
1348
 
1349
1349
  Returns:
1350
- geobox.aio.vectorlayer.VectorLayer: the async instance of the vector layer.
1350
+ AsyncVectorLayer: the async instance of the vector layer.
1351
1351
 
1352
1352
  Example:
1353
1353
  >>> from geobox import Geoboxclient
@@ -1358,6 +1358,6 @@ class VectorLayer(Base):
1358
1358
  >>> async with AsyncGeoboxClient() as async_client:
1359
1359
  >>> async_layer = layer.to_async(async_client)
1360
1360
  """
1361
- from .aio.vectorlayer import VectorLayer as AsyncVectorLayer
1361
+ from .aio.vectorlayer import AsyncVectorLayer
1362
1362
 
1363
1363
  return AsyncVectorLayer(api=async_client, uuid=self.uuid, layer_type=self.layer_type, data=self.data)
geobox/version.py CHANGED
@@ -1,273 +1,273 @@
1
- from typing import TYPE_CHECKING, Dict, List, Optional, Union
2
-
3
- from .base import Base
4
-
5
- if TYPE_CHECKING:
6
- from .api import GeoboxClient
7
- from .user import User
8
- from .aio import AsyncGeoboxClient
9
- from .aio.version import VectorLayerVersion as AsyncVectorLayerVersion
10
-
11
- class VectorLayerVersion(Base):
12
-
13
- BASE_ENDPOINT = 'vectorLayerVersions/'
14
-
15
- def __init__(self,
16
- api: 'GeoboxClient',
17
- uuid: str,
18
- data: Optional[Dict] = {}):
19
- """
20
- Initialize a vector layer version instance.
21
-
22
- Args:
23
- api (GeoboxClient): The GeoboxClient instance for making requests.
24
- uuid (str): The unique identifier for the version.
25
- data (Dict): The data of the version.
26
- """
27
- super().__init__(api, uuid=uuid, data=data)
28
-
29
-
30
- @classmethod
31
- def get_versions(cls, api: 'GeoboxClient', **kwargs) -> Union[List['VectorLayerVersion'], int]:
32
- """
33
- Get list of versions with optional filtering and pagination.
34
-
35
- Args:
36
- api (GeoboxClient): The GeoboxClient instance for making requests.
37
-
38
- Keyword Args:
39
- layer_id (str): the id of the vector layer.
40
- q (str): query filter based on OGC CQL standard. e.g. "field1 LIKE '%GIS%' AND created_at > '2021-01-01'"
41
- search (str): search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value. NOTE: if q param is defined this param will be ignored.
42
- search_fields (str): comma separated list of fields for searching.
43
- order_by (str): comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D. NOTE: "A" denotes ascending order and "D" denotes descending order.
44
- return_count (bool): Whether to return total count. default is False.
45
- skip (int): Number of items to skip. default is 0.
46
- limit (int): Number of items to return. default is 10.
47
- user_id (int): Specific user. privileges required.
48
- shared (bool): Whether to return shared versions. default is False.
49
-
50
- Returns:
51
- List[VectorLayerVersion] | int: A list of vector layer version instances or the total number of versions.
52
-
53
- Example:
54
- >>> from geobox import GeoboxClient
55
- >>> from geobox.version import VectorLayerVersion
56
- >>> client = GeoboxClient()
57
- >>> versions = VectorLayerVersion.get_versions(client, q="name LIKE '%My version%'")
58
- or
59
- >>> versions = client.get_versions(q="name LIKE '%My version%'")
60
- """
61
- params = {
62
- 'layer_id': kwargs.get('layer_id'),
63
- 'f': 'json',
64
- 'q': kwargs.get('q'),
65
- 'search': kwargs.get('search'),
66
- 'search_fields': kwargs.get('search_fields'),
67
- 'order_by': kwargs.get('order_by'),
68
- 'return_count': kwargs.get('return_count', False),
69
- 'skip': kwargs.get('skip', 0),
70
- 'limit': kwargs.get('limit', 10),
71
- 'user_id': kwargs.get('user_id'),
72
- 'shared': kwargs.get('shared', False)
73
- }
74
- return super()._get_list(api, cls.BASE_ENDPOINT, params, factory_func=lambda api, item: VectorLayerVersion(api, item['uuid'], item))
75
-
76
-
77
- @classmethod
78
- def get_version(cls, api: 'GeoboxClient', uuid: str, user_id: int = None) -> 'VectorLayerVersion':
79
- """
80
- Get a version by its UUID.
81
-
82
- Args:
83
- api (GeoboxClient): The GeoboxClient instance for making requests.
84
- uuid (str): The UUID of the version to get.
85
- user_id (int, optional): Specific user. privileges required.
86
-
87
- Returns:
88
- VectorLayerVersion: The vector layer version object.
89
-
90
- Raises:
91
- NotFoundError: If the version with the specified UUID is not found.
92
-
93
- Example:
94
- >>> from geobox import GeoboxClient
95
- >>> from geobox.version import VectorLayerVersion
96
- >>> client = GeoboxClient()
97
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
98
- or
99
- >>> version = client.get_version(uuid="12345678-1234-5678-1234-567812345678")
100
- """
101
- params = {
102
- 'f': 'json',
103
- 'user_id': user_id,
104
- }
105
- return super()._get_detail(api, cls.BASE_ENDPOINT, uuid, params, factory_func=lambda api, item: VectorLayerVersion(api, item['uuid'], item))
106
-
107
-
108
- @classmethod
109
- def get_version_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> 'VectorLayerVersion':
110
- """
111
- Get a version by name
112
-
113
- Args:
114
- api (GeoboxClient): The GeoboxClient instance for making requests.
115
- name (str): the name of the version to get
116
- user_id (int, optional): specific user. privileges required.
117
-
118
- Returns:
119
- VectorLayerVersion | None: returns the version if a version matches the given name, else None
120
-
121
- Example:
122
- >>> from geobox import GeoboxClient
123
- >>> from geobox.version import VectorLayerVersion
124
- >>> client = GeoboxClient()
125
- >>> version = VectorLayerView.get_version_by_name(client, name='test')
126
- or
127
- >>> version = client.get_version_by_name(name='test')
128
- """
129
- versions = cls.get_versions(api, q=f"name = '{name}'", user_id=user_id)
130
- if versions and versions[0].name == name:
131
- return versions[0]
132
- else:
133
- return None
134
-
135
-
136
- def update(self, **kwargs) -> Dict:
137
- """
138
- Update the version.
139
-
140
- Args:
141
- name (str): The name of the version.
142
- display_name (str): The display name of the version.
143
- description (str): The description of the version.
144
-
145
- Returns:
146
- Dict: The updated version data.
147
-
148
- Raises:
149
- ValidationError: If the version data is invalid.
150
-
151
- Example:
152
- >>> from geobox import GeoboxClient
153
- >>> from geobox.version import VectorLayerVersion
154
- >>> client = GeoboxClient()
155
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
156
- >>> version.update_version(display_name="New Display Name")
157
- """
158
- data = {
159
- "name": kwargs.get('name'),
160
- "display_name": kwargs.get('display_name'),
161
- "description": kwargs.get('description'),
162
- }
163
- return super()._update(self.endpoint, data)
164
-
165
-
166
- def delete(self) -> None:
167
- """
168
- Delete the version.
169
-
170
- Returns:
171
- None
172
-
173
- Example:
174
- >>> from geobox import GeoboxClient
175
- >>> from geobox.version import VectorLayerVersion
176
- >>> client = GeoboxClient()
177
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
178
- >>> version.delete()
179
- """
180
- super().delete(self.endpoint)
181
-
182
-
183
- def share(self, users: List['User']) -> None:
184
- """
185
- Shares the version with specified users.
186
-
187
- Args:
188
- users (List[User]): The list of user objects to share the version with.
189
-
190
- Returns:
191
- None
192
-
193
- Example:
194
- >>> from geobox import GeoboxClient
195
- >>> from geobox.version import VectorLayerVersion
196
- >>> client = GeoboxClient()
197
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
198
- >>> users = client.search_users(search='John')
199
- >>> version.share(users=users)
200
- """
201
- super()._share(self.endpoint, users)
202
-
203
-
204
- def unshare(self, users: List['User']) -> None:
205
- """
206
- Unshares the version with specified users.
207
-
208
- Args:
209
- users (List[User]): The list of user objects to unshare the version with.
210
-
211
- Returns:
212
- None
213
-
214
- Example:
215
- >>> from geobox import GeoboxClient
216
- >>> from geobox.version import VectorLayerVersion
217
- >>> client = GeoboxClient()
218
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
219
- >>> users = client.search_users(search='John')
220
- >>> version.unshare(users=users)
221
- """
222
- super()._unshare(self.endpoint, users)
223
-
224
-
225
- def get_shared_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['User']:
226
- """
227
- Retrieves the list of users the version is shared with.
228
-
229
- Args:
230
- search (str, optional): The search query.
231
- skip (int, optional): The number of users to skip.
232
- limit (int, optional): The maximum number of users to retrieve.
233
-
234
- Returns:
235
- List[User]: The list of shared users.
236
-
237
- Example:
238
- >>> from geobox import GeoboxClient
239
- >>> from geobox.version import VectorLayerVersion
240
- >>> client = GeoboxClient()
241
- >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
242
- >>> version.get_shared_users(search='John', skip=0, limit=10)
243
- """
244
- params = {
245
- 'search': search,
246
- 'skip': skip,
247
- 'limit': limit
248
- }
249
- return super()._get_shared_users(self.endpoint, params)
250
-
251
-
252
- def to_async(self, async_client: 'AsyncGeoboxClient') -> 'AsyncVectorLayerVersion':
253
- """
254
- Switch to async version of the version instance to have access to the async methods
255
-
256
- Args:
257
- async_client (AsyncGeoboxClient): The async version of the GeoboxClient instance for making requests.
258
-
259
- Returns:
260
- geobox.aio.version.VectorLayerVersion: the async instance of the version.
261
-
262
- Example:
263
- >>> from geobox import Geoboxclient
264
- >>> from geobox.aio import AsyncGeoboxClient
265
- >>> from geobox.version import VectorLayerversion
266
- >>> client = GeoboxClient()
267
- >>> version = VectorLayerversion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
268
- >>> async with AsyncGeoboxClient() as async_client:
269
- >>> async_version = version.to_async(async_client)
270
- """
271
- from .aio.version import VectorLayerVersion as AsyncVectorLayerVersion
272
-
1
+ from typing import TYPE_CHECKING, Dict, List, Optional, Union
2
+
3
+ from .base import Base
4
+
5
+ if TYPE_CHECKING:
6
+ from .api import GeoboxClient
7
+ from .user import User
8
+ from .aio import AsyncGeoboxClient
9
+ from .aio.version import VectorLayerVersion as AsyncVectorLayerVersion
10
+
11
+ class VectorLayerVersion(Base):
12
+
13
+ BASE_ENDPOINT = 'vectorLayerVersions/'
14
+
15
+ def __init__(self,
16
+ api: 'GeoboxClient',
17
+ uuid: str,
18
+ data: Optional[Dict] = {}):
19
+ """
20
+ Initialize a vector layer version instance.
21
+
22
+ Args:
23
+ api (GeoboxClient): The GeoboxClient instance for making requests.
24
+ uuid (str): The unique identifier for the version.
25
+ data (Dict): The data of the version.
26
+ """
27
+ super().__init__(api, uuid=uuid, data=data)
28
+
29
+
30
+ @classmethod
31
+ def get_versions(cls, api: 'GeoboxClient', **kwargs) -> Union[List['VectorLayerVersion'], int]:
32
+ """
33
+ Get list of versions with optional filtering and pagination.
34
+
35
+ Args:
36
+ api (GeoboxClient): The GeoboxClient instance for making requests.
37
+
38
+ Keyword Args:
39
+ layer_id (str): the id of the vector layer.
40
+ q (str): query filter based on OGC CQL standard. e.g. "field1 LIKE '%GIS%' AND created_at > '2021-01-01'"
41
+ search (str): search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value. NOTE: if q param is defined this param will be ignored.
42
+ search_fields (str): comma separated list of fields for searching.
43
+ order_by (str): comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D. NOTE: "A" denotes ascending order and "D" denotes descending order.
44
+ return_count (bool): Whether to return total count. default is False.
45
+ skip (int): Number of items to skip. default is 0.
46
+ limit (int): Number of items to return. default is 10.
47
+ user_id (int): Specific user. privileges required.
48
+ shared (bool): Whether to return shared versions. default is False.
49
+
50
+ Returns:
51
+ List[VectorLayerVersion] | int: A list of vector layer version instances or the total number of versions.
52
+
53
+ Example:
54
+ >>> from geobox import GeoboxClient
55
+ >>> from geobox.version import VectorLayerVersion
56
+ >>> client = GeoboxClient()
57
+ >>> versions = VectorLayerVersion.get_versions(client, q="name LIKE '%My version%'")
58
+ or
59
+ >>> versions = client.get_versions(q="name LIKE '%My version%'")
60
+ """
61
+ params = {
62
+ 'layer_id': kwargs.get('layer_id'),
63
+ 'f': 'json',
64
+ 'q': kwargs.get('q'),
65
+ 'search': kwargs.get('search'),
66
+ 'search_fields': kwargs.get('search_fields'),
67
+ 'order_by': kwargs.get('order_by'),
68
+ 'return_count': kwargs.get('return_count', False),
69
+ 'skip': kwargs.get('skip', 0),
70
+ 'limit': kwargs.get('limit', 10),
71
+ 'user_id': kwargs.get('user_id'),
72
+ 'shared': kwargs.get('shared', False)
73
+ }
74
+ return super()._get_list(api, cls.BASE_ENDPOINT, params, factory_func=lambda api, item: VectorLayerVersion(api, item['uuid'], item))
75
+
76
+
77
+ @classmethod
78
+ def get_version(cls, api: 'GeoboxClient', uuid: str, user_id: int = None) -> 'VectorLayerVersion':
79
+ """
80
+ Get a version by its UUID.
81
+
82
+ Args:
83
+ api (GeoboxClient): The GeoboxClient instance for making requests.
84
+ uuid (str): The UUID of the version to get.
85
+ user_id (int, optional): Specific user. privileges required.
86
+
87
+ Returns:
88
+ VectorLayerVersion: The vector layer version object.
89
+
90
+ Raises:
91
+ NotFoundError: If the version with the specified UUID is not found.
92
+
93
+ Example:
94
+ >>> from geobox import GeoboxClient
95
+ >>> from geobox.version import VectorLayerVersion
96
+ >>> client = GeoboxClient()
97
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
98
+ or
99
+ >>> version = client.get_version(uuid="12345678-1234-5678-1234-567812345678")
100
+ """
101
+ params = {
102
+ 'f': 'json',
103
+ 'user_id': user_id,
104
+ }
105
+ return super()._get_detail(api, cls.BASE_ENDPOINT, uuid, params, factory_func=lambda api, item: VectorLayerVersion(api, item['uuid'], item))
106
+
107
+
108
+ @classmethod
109
+ def get_version_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> 'VectorLayerVersion':
110
+ """
111
+ Get a version by name
112
+
113
+ Args:
114
+ api (GeoboxClient): The GeoboxClient instance for making requests.
115
+ name (str): the name of the version to get
116
+ user_id (int, optional): specific user. privileges required.
117
+
118
+ Returns:
119
+ VectorLayerVersion | None: returns the version if a version matches the given name, else None
120
+
121
+ Example:
122
+ >>> from geobox import GeoboxClient
123
+ >>> from geobox.version import VectorLayerVersion
124
+ >>> client = GeoboxClient()
125
+ >>> version = VectorLayerView.get_version_by_name(client, name='test')
126
+ or
127
+ >>> version = client.get_version_by_name(name='test')
128
+ """
129
+ versions = cls.get_versions(api, q=f"name = '{name}'", user_id=user_id)
130
+ if versions and versions[0].name == name:
131
+ return versions[0]
132
+ else:
133
+ return None
134
+
135
+
136
+ def update(self, **kwargs) -> Dict:
137
+ """
138
+ Update the version.
139
+
140
+ Args:
141
+ name (str): The name of the version.
142
+ display_name (str): The display name of the version.
143
+ description (str): The description of the version.
144
+
145
+ Returns:
146
+ Dict: The updated version data.
147
+
148
+ Raises:
149
+ ValidationError: If the version data is invalid.
150
+
151
+ Example:
152
+ >>> from geobox import GeoboxClient
153
+ >>> from geobox.version import VectorLayerVersion
154
+ >>> client = GeoboxClient()
155
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
156
+ >>> version.update_version(display_name="New Display Name")
157
+ """
158
+ data = {
159
+ "name": kwargs.get('name'),
160
+ "display_name": kwargs.get('display_name'),
161
+ "description": kwargs.get('description'),
162
+ }
163
+ return super()._update(self.endpoint, data)
164
+
165
+
166
+ def delete(self) -> None:
167
+ """
168
+ Delete the version.
169
+
170
+ Returns:
171
+ None
172
+
173
+ Example:
174
+ >>> from geobox import GeoboxClient
175
+ >>> from geobox.version import VectorLayerVersion
176
+ >>> client = GeoboxClient()
177
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
178
+ >>> version.delete()
179
+ """
180
+ super()._delete(self.endpoint)
181
+
182
+
183
+ def share(self, users: List['User']) -> None:
184
+ """
185
+ Shares the version with specified users.
186
+
187
+ Args:
188
+ users (List[User]): The list of user objects to share the version with.
189
+
190
+ Returns:
191
+ None
192
+
193
+ Example:
194
+ >>> from geobox import GeoboxClient
195
+ >>> from geobox.version import VectorLayerVersion
196
+ >>> client = GeoboxClient()
197
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
198
+ >>> users = client.search_users(search='John')
199
+ >>> version.share(users=users)
200
+ """
201
+ super()._share(self.endpoint, users)
202
+
203
+
204
+ def unshare(self, users: List['User']) -> None:
205
+ """
206
+ Unshares the version with specified users.
207
+
208
+ Args:
209
+ users (List[User]): The list of user objects to unshare the version with.
210
+
211
+ Returns:
212
+ None
213
+
214
+ Example:
215
+ >>> from geobox import GeoboxClient
216
+ >>> from geobox.version import VectorLayerVersion
217
+ >>> client = GeoboxClient()
218
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
219
+ >>> users = client.search_users(search='John')
220
+ >>> version.unshare(users=users)
221
+ """
222
+ super()._unshare(self.endpoint, users)
223
+
224
+
225
+ def get_shared_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['User']:
226
+ """
227
+ Retrieves the list of users the version is shared with.
228
+
229
+ Args:
230
+ search (str, optional): The search query.
231
+ skip (int, optional): The number of users to skip.
232
+ limit (int, optional): The maximum number of users to retrieve.
233
+
234
+ Returns:
235
+ List[User]: The list of shared users.
236
+
237
+ Example:
238
+ >>> from geobox import GeoboxClient
239
+ >>> from geobox.version import VectorLayerVersion
240
+ >>> client = GeoboxClient()
241
+ >>> version = VectorLayerVersion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
242
+ >>> version.get_shared_users(search='John', skip=0, limit=10)
243
+ """
244
+ params = {
245
+ 'search': search,
246
+ 'skip': skip,
247
+ 'limit': limit
248
+ }
249
+ return super()._get_shared_users(self.endpoint, params)
250
+
251
+
252
+ def to_async(self, async_client: 'AsyncGeoboxClient') -> 'AsyncVectorLayerVersion':
253
+ """
254
+ Switch to async version of the version instance to have access to the async methods
255
+
256
+ Args:
257
+ async_client (AsyncGeoboxClient): The async version of the GeoboxClient instance for making requests.
258
+
259
+ Returns:
260
+ AsyncVectorLayerVersion: the async instance of the version.
261
+
262
+ Example:
263
+ >>> from geobox import Geoboxclient
264
+ >>> from geobox.aio import AsyncGeoboxClient
265
+ >>> from geobox.version import VectorLayerversion
266
+ >>> client = GeoboxClient()
267
+ >>> version = VectorLayerversion.get_version(client, uuid="12345678-1234-5678-1234-567812345678")
268
+ >>> async with AsyncGeoboxClient() as async_client:
269
+ >>> async_version = version.to_async(async_client)
270
+ """
271
+ from .aio.version import AsyncVectorLayerVersion
272
+
273
273
  return AsyncVectorLayerVersion(api=async_client, uuid=self.uuid, data=self.data)