geobox 2.1.0__py3-none-any.whl → 2.2.1__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 +491 -574
  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 +35 -35
  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 +88 -454
  20. geobox/aio/{analysis.py → raster_analysis.py} +153 -170
  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 +316 -414
  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 +14 -98
  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 +31 -1
  41. geobox/feature.py +31 -10
  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 +5 -368
  52. geobox/{analysis.py → raster_analysis.py} +108 -128
  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 -110
  62. geobox/version.py +272 -272
  63. geobox/view.py +981 -981
  64. geobox/workflow.py +338 -339
  65. {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/METADATA +15 -1
  66. geobox-2.2.1.dist-info/RECORD +72 -0
  67. geobox-2.1.0.dist-info/RECORD +0 -70
  68. {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/WHEEL +0 -0
  69. {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/licenses/LICENSE +0 -0
  70. {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/top_level.txt +0 -0
geobox/scene.py CHANGED
@@ -1,342 +1,341 @@
1
- from typing import List, Dict, Optional, TYPE_CHECKING, Union
2
- from urllib.parse import urljoin
3
-
4
- from .base import Base
5
-
6
- if TYPE_CHECKING:
7
- from . import GeoboxClient
8
- from .user import User
9
- from .aio import AsyncGeoboxClient
10
- from .aio.scene import Scene as AsyncScene
11
-
12
- class Scene(Base):
13
-
14
- BASE_ENDPOINT = 'scenes/'
15
-
16
- def __init__(self,
17
- api: 'GeoboxClient',
18
- uuid: str,
19
- data: Optional[Dict] = {}):
20
- """
21
- Initialize a Scene instance.
22
-
23
- Args:
24
- api (GeoboxClient): The GeoboxClient instance for making requests.
25
- uuid (str): The unique identifier for the Scene.
26
- data (Dict): The data of the Scene.
27
- """
28
- super().__init__(api, uuid=uuid, data=data)
29
-
30
-
31
- @classmethod
32
- def get_scenes(cls, api: 'GeoboxClient', **kwargs) -> Union[List['Scene'], int]:
33
- """
34
- Get list of scenes with optional filtering and pagination.
35
-
36
- Args:
37
- api (GeoboxClient): The GeoboxClient instance for making requests.
38
-
39
- Keyword Args:
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 scenes. default is False.
49
-
50
- Returns:
51
- List[Scene] | int: A list of scene instances or the total number of scenes.
52
-
53
- Example:
54
- >>> from geobox import GeoboxClient
55
- >>> from geobox.scene import Scene
56
- >>> client = GeoboxClient()
57
- >>> scenes = Scene.get_scenes(client, q="name LIKE '%My scene%'")
58
- or
59
- >>> scenes = client.get_scenes(q="name LIKE '%My scene%'")
60
- """
61
- params = {
62
- 'f': 'json',
63
- 'q': kwargs.get('q'),
64
- 'search': kwargs.get('search'),
65
- 'search_fields': kwargs.get('search_fields'),
66
- 'order_by': kwargs.get('order_by'),
67
- 'return_count': kwargs.get('return_count', False),
68
- 'skip': kwargs.get('skip', 0),
69
- 'limit': kwargs.get('limit', 10),
70
- 'user_id': kwargs.get('user_id'),
71
- 'shared': kwargs.get('shared', False)
72
- }
73
- return super()._get_list(api, cls.BASE_ENDPOINT, params, factory_func=lambda api, item: Scene(api, item['uuid'], item))
74
-
75
-
76
- @classmethod
77
- def create_scene(cls,
78
- api: 'GeoboxClient',
79
- name: str,
80
- display_name: str = None,
81
- description: str = None,
82
- settings: Dict = {},
83
- thumbnail: str = None,
84
- user_id: int = None) -> 'Scene':
85
- """
86
- Create a new scene.
87
-
88
- Args:
89
- api (GeoboxClient): The GeoboxClient instance for making requests.
90
- name (str): The name of the scene.
91
- display_name (str, optional): The display name of the scene.
92
- description (str, optional): The description of the scene.
93
- settings (Dict,optional): The settings of the scene.
94
- thumbnail (str, optional): The thumbnail of the scene.
95
- user_id (int, optional): Specific user. privileges required.
96
-
97
- Returns:
98
- Scene: The newly created scene instance.
99
-
100
- Raises:
101
- ValidationError: If the scene data is invalid.
102
-
103
- Example:
104
- >>> from geobox import GeoboxClient
105
- >>> from geobox.scene import Scene
106
- >>> client = GeoboxClient()
107
- >>> scene = Scene.create_scene(client, name="my_scene")
108
- or
109
- >>> scene = client.create_scene(name="my_scene")
110
- """
111
- data = {
112
- "name": name,
113
- "display_name": display_name,
114
- "description": description,
115
- "settings": settings,
116
- "thumbnail": thumbnail,
117
- "user_id": user_id,
118
- }
119
- return super()._create(api, cls.BASE_ENDPOINT, data, factory_func=lambda api, item: Scene(api, item['uuid'], item))
120
-
121
-
122
- @classmethod
123
- def get_scene(cls, api: 'GeoboxClient', uuid: str, user_id: int = None) -> 'Scene':
124
- """
125
- Get a scene by its UUID.
126
-
127
- Args:
128
- api (GeoboxClient): The GeoboxClient instance for making requests.
129
- uuid (str): The UUID of the scene to get.
130
- user_id (int, optional): Specific user. privileges required.
131
-
132
- Returns:
133
- Scene: The scene object.
134
-
135
- Raises:
136
- NotFoundError: If the scene with the specified UUID is not found.
137
-
138
- Example:
139
- >>> from geobox import GeoboxClient
140
- >>> from geobox.scene import Scene
141
- >>> client = GeoboxClient()
142
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
143
- or
144
- >>> scene = client.get_scene(uuid="12345678-1234-5678-1234-567812345678")
145
- """
146
- params = {
147
- 'f': 'json',
148
- 'user_id': user_id,
149
- }
150
- return super()._get_detail(api, cls.BASE_ENDPOINT, uuid, params, factory_func=lambda api, item: Scene(api, item['uuid'], item))
151
-
152
-
153
- @classmethod
154
- def get_scene_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> Union['Scene', None]:
155
- """
156
- Get a scene by name
157
-
158
- Args:
159
- api (GeoboxClient): The GeoboxClient instance for making requests.
160
- name (str): the name of the scene to get
161
- user_id (int, optional): specific user. privileges required.
162
-
163
- Returns:
164
- Scene | None: returns the scene if a scene matches the given name, else None
165
-
166
- Example:
167
- >>> from geobox import GeoboxClient
168
- >>> from geobox.scene import Scene
169
- >>> client = GeoboxClient()
170
- >>> scene = Scene.get_scene_by_name(client, name='test')
171
- or
172
- >>> scene = client.get_scene_by_name(name='test')
173
- """
174
- scenes = cls.get_scenes(api, q=f"name = '{name}'", user_id=user_id)
175
- if scenes and scenes[0].name == name:
176
- return scenes[0]
177
- else:
178
- return None
179
-
180
-
181
- def update(self, **kwargs) -> Dict:
182
- """
183
- Update the scene.
184
-
185
- Keyword Args:
186
- name (str): The name of the scene.
187
- display_name (str): The display name of the scene.
188
- description (str): The description of the scene.
189
- settings (Dict): The settings of the scene.
190
- thumbnail (str): The thumbnail of the scene.
191
-
192
- Returns:
193
- Dict: The updated scene data.
194
-
195
- Raises:
196
- ApiRequestError: If the API request fails.
197
- ValidationError: If the scene data is invalid.
198
-
199
- Example:
200
- >>> from geobox import GeoboxClient
201
- >>> from geobox.scene import Scene
202
- >>> client = GeoboxClient()
203
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
204
- >>> scene.update(display_name="New Display Name")
205
- """
206
- data = {
207
- "name": kwargs.get('name'),
208
- "display_name": kwargs.get('display_name'),
209
- "description": kwargs.get('description'),
210
- "settings": kwargs.get('settings'),
211
- "thumbnail": kwargs.get('thumbnail')
212
- }
213
- return super()._update(self.endpoint, data)
214
-
215
-
216
- def delete(self) -> None:
217
- """
218
- Delete the scene.
219
-
220
- Returns:
221
- None
222
-
223
- Example:
224
- >>> from geobox import GeoboxClient
225
- >>> from geobox.scene import Scene
226
- >>> client = GeoboxClient()
227
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
228
- >>> scene.delete()
229
- """
230
- super().delete(self.endpoint)
231
-
232
-
233
- @property
234
- def thumbnail(self) -> str:
235
- """
236
- Get the thumbnail URL of the scene.
237
-
238
- Returns:
239
- str: The thumbnail of the scene.
240
-
241
- Example:
242
- >>> from geobox import GeoboxClient
243
- >>> from geobox.scene import Scene
244
- >>> client = GeoboxClient()
245
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
246
- >>> scene.thumbnail
247
- 'https://example.com/thumbnail.png'
248
- """
249
- return super().thumbnail()
250
-
251
-
252
- def share(self, users: List['User']) -> None:
253
- """
254
- Shares the scene with specified users.
255
-
256
- Args:
257
- users (List[User]): The list of user objects to share the scene with.
258
-
259
- Returns:
260
- None
261
-
262
- Example:
263
- >>> from geobox import GeoboxClient
264
- >>> from geobox.scene import Scene
265
- >>> client = GeoboxClient()
266
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
267
- >>> users = client.search_users(search='John')
268
- >>> scene.share(users=users)
269
- """
270
- super()._share(self.endpoint, users)
271
-
272
-
273
- def unshare(self, users: List['User']) -> None:
274
- """
275
- Unshares the scene with specified users.
276
-
277
- Args:
278
- users (List[User]): The list of user objects to unshare the scene with.
279
-
280
- Returns:
281
- None
282
-
283
- Example:
284
- >>> from geobox import GeoboxClient
285
- >>> from geobox.scene import Scene
286
- >>> client = GeoboxClient()
287
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
288
- >>> users = client.search_users(search='John')
289
- >>> scene.unshare(users=users)
290
- """
291
- super()._unshare(self.endpoint, users)
292
-
293
-
294
- def get_shared_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['User']:
295
- """
296
- Retrieves the list of users the scene is shared with.
297
-
298
- Args:
299
- search (str, optional): The search query.
300
- skip (int, optional): The number of users to skip.
301
- limit (int, optional): The maximum number of users to retrieve.
302
-
303
- Returns:
304
- List[User]: The list of shared users.
305
-
306
- Example:
307
- >>> from geobox import GeoboxClient
308
- >>> from geobox.scene import Scene
309
- >>> client = GeoboxClient()
310
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
311
- >>> scene.get_shared_users(search='John', skip=0, limit=10)
312
- """
313
- params = {
314
- 'search': search,
315
- 'skip': skip,
316
- 'limit': limit
317
- }
318
- return super()._get_shared_users(self.endpoint, params)
319
-
320
-
321
- def to_async(self, async_client: 'AsyncGeoboxClient') -> 'AsyncScene':
322
- """
323
- Switch to async version of the scene instance to have access to the async methods
324
-
325
- Args:
326
- async_client (AsyncGeoboxClient): The async version of the GeoboxClient instance for making requests.
327
-
328
- Returns:
329
- geobox.aio.scene.Scene: the async instance of the scene.
330
-
331
- Example:
332
- >>> from geobox import Geoboxclient
333
- >>> from geobox.aio import AsyncGeoboxClient
334
- >>> from geobox.scene import Scene
335
- >>> client = GeoboxClient()
336
- >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
337
- >>> async with AsyncGeoboxClient() as async_client:
338
- >>> async_scene = scene.to_async(async_client)
339
- """
340
- from .aio.scene import Scene as AsyncScene
341
-
342
- return AsyncScene(api=async_client, uuid=self.uuid, data=self.data)
1
+ from typing import List, Dict, Optional, TYPE_CHECKING, Union
2
+ from urllib.parse import urljoin
3
+
4
+ from .base import Base
5
+
6
+ if TYPE_CHECKING:
7
+ from . import GeoboxClient
8
+ from .user import User
9
+ from .aio import AsyncGeoboxClient
10
+ from .aio.scene import AsyncScene
11
+
12
+ class Scene(Base):
13
+
14
+ BASE_ENDPOINT = 'scenes/'
15
+
16
+ def __init__(self,
17
+ api: 'GeoboxClient',
18
+ uuid: str,
19
+ data: Optional[Dict] = {}):
20
+ """
21
+ Initialize a Scene instance.
22
+
23
+ Args:
24
+ api (GeoboxClient): The GeoboxClient instance for making requests.
25
+ uuid (str): The unique identifier for the Scene.
26
+ data (Dict): The data of the Scene.
27
+ """
28
+ super().__init__(api, uuid=uuid, data=data)
29
+
30
+
31
+ @classmethod
32
+ def get_scenes(cls, api: 'GeoboxClient', **kwargs) -> Union[List['Scene'], int]:
33
+ """
34
+ Get list of scenes with optional filtering and pagination.
35
+
36
+ Args:
37
+ api (GeoboxClient): The GeoboxClient instance for making requests.
38
+
39
+ Keyword Args:
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 scenes. default is False.
49
+
50
+ Returns:
51
+ List[Scene] | int: A list of scene instances or the total number of scenes.
52
+
53
+ Example:
54
+ >>> from geobox import GeoboxClient
55
+ >>> from geobox.scene import Scene
56
+ >>> client = GeoboxClient()
57
+ >>> scenes = Scene.get_scenes(client, q="name LIKE '%My scene%'")
58
+ or
59
+ >>> scenes = client.get_scenes(q="name LIKE '%My scene%'")
60
+ """
61
+ params = {
62
+ 'f': 'json',
63
+ 'q': kwargs.get('q'),
64
+ 'search': kwargs.get('search'),
65
+ 'search_fields': kwargs.get('search_fields'),
66
+ 'order_by': kwargs.get('order_by'),
67
+ 'return_count': kwargs.get('return_count', False),
68
+ 'skip': kwargs.get('skip', 0),
69
+ 'limit': kwargs.get('limit', 10),
70
+ 'user_id': kwargs.get('user_id'),
71
+ 'shared': kwargs.get('shared', False)
72
+ }
73
+ return super()._get_list(api, cls.BASE_ENDPOINT, params, factory_func=lambda api, item: Scene(api, item['uuid'], item))
74
+
75
+
76
+ @classmethod
77
+ def create_scene(cls,
78
+ api: 'GeoboxClient',
79
+ name: str,
80
+ display_name: str = None,
81
+ description: str = None,
82
+ settings: Dict = {},
83
+ thumbnail: str = None,
84
+ user_id: int = None) -> 'Scene':
85
+ """
86
+ Create a new scene.
87
+
88
+ Args:
89
+ api (GeoboxClient): The GeoboxClient instance for making requests.
90
+ name (str): The name of the scene.
91
+ display_name (str, optional): The display name of the scene.
92
+ description (str, optional): The description of the scene.
93
+ settings (Dict,optional): The settings of the scene.
94
+ thumbnail (str, optional): The thumbnail of the scene.
95
+ user_id (int, optional): Specific user. privileges required.
96
+
97
+ Returns:
98
+ Scene: The newly created scene instance.
99
+
100
+ Raises:
101
+ ValidationError: If the scene data is invalid.
102
+
103
+ Example:
104
+ >>> from geobox import GeoboxClient
105
+ >>> from geobox.scene import Scene
106
+ >>> client = GeoboxClient()
107
+ >>> scene = Scene.create_scene(client, name="my_scene")
108
+ or
109
+ >>> scene = client.create_scene(name="my_scene")
110
+ """
111
+ data = {
112
+ "name": name,
113
+ "display_name": display_name,
114
+ "description": description,
115
+ "settings": settings,
116
+ "thumbnail": thumbnail,
117
+ "user_id": user_id,
118
+ }
119
+ return super()._create(api, cls.BASE_ENDPOINT, data, factory_func=lambda api, item: Scene(api, item['uuid'], item))
120
+
121
+
122
+ @classmethod
123
+ def get_scene(cls, api: 'GeoboxClient', uuid: str, user_id: int = None) -> 'Scene':
124
+ """
125
+ Get a scene by its UUID.
126
+
127
+ Args:
128
+ api (GeoboxClient): The GeoboxClient instance for making requests.
129
+ uuid (str): The UUID of the scene to get.
130
+ user_id (int, optional): Specific user. privileges required.
131
+
132
+ Returns:
133
+ Scene: The scene object.
134
+
135
+ Raises:
136
+ NotFoundError: If the scene with the specified UUID is not found.
137
+
138
+ Example:
139
+ >>> from geobox import GeoboxClient
140
+ >>> from geobox.scene import Scene
141
+ >>> client = GeoboxClient()
142
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
143
+ or
144
+ >>> scene = client.get_scene(uuid="12345678-1234-5678-1234-567812345678")
145
+ """
146
+ params = {
147
+ 'f': 'json',
148
+ 'user_id': user_id,
149
+ }
150
+ return super()._get_detail(api, cls.BASE_ENDPOINT, uuid, params, factory_func=lambda api, item: Scene(api, item['uuid'], item))
151
+
152
+
153
+ @classmethod
154
+ def get_scene_by_name(cls, api: 'GeoboxClient', name: str, user_id: int = None) -> Union['Scene', None]:
155
+ """
156
+ Get a scene by name
157
+
158
+ Args:
159
+ api (GeoboxClient): The GeoboxClient instance for making requests.
160
+ name (str): the name of the scene to get
161
+ user_id (int, optional): specific user. privileges required.
162
+
163
+ Returns:
164
+ Scene | None: returns the scene if a scene matches the given name, else None
165
+
166
+ Example:
167
+ >>> from geobox import GeoboxClient
168
+ >>> from geobox.scene import Scene
169
+ >>> client = GeoboxClient()
170
+ >>> scene = Scene.get_scene_by_name(client, name='test')
171
+ or
172
+ >>> scene = client.get_scene_by_name(name='test')
173
+ """
174
+ scenes = cls.get_scenes(api, q=f"name = '{name}'", user_id=user_id)
175
+ if scenes and scenes[0].name == name:
176
+ return scenes[0]
177
+ else:
178
+ return None
179
+
180
+
181
+ def update(self, **kwargs) -> Dict:
182
+ """
183
+ Update the scene.
184
+
185
+ Keyword Args:
186
+ name (str): The name of the scene.
187
+ display_name (str): The display name of the scene.
188
+ description (str): The description of the scene.
189
+ settings (Dict): The settings of the scene.
190
+ thumbnail (str): The thumbnail of the scene.
191
+
192
+ Returns:
193
+ Dict: The updated scene data.
194
+
195
+ Raises:
196
+ ApiRequestError: If the API request fails.
197
+ ValidationError: If the scene data is invalid.
198
+
199
+ Example:
200
+ >>> from geobox import GeoboxClient
201
+ >>> from geobox.scene import Scene
202
+ >>> client = GeoboxClient()
203
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
204
+ >>> scene.update(display_name="New Display Name")
205
+ """
206
+ data = {
207
+ "name": kwargs.get('name'),
208
+ "display_name": kwargs.get('display_name'),
209
+ "description": kwargs.get('description'),
210
+ "settings": kwargs.get('settings'),
211
+ "thumbnail": kwargs.get('thumbnail')
212
+ }
213
+ return super()._update(self.endpoint, data)
214
+
215
+
216
+ def delete(self) -> None:
217
+ """
218
+ Delete the scene.
219
+
220
+ Returns:
221
+ None
222
+
223
+ Example:
224
+ >>> from geobox import GeoboxClient
225
+ >>> from geobox.scene import Scene
226
+ >>> client = GeoboxClient()
227
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
228
+ >>> scene.delete()
229
+ """
230
+ super()._delete(self.endpoint)
231
+
232
+
233
+ @property
234
+ def thumbnail(self) -> str:
235
+ """
236
+ Get the thumbnail URL of the scene.
237
+
238
+ Returns:
239
+ str: The thumbnail of the scene.
240
+
241
+ Example:
242
+ >>> from geobox import GeoboxClient
243
+ >>> from geobox.scene import Scene
244
+ >>> client = GeoboxClient()
245
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
246
+ >>> scene.thumbnail
247
+ """
248
+ return super()._thumbnail()
249
+
250
+
251
+ def share(self, users: List['User']) -> None:
252
+ """
253
+ Shares the scene with specified users.
254
+
255
+ Args:
256
+ users (List[User]): The list of user objects to share the scene with.
257
+
258
+ Returns:
259
+ None
260
+
261
+ Example:
262
+ >>> from geobox import GeoboxClient
263
+ >>> from geobox.scene import Scene
264
+ >>> client = GeoboxClient()
265
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
266
+ >>> users = client.search_users(search='John')
267
+ >>> scene.share(users=users)
268
+ """
269
+ super()._share(self.endpoint, users)
270
+
271
+
272
+ def unshare(self, users: List['User']) -> None:
273
+ """
274
+ Unshares the scene with specified users.
275
+
276
+ Args:
277
+ users (List[User]): The list of user objects to unshare the scene with.
278
+
279
+ Returns:
280
+ None
281
+
282
+ Example:
283
+ >>> from geobox import GeoboxClient
284
+ >>> from geobox.scene import Scene
285
+ >>> client = GeoboxClient()
286
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
287
+ >>> users = client.search_users(search='John')
288
+ >>> scene.unshare(users=users)
289
+ """
290
+ super()._unshare(self.endpoint, users)
291
+
292
+
293
+ def get_shared_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['User']:
294
+ """
295
+ Retrieves the list of users the scene is shared with.
296
+
297
+ Args:
298
+ search (str, optional): The search query.
299
+ skip (int, optional): The number of users to skip.
300
+ limit (int, optional): The maximum number of users to retrieve.
301
+
302
+ Returns:
303
+ List[User]: The list of shared users.
304
+
305
+ Example:
306
+ >>> from geobox import GeoboxClient
307
+ >>> from geobox.scene import Scene
308
+ >>> client = GeoboxClient()
309
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
310
+ >>> scene.get_shared_users(search='John', skip=0, limit=10)
311
+ """
312
+ params = {
313
+ 'search': search,
314
+ 'skip': skip,
315
+ 'limit': limit
316
+ }
317
+ return super()._get_shared_users(self.endpoint, params)
318
+
319
+
320
+ def to_async(self, async_client: 'AsyncGeoboxClient') -> 'AsyncScene':
321
+ """
322
+ Switch to async version of the scene instance to have access to the async methods
323
+
324
+ Args:
325
+ async_client (AsyncGeoboxClient): The async version of the GeoboxClient instance for making requests.
326
+
327
+ Returns:
328
+ AsyncScene: the async instance of the scene.
329
+
330
+ Example:
331
+ >>> from geobox import Geoboxclient
332
+ >>> from geobox.aio import AsyncGeoboxClient
333
+ >>> from geobox.scene import Scene
334
+ >>> client = GeoboxClient()
335
+ >>> scene = Scene.get_scene(client, uuid="12345678-1234-5678-1234-567812345678")
336
+ >>> async with AsyncGeoboxClient() as async_client:
337
+ >>> async_scene = scene.to_async(async_client)
338
+ """
339
+ from .aio.scene import AsyncScene
340
+
341
+ return AsyncScene(api=async_client, uuid=self.uuid, data=self.data)