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.
- geobox/__init__.py +61 -63
- geobox/aio/__init__.py +61 -63
- geobox/aio/api.py +489 -473
- geobox/aio/apikey.py +263 -263
- geobox/aio/attachment.py +341 -339
- geobox/aio/base.py +261 -262
- geobox/aio/basemap.py +196 -196
- geobox/aio/dashboard.py +340 -342
- geobox/aio/feature.py +23 -33
- geobox/aio/field.py +315 -321
- geobox/aio/file.py +72 -72
- geobox/aio/layout.py +340 -341
- geobox/aio/log.py +23 -23
- geobox/aio/map.py +1033 -1034
- geobox/aio/model3d.py +415 -415
- geobox/aio/mosaic.py +696 -696
- geobox/aio/plan.py +314 -314
- geobox/aio/query.py +693 -693
- geobox/aio/raster.py +907 -869
- geobox/aio/raster_analysis.py +740 -0
- geobox/aio/route.py +4 -4
- geobox/aio/scene.py +340 -342
- geobox/aio/settings.py +18 -18
- geobox/aio/task.py +404 -402
- geobox/aio/tile3d.py +337 -339
- geobox/aio/tileset.py +102 -103
- geobox/aio/usage.py +52 -51
- geobox/aio/user.py +506 -507
- geobox/aio/vector_tool.py +1968 -0
- geobox/aio/vectorlayer.py +315 -306
- geobox/aio/version.py +272 -273
- geobox/aio/view.py +1019 -983
- geobox/aio/workflow.py +340 -341
- geobox/api.py +18 -2
- geobox/apikey.py +262 -262
- geobox/attachment.py +336 -337
- geobox/base.py +384 -384
- geobox/basemap.py +194 -194
- geobox/dashboard.py +339 -341
- geobox/enums.py +432 -348
- geobox/feature.py +5 -5
- geobox/field.py +320 -320
- geobox/file.py +4 -4
- geobox/layout.py +339 -340
- geobox/log.py +4 -4
- geobox/map.py +1031 -1032
- geobox/model3d.py +410 -410
- geobox/mosaic.py +696 -696
- geobox/plan.py +313 -313
- geobox/query.py +691 -691
- geobox/raster.py +907 -863
- geobox/raster_analysis.py +737 -0
- geobox/scene.py +341 -342
- geobox/settings.py +194 -194
- geobox/task.py +399 -400
- geobox/tile3d.py +337 -338
- geobox/tileset.py +4 -4
- geobox/usage.py +3 -3
- geobox/user.py +503 -503
- geobox/vector_tool.py +1968 -0
- geobox/vectorlayer.py +5 -5
- geobox/version.py +272 -272
- geobox/view.py +981 -981
- geobox/workflow.py +338 -339
- {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/METADATA +15 -1
- geobox-2.2.0.dist-info/RECORD +72 -0
- geobox-2.0.1.dist-info/RECORD +0 -68
- {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/WHEEL +0 -0
- {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/licenses/LICENSE +0 -0
- {geobox-2.0.1.dist-info → geobox-2.2.0.dist-info}/top_level.txt +0 -0
geobox/aio/api.py
CHANGED
|
@@ -6,33 +6,32 @@ from urllib.parse import urljoin
|
|
|
6
6
|
from typing import Dict, List, Union, Any
|
|
7
7
|
from datetime import datetime
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from .
|
|
11
|
-
from .
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
14
|
-
from .
|
|
15
|
-
from .
|
|
16
|
-
from .
|
|
17
|
-
from .
|
|
18
|
-
from .
|
|
19
|
-
from .
|
|
20
|
-
from .
|
|
21
|
-
from .
|
|
22
|
-
from .
|
|
23
|
-
from .
|
|
24
|
-
from .
|
|
25
|
-
from .
|
|
26
|
-
from .
|
|
27
|
-
from .
|
|
28
|
-
from .
|
|
29
|
-
from .
|
|
30
|
-
from .
|
|
31
|
-
from .
|
|
32
|
-
from .
|
|
33
|
-
from .
|
|
34
|
-
from .
|
|
35
|
-
from .usage import Usage, UsageScale, UsageParam
|
|
9
|
+
from .vectorlayer import AsyncVectorLayer, LayerType
|
|
10
|
+
from .feature import AsyncFeature
|
|
11
|
+
from .file import AsyncFile
|
|
12
|
+
from .task import AsyncTask
|
|
13
|
+
from .view import AsyncVectorLayerView
|
|
14
|
+
from .tileset import AsyncTileset
|
|
15
|
+
from .raster import AsyncRaster
|
|
16
|
+
from .mosaic import AsyncMosaic
|
|
17
|
+
from .model3d import AsyncModel
|
|
18
|
+
from .map import AsyncMap
|
|
19
|
+
from .user import AsyncUser, UserRole, UserStatus, AsyncSession
|
|
20
|
+
from .query import AsyncQuery
|
|
21
|
+
from .workflow import AsyncWorkflow
|
|
22
|
+
from .layout import AsyncLayout
|
|
23
|
+
from .version import AsyncVectorLayerVersion
|
|
24
|
+
from .tile3d import AsyncTile3d
|
|
25
|
+
from .settings import AsyncSystemSettings
|
|
26
|
+
from .scene import AsyncScene
|
|
27
|
+
from .route import AsyncRouting
|
|
28
|
+
from .plan import AsyncPlan
|
|
29
|
+
from .dashboard import AsyncDashboard
|
|
30
|
+
from .basemap import AsyncBasemap
|
|
31
|
+
from .attachment import AsyncAttachment
|
|
32
|
+
from .apikey import AsyncApiKey
|
|
33
|
+
from .log import AsyncLog
|
|
34
|
+
from .usage import AsyncUsage, UsageScale, UsageParam
|
|
36
35
|
from ..exception import AuthenticationError, ApiRequestError, NotFoundError, ValidationError, ServerError, AuthorizationError
|
|
37
36
|
from ..utils import join_url_params
|
|
38
37
|
|
|
@@ -116,17 +115,17 @@ class AsyncRequestSession:
|
|
|
116
115
|
return original_content_type
|
|
117
116
|
|
|
118
117
|
|
|
119
|
-
class AsyncGeoboxClient
|
|
118
|
+
class AsyncGeoboxClient:
|
|
120
119
|
"""
|
|
121
120
|
An async class to interact with the Geobox API.
|
|
122
121
|
"""
|
|
123
122
|
def __init__(self,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
host: str = 'https://api.geobox.ir',
|
|
124
|
+
ver: str = 'v1/',
|
|
125
|
+
username: str = None,
|
|
126
|
+
password: str = None,
|
|
127
|
+
access_token: str = None,
|
|
128
|
+
apikey: str = None):
|
|
130
129
|
"""
|
|
131
130
|
Constructs all the necessary attributes for the Api object.
|
|
132
131
|
"""
|
|
@@ -436,7 +435,21 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
436
435
|
return await self._make_request(HttpMethods.DELETE, endpoint, payload, is_json)
|
|
437
436
|
|
|
438
437
|
|
|
439
|
-
|
|
438
|
+
@property
|
|
439
|
+
def raster_analysis(self):
|
|
440
|
+
from .raster_analysis import AsyncRasterAnalysis
|
|
441
|
+
|
|
442
|
+
return AsyncRasterAnalysis(self)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def vector_tool(self):
|
|
447
|
+
from .vector_tool import AsyncVectorTool
|
|
448
|
+
|
|
449
|
+
return AsyncVectorTool(self)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
async def get_vectors(self, **kwargs) -> Union[List['AsyncVectorLayer'], int]:
|
|
440
453
|
"""
|
|
441
454
|
[async] Get a list of vector layers with optional filtering and pagination.
|
|
442
455
|
|
|
@@ -454,24 +467,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
454
467
|
shared (bool): Whether to return shared layers. default is False.
|
|
455
468
|
|
|
456
469
|
Returns:
|
|
457
|
-
List[
|
|
470
|
+
List[AsyncVectorLayer] | int: A list of VectorLayer instances or the layers count if return_count is True.
|
|
458
471
|
|
|
459
472
|
Example:
|
|
460
473
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
461
474
|
>>> async with AsyncGeoboxClient() as client:
|
|
462
475
|
>>> layers = await client.get_vectors(include_settings=True,
|
|
463
|
-
...
|
|
464
|
-
...
|
|
465
|
-
...
|
|
466
|
-
...
|
|
467
|
-
...
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
"""
|
|
471
|
-
return await
|
|
476
|
+
... skip=0,
|
|
477
|
+
... limit=100,
|
|
478
|
+
... return_count=False,
|
|
479
|
+
... search="my_layer",
|
|
480
|
+
... search_fields="name, description",
|
|
481
|
+
... order_by="name",
|
|
482
|
+
... shared=True)
|
|
483
|
+
"""
|
|
484
|
+
return await AsyncVectorLayer.get_vectors(self, **kwargs)
|
|
472
485
|
|
|
473
486
|
|
|
474
|
-
async def get_vector(self, uuid: str, user_id: int = None) -> '
|
|
487
|
+
async def get_vector(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayer':
|
|
475
488
|
"""
|
|
476
489
|
[async] Get a specific vector layer by its UUID.
|
|
477
490
|
|
|
@@ -490,10 +503,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
490
503
|
>>> async with AsyncGeoboxClient() as client:
|
|
491
504
|
>>> layer = await client.get_vector(uuid="12345678-1234-5678-1234-567812345678")
|
|
492
505
|
"""
|
|
493
|
-
return await
|
|
506
|
+
return await AsyncVectorLayer.get_vector(self, uuid, user_id)
|
|
494
507
|
|
|
495
508
|
|
|
496
|
-
async def get_vectors_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['
|
|
509
|
+
async def get_vectors_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['AsyncVectorLayer']:
|
|
497
510
|
"""
|
|
498
511
|
[async] Get vector layers by their IDs.
|
|
499
512
|
|
|
@@ -503,24 +516,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
503
516
|
include_settings (bool, optional): Whether to include the layer settings. default is False.
|
|
504
517
|
|
|
505
518
|
Returns:
|
|
506
|
-
List[
|
|
519
|
+
List[AsyncVectorLayer]: The list of VectorLayer instances.
|
|
507
520
|
|
|
508
521
|
Example:
|
|
509
522
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
510
523
|
>>> async with AsyncGeoboxClient() as client:
|
|
511
524
|
>>> layers = await client.get_vectors_by_ids(ids=[1, 2, 3])
|
|
512
525
|
"""
|
|
513
|
-
return await
|
|
526
|
+
return await AsyncVectorLayer.get_vectors_by_ids(self, ids, user_id, include_settings)
|
|
514
527
|
|
|
515
528
|
|
|
516
529
|
async def create_vector(self,
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
530
|
+
name: str,
|
|
531
|
+
layer_type: 'LayerType',
|
|
532
|
+
display_name: str = None,
|
|
533
|
+
description: str = None,
|
|
534
|
+
has_z: bool = False,
|
|
535
|
+
temporary: bool = False,
|
|
536
|
+
fields: List = None) -> 'AsyncVectorLayer':
|
|
524
537
|
"""
|
|
525
538
|
[async] Create a new vector layer.
|
|
526
539
|
|
|
@@ -534,7 +547,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
534
547
|
fields (List, optional): List of field definitions for the layer. default is None.
|
|
535
548
|
|
|
536
549
|
Returns:
|
|
537
|
-
|
|
550
|
+
AsyncVectorLayer: The newly created layer instance.
|
|
538
551
|
|
|
539
552
|
Raises:
|
|
540
553
|
ValidationError: If the layer data is invalid.
|
|
@@ -543,16 +556,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
543
556
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
544
557
|
>>> async with AsyncGeoboxClient() as client:
|
|
545
558
|
>>> layer = await client.create_vector(name="my_layer",
|
|
546
|
-
...
|
|
547
|
-
...
|
|
548
|
-
...
|
|
549
|
-
...
|
|
550
|
-
...
|
|
559
|
+
... layer_type=LayerType.Point,
|
|
560
|
+
... display_name="My Layer",
|
|
561
|
+
... description="This is a description of my layer",
|
|
562
|
+
... has_z=False,
|
|
563
|
+
... fields=[{"name": "my_field", "datatype": "FieldTypeString"}])
|
|
551
564
|
"""
|
|
552
|
-
return await
|
|
565
|
+
return await AsyncVectorLayer.create_vector(self, name=name, layer_type=layer_type, display_name=display_name, description=description, has_z=has_z, temporary=temporary, fields=fields)
|
|
553
566
|
|
|
554
567
|
|
|
555
|
-
async def get_vector_by_name(self, name: str, user_id: int = None) -> Union['
|
|
568
|
+
async def get_vector_by_name(self, name: str, user_id: int = None) -> Union['AsyncVectorLayer', None]:
|
|
556
569
|
"""
|
|
557
570
|
[async] Get a vector layer by name
|
|
558
571
|
|
|
@@ -561,17 +574,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
561
574
|
user_id (int, optional): specific user. privileges required.
|
|
562
575
|
|
|
563
576
|
Returns:
|
|
564
|
-
|
|
577
|
+
AsyncVectorLayer | None: returns the vector if a vector matches the given name, else None
|
|
565
578
|
|
|
566
579
|
Example:
|
|
567
580
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
568
581
|
>>> async with AsyncGeoboxClient() as client:
|
|
569
582
|
>>> layer = await client.get_vector_by_name(name='test')
|
|
570
583
|
"""
|
|
571
|
-
return await
|
|
584
|
+
return await AsyncVectorLayer.get_vector_by_name(self, name, user_id)
|
|
572
585
|
|
|
573
586
|
|
|
574
|
-
async def get_files(self, **kwargs) -> Union[List['
|
|
587
|
+
async def get_files(self, **kwargs) -> Union[List['AsyncFile'], int]:
|
|
575
588
|
"""
|
|
576
589
|
[async] Retrieves a list of files.
|
|
577
590
|
|
|
@@ -587,17 +600,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
587
600
|
shared (bool): Whether to return shared files. default is False.
|
|
588
601
|
|
|
589
602
|
Returns:
|
|
590
|
-
List[
|
|
603
|
+
List[AsyncFile] | int: A list of File objects or the total number of results.
|
|
591
604
|
|
|
592
605
|
Example:
|
|
593
606
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
594
607
|
>>> async with AsyncGeoboxClient() as client:
|
|
595
608
|
>>> files = await client.get_files(search_fields='name', search='GIS', order_by='name', skip=10, limit=10)
|
|
596
609
|
"""
|
|
597
|
-
return await
|
|
610
|
+
return await AsyncFile.get_files(self, **kwargs)
|
|
598
611
|
|
|
599
612
|
|
|
600
|
-
async def get_file(self, uuid: str) -> '
|
|
613
|
+
async def get_file(self, uuid: str) -> 'AsyncFile':
|
|
601
614
|
"""
|
|
602
615
|
[async] Retrieves a file by its UUID.
|
|
603
616
|
|
|
@@ -605,7 +618,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
605
618
|
uuid (str, optional): The UUID of the file.
|
|
606
619
|
|
|
607
620
|
Returns:
|
|
608
|
-
|
|
621
|
+
AsyncFile: The retrieved file instance.
|
|
609
622
|
|
|
610
623
|
Raises:
|
|
611
624
|
NotFoundError: If the file with the specified UUID is not found.
|
|
@@ -615,10 +628,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
615
628
|
>>> async with AsyncGeoboxClient() as client:
|
|
616
629
|
>>> file = await client.get_file(uuid="12345678-1234-5678-1234-567812345678")
|
|
617
630
|
"""
|
|
618
|
-
return await
|
|
631
|
+
return await AsyncFile.get_file(self, uuid=uuid)
|
|
619
632
|
|
|
620
633
|
|
|
621
|
-
async def get_files_by_name(self, name: str, user_id: int = None) -> List['
|
|
634
|
+
async def get_files_by_name(self, name: str, user_id: int = None) -> List['AsyncFile']:
|
|
622
635
|
"""
|
|
623
636
|
[async] Get files by name
|
|
624
637
|
|
|
@@ -627,17 +640,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
627
640
|
user_id (int, optional): specific user. privileges required.
|
|
628
641
|
|
|
629
642
|
Returns:
|
|
630
|
-
List[
|
|
643
|
+
List[AsyncFile]: returns files that matches the given name
|
|
631
644
|
|
|
632
645
|
Example:
|
|
633
646
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
634
647
|
>>> async with AsyncGeoboxClient() as client:
|
|
635
648
|
>>> files = await client.get_files_by_name(name='test')
|
|
636
649
|
"""
|
|
637
|
-
return await
|
|
650
|
+
return await AsyncFile.get_files_by_name(self, name, user_id)
|
|
638
651
|
|
|
639
652
|
|
|
640
|
-
async def upload_file(self, path: str, user_id: int = None, scan_archive: bool = True) -> '
|
|
653
|
+
async def upload_file(self, path: str, user_id: int = None, scan_archive: bool = True) -> 'AsyncFile':
|
|
641
654
|
"""
|
|
642
655
|
[async] Upload a file to the GeoBox API.
|
|
643
656
|
|
|
@@ -647,7 +660,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
647
660
|
scan_archive (bool, optional): Whether to scan the archive for layers. default: True
|
|
648
661
|
|
|
649
662
|
Returns:
|
|
650
|
-
|
|
663
|
+
AsyncFile: The uploaded file instance.
|
|
651
664
|
|
|
652
665
|
Raises:
|
|
653
666
|
ValueError: If the file type is invalid.
|
|
@@ -658,10 +671,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
658
671
|
>>> async with AsyncGeoboxClient() as client:
|
|
659
672
|
>>> file = await client.upload_file(path='path/to/file.shp')
|
|
660
673
|
"""
|
|
661
|
-
return await
|
|
674
|
+
return await AsyncFile.upload_file(self, path=path, user_id=user_id, scan_archive=scan_archive)
|
|
662
675
|
|
|
663
676
|
|
|
664
|
-
async def get_tasks(self, **kwargs) -> Union[List['
|
|
677
|
+
async def get_tasks(self, **kwargs) -> Union[List['AsyncTask'], int]:
|
|
665
678
|
"""
|
|
666
679
|
[async] Get a list of tasks
|
|
667
680
|
|
|
@@ -678,17 +691,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
678
691
|
shared (bool): Whether to return shared tasks. default is False.
|
|
679
692
|
|
|
680
693
|
Returns:
|
|
681
|
-
List[
|
|
694
|
+
List[AsyncTask] | int: The list of task objects or the count of the tasks if return_count is True.
|
|
682
695
|
|
|
683
696
|
Example:
|
|
684
697
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
685
698
|
>>> async with AsyncGeoboxClient() as client:
|
|
686
699
|
>>> tasks = await client.get_tasks()
|
|
687
700
|
"""
|
|
688
|
-
return await
|
|
701
|
+
return await AsyncTask.get_tasks(self, **kwargs)
|
|
689
702
|
|
|
690
703
|
|
|
691
|
-
async def get_task(self, uuid: str) -> '
|
|
704
|
+
async def get_task(self, uuid: str) -> 'AsyncTask':
|
|
692
705
|
"""
|
|
693
706
|
[async] Gets a task.
|
|
694
707
|
|
|
@@ -696,17 +709,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
696
709
|
uuid (str): The UUID of the task.
|
|
697
710
|
|
|
698
711
|
Returns:
|
|
699
|
-
|
|
712
|
+
AsyncTask: The task object.
|
|
700
713
|
|
|
701
714
|
Example:
|
|
702
715
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
703
716
|
>>> async with AsyncGeoboxClient() as client:
|
|
704
717
|
>>> task = await client.get_task(uuid="12345678-1234-5678-1234-567812345678")
|
|
705
718
|
"""
|
|
706
|
-
return await
|
|
719
|
+
return await AsyncTask.get_task(self, uuid)
|
|
707
720
|
|
|
708
721
|
|
|
709
|
-
async def get_views(self, **kwargs) -> Union[List['
|
|
722
|
+
async def get_views(self, **kwargs) -> Union[List['AsyncVectorLayerView'], int]:
|
|
710
723
|
"""
|
|
711
724
|
[async] Get vector layer views.
|
|
712
725
|
|
|
@@ -724,25 +737,25 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
724
737
|
shared(bool): Whether to return shared views. default is False.
|
|
725
738
|
|
|
726
739
|
Returns:
|
|
727
|
-
list[
|
|
740
|
+
list[AsyncVectorLayerView] | int: A list of VectorLayerView instances or the layer views count if return_count is True.
|
|
728
741
|
|
|
729
742
|
Example:
|
|
730
743
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
731
744
|
>>> async with AsyncGeoboxClient() as client:
|
|
732
745
|
>>> views = await client.get_views(layer_id=1,
|
|
733
|
-
...
|
|
734
|
-
...
|
|
735
|
-
...
|
|
736
|
-
...
|
|
737
|
-
...
|
|
738
|
-
...
|
|
739
|
-
...
|
|
740
|
-
...
|
|
746
|
+
... include_settings=True,
|
|
747
|
+
... search="test",
|
|
748
|
+
... search_fields="name",
|
|
749
|
+
... order_by="name A",
|
|
750
|
+
... return_count=False,
|
|
751
|
+
... skip=0,
|
|
752
|
+
... limit=10,
|
|
753
|
+
... shared=True)
|
|
741
754
|
"""
|
|
742
|
-
return await
|
|
755
|
+
return await AsyncVectorLayerView.get_views(self, **kwargs)
|
|
743
756
|
|
|
744
757
|
|
|
745
|
-
async def get_views_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['
|
|
758
|
+
async def get_views_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['AsyncVectorLayerView']:
|
|
746
759
|
"""
|
|
747
760
|
[async] Get vector layer views by their IDs.
|
|
748
761
|
|
|
@@ -752,17 +765,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
752
765
|
include_settings (bool, optional): Whether to include the settings of the vector layer views. default is False.
|
|
753
766
|
|
|
754
767
|
Returns:
|
|
755
|
-
List[
|
|
768
|
+
List[AsyncVectorLayerView]: A list of VectorLayerView instances.
|
|
756
769
|
|
|
757
770
|
Example:
|
|
758
771
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
759
772
|
>>> async with AsyncGeoboxClient() as client:
|
|
760
773
|
>>> views = await client.get_views_by_ids(ids=[1,2,3])
|
|
761
774
|
"""
|
|
762
|
-
return await
|
|
775
|
+
return await AsyncVectorLayerView.get_views_by_ids(self, ids, user_id, include_settings)
|
|
763
776
|
|
|
764
777
|
|
|
765
|
-
async def get_view(self, uuid: str, user_id: int = None) -> '
|
|
778
|
+
async def get_view(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayerView':
|
|
766
779
|
"""
|
|
767
780
|
[async] Get a specific vector layer view by its UUID.
|
|
768
781
|
|
|
@@ -771,17 +784,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
771
784
|
user_id (int, optional): Specific user. privileges required.
|
|
772
785
|
|
|
773
786
|
Returns:
|
|
774
|
-
|
|
787
|
+
AsyncVectorLayerView: A VectorLayerView instance.
|
|
775
788
|
|
|
776
789
|
Example:
|
|
777
790
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
778
791
|
>>> async with AsyncGeoboxClient() as client:
|
|
779
792
|
>>> view = await client.get_view(uuid="12345678-1234-5678-1234-567812345678")
|
|
780
793
|
"""
|
|
781
|
-
return await
|
|
794
|
+
return await AsyncVectorLayerView.get_view(self, uuid, user_id)
|
|
782
795
|
|
|
783
796
|
|
|
784
|
-
async def get_view_by_name(self, name: str, user_id: int = None) -> Union['
|
|
797
|
+
async def get_view_by_name(self, name: str, user_id: int = None) -> Union['AsyncVectorLayerView', None]:
|
|
785
798
|
"""
|
|
786
799
|
[async] Get a view by name
|
|
787
800
|
|
|
@@ -790,18 +803,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
790
803
|
user_id (int, optional): specific user. privileges required.
|
|
791
804
|
|
|
792
805
|
Returns:
|
|
793
|
-
|
|
806
|
+
AsyncVectorLayerView | None: returns the view if a view matches the given name, else None
|
|
794
807
|
|
|
795
808
|
Example:
|
|
796
809
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
797
810
|
>>> async with AsyncGeoboxClient() as client:
|
|
798
811
|
>>> view = await client.get_view_by_name(name='test')
|
|
799
812
|
"""
|
|
800
|
-
return await
|
|
813
|
+
return await AsyncVectorLayerView.get_view_by_name(self, name, user_id)
|
|
801
814
|
|
|
802
815
|
|
|
803
|
-
async def create_tileset(self, name: str, layers: List[Union['
|
|
804
|
-
min_zoom: int = None, max_zoom: int = None, user_id: int = None) -> '
|
|
816
|
+
async def create_tileset(self, name: str, layers: List[Union['AsyncVectorLayer', 'AsyncVectorLayerView']], display_name: str = None, description: str = None,
|
|
817
|
+
min_zoom: int = None, max_zoom: int = None, user_id: int = None) -> 'AsyncTileset':
|
|
805
818
|
"""
|
|
806
819
|
[async] Create a new tileset.
|
|
807
820
|
|
|
@@ -815,7 +828,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
815
828
|
user_id (int, optional): Specific user. privileges required.
|
|
816
829
|
|
|
817
830
|
Returns:
|
|
818
|
-
|
|
831
|
+
AsyncTileset: The created tileset instance.
|
|
819
832
|
|
|
820
833
|
Example:
|
|
821
834
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -823,23 +836,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
823
836
|
>>> layer = await client.get_vector(uuid="12345678-1234-5678-1234-567812345678")
|
|
824
837
|
>>> view = await client.get_view(uuid="12345678-1234-5678-1234-567812345678")
|
|
825
838
|
>>> tileset = await client.create_tileset(name="your_tileset_name",
|
|
826
|
-
...
|
|
827
|
-
...
|
|
828
|
-
...
|
|
829
|
-
...
|
|
830
|
-
...
|
|
839
|
+
... display_name="Your Tileset",
|
|
840
|
+
... description="Your description",
|
|
841
|
+
... min_zoom=0,
|
|
842
|
+
... max_zoom=14,
|
|
843
|
+
... layers=[layer, view])
|
|
831
844
|
"""
|
|
832
|
-
return await
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
845
|
+
return await AsyncTileset.create_tileset(api=self,
|
|
846
|
+
name=name,
|
|
847
|
+
layers=layers,
|
|
848
|
+
display_name=display_name,
|
|
849
|
+
description=description,
|
|
850
|
+
min_zoom=min_zoom,
|
|
851
|
+
max_zoom=max_zoom,
|
|
852
|
+
user_id=user_id)
|
|
840
853
|
|
|
841
854
|
|
|
842
|
-
async def get_tilesets(self, **kwargs) -> Union[List['
|
|
855
|
+
async def get_tilesets(self, **kwargs) -> Union[List['AsyncTileset'], int]:
|
|
843
856
|
"""
|
|
844
857
|
[async] Retrieves a list of tilesets.
|
|
845
858
|
|
|
@@ -855,7 +868,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
855
868
|
shared (bool): Whether to return shared tilesets. default is False.
|
|
856
869
|
|
|
857
870
|
Returns:
|
|
858
|
-
List[
|
|
871
|
+
List[AsyncTileset] | int: A list of Tileset instances or the total number of tilesets
|
|
859
872
|
|
|
860
873
|
Example:
|
|
861
874
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -866,10 +879,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
866
879
|
... limit=10,
|
|
867
880
|
... )
|
|
868
881
|
"""
|
|
869
|
-
return await
|
|
882
|
+
return await AsyncTileset.get_tilesets(self, **kwargs)
|
|
870
883
|
|
|
871
884
|
|
|
872
|
-
async def get_tilesets_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
885
|
+
async def get_tilesets_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncTileset']:
|
|
873
886
|
"""
|
|
874
887
|
[async] Retrieves a list of tilesets by their IDs.
|
|
875
888
|
|
|
@@ -878,17 +891,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
878
891
|
user_id (int, optional): Specific user. privileges required.
|
|
879
892
|
|
|
880
893
|
Returns:
|
|
881
|
-
List[
|
|
894
|
+
List[AsyncTileset]: A list of Tileset instances.
|
|
882
895
|
|
|
883
896
|
Example:
|
|
884
897
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
885
898
|
>>> async with AsyncGeoboxClient() as client:
|
|
886
899
|
>>> tilesets = await client.get_tilesets_by_ids(ids=['123', '456'])
|
|
887
900
|
"""
|
|
888
|
-
return await
|
|
901
|
+
return await AsyncTileset.get_tilesets_by_ids(self, ids, user_id)
|
|
889
902
|
|
|
890
903
|
|
|
891
|
-
async def get_tileset(self, uuid: str) -> '
|
|
904
|
+
async def get_tileset(self, uuid: str) -> 'AsyncTileset':
|
|
892
905
|
"""
|
|
893
906
|
[async] Retrieves a tileset by its UUID.
|
|
894
907
|
|
|
@@ -896,17 +909,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
896
909
|
uuid (str): The UUID of the tileset.
|
|
897
910
|
|
|
898
911
|
Returns:
|
|
899
|
-
|
|
912
|
+
AsyncTileset: The retrieved tileset instance.
|
|
900
913
|
|
|
901
914
|
Example:
|
|
902
915
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
903
916
|
>>> async with AsyncGeoboxClient() as client:
|
|
904
917
|
>>> tileset = await client.get_tileset(uuid="12345678-1234-5678-1234-567812345678")
|
|
905
918
|
"""
|
|
906
|
-
return await
|
|
919
|
+
return await AsyncTileset.get_tileset(self, uuid)
|
|
907
920
|
|
|
908
921
|
|
|
909
|
-
async def get_tileset_by_name(self, name: str, user_id: int = None) -> Union['
|
|
922
|
+
async def get_tileset_by_name(self, name: str, user_id: int = None) -> Union['AsyncTileset', None]:
|
|
910
923
|
"""
|
|
911
924
|
[async] Get a tileset by name
|
|
912
925
|
|
|
@@ -915,17 +928,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
915
928
|
user_id (int, optional): specific user. privileges required.
|
|
916
929
|
|
|
917
930
|
Returns:
|
|
918
|
-
|
|
931
|
+
AsyncTileset | None: returns the tileset if a tileset matches the given name, else None
|
|
919
932
|
|
|
920
933
|
Example:
|
|
921
934
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
922
935
|
>>> async with AsyncGeoboxClient() as client:
|
|
923
936
|
>>> tileset = await client.get_tileset_by_name(name='test')
|
|
924
937
|
"""
|
|
925
|
-
return await
|
|
938
|
+
return await AsyncTileset.get_tileset_by_name(self, name, user_id)
|
|
926
939
|
|
|
927
940
|
|
|
928
|
-
async def get_rasters(self, **kwargs) -> Union[List['
|
|
941
|
+
async def get_rasters(self, **kwargs) -> Union[List['AsyncRaster'], int]:
|
|
929
942
|
"""
|
|
930
943
|
[async] Get all rasters.
|
|
931
944
|
|
|
@@ -942,17 +955,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
942
955
|
shared (bool): whether to return shared rasters. default is False.
|
|
943
956
|
|
|
944
957
|
Returns:
|
|
945
|
-
List[
|
|
958
|
+
List[AsyncRaster] | int: A list of Raster objects or the total count of rasters.
|
|
946
959
|
|
|
947
960
|
Example:
|
|
948
961
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
949
962
|
>>> async with AsyncGeoboxClient() as client:
|
|
950
963
|
>>> rasters = await client.get_rasters(terrain=True, q="name LIKE '%GIS%'")
|
|
951
964
|
"""
|
|
952
|
-
return await
|
|
965
|
+
return await AsyncRaster.get_rasters(self, **kwargs)
|
|
953
966
|
|
|
954
967
|
|
|
955
|
-
async def get_rasters_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
968
|
+
async def get_rasters_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncRaster']:
|
|
956
969
|
"""
|
|
957
970
|
[async] Get rasters by their IDs.
|
|
958
971
|
|
|
@@ -961,17 +974,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
961
974
|
user_id (int, optional): specific user. privileges required.
|
|
962
975
|
|
|
963
976
|
Returns:
|
|
964
|
-
List['
|
|
977
|
+
List['AsyncRaster']: A list of Raster objects.
|
|
965
978
|
|
|
966
979
|
Example:
|
|
967
980
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
968
981
|
>>> async with AsyncGeoboxClient() as client:
|
|
969
982
|
>>> rasters = await client.get_rasters_by_ids(ids=['123', '456'])
|
|
970
983
|
"""
|
|
971
|
-
return await
|
|
984
|
+
return await AsyncRaster.get_rasters_by_ids(self, ids, user_id)
|
|
972
985
|
|
|
973
986
|
|
|
974
|
-
async def get_raster(self, uuid: str) -> '
|
|
987
|
+
async def get_raster(self, uuid: str) -> 'AsyncRaster':
|
|
975
988
|
"""
|
|
976
989
|
[async] Get a raster by its UUID.
|
|
977
990
|
|
|
@@ -980,17 +993,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
980
993
|
user_id (int, optional): specific user. privileges required.
|
|
981
994
|
|
|
982
995
|
Returns:
|
|
983
|
-
|
|
996
|
+
AsyncRaster: A Raster object.
|
|
984
997
|
|
|
985
998
|
Example:
|
|
986
999
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
987
1000
|
>>> async with AsyncGeoboxClient() as client:
|
|
988
1001
|
>>> raster = await client.get_raster(uuid="12345678-1234-5678-1234-567812345678")
|
|
989
1002
|
"""
|
|
990
|
-
return await
|
|
1003
|
+
return await AsyncRaster.get_raster(self, uuid)
|
|
991
1004
|
|
|
992
1005
|
|
|
993
|
-
async def get_raster_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1006
|
+
async def get_raster_by_name(self, name: str, user_id: int = None) -> Union['AsyncRaster', None]:
|
|
994
1007
|
"""
|
|
995
1008
|
[async] Get a raster by name
|
|
996
1009
|
|
|
@@ -999,17 +1012,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
999
1012
|
user_id (int, optional): specific user. privileges required.
|
|
1000
1013
|
|
|
1001
1014
|
Returns:
|
|
1002
|
-
|
|
1015
|
+
AsyncRaster | None: returns the raster if a raster matches the given name, else None
|
|
1003
1016
|
|
|
1004
1017
|
Example:
|
|
1005
1018
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1006
1019
|
>>> async with AsyncGeoboxClient() as client:
|
|
1007
1020
|
>>> raster = await client.get_raster_by_name(name='test')
|
|
1008
1021
|
"""
|
|
1009
|
-
return await
|
|
1022
|
+
return await AsyncRaster.get_raster_by_name(self, name, user_id)
|
|
1010
1023
|
|
|
1011
1024
|
|
|
1012
|
-
async def get_mosaics(self, **kwargs) -> Union[List['
|
|
1025
|
+
async def get_mosaics(self, **kwargs) -> Union[List['AsyncMosaic'], int]:
|
|
1013
1026
|
"""
|
|
1014
1027
|
[async] Get a list of mosaics.
|
|
1015
1028
|
|
|
@@ -1025,17 +1038,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1025
1038
|
shared (bool): Whether to return shared mosaics. default is False.
|
|
1026
1039
|
|
|
1027
1040
|
Returns:
|
|
1028
|
-
List['
|
|
1041
|
+
List['AsyncMosaic'] | int: A list of Mosaic instances or the number of mosaics.
|
|
1029
1042
|
|
|
1030
1043
|
Example:
|
|
1031
1044
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1032
1045
|
>>> async with AsyncGeoboxClient() as client:
|
|
1033
1046
|
>>> mosaics = await client.get_mosaics(q="name LIKE '%GIS%'")
|
|
1034
1047
|
"""
|
|
1035
|
-
return await
|
|
1048
|
+
return await AsyncMosaic.get_mosaics(self, **kwargs)
|
|
1036
1049
|
|
|
1037
1050
|
|
|
1038
|
-
async def get_mosaics_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
1051
|
+
async def get_mosaics_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncMosaic']:
|
|
1039
1052
|
"""
|
|
1040
1053
|
[async] Get mosaics by their IDs.
|
|
1041
1054
|
|
|
@@ -1044,23 +1057,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1044
1057
|
user_id (int, optional): specific user. privileges required.
|
|
1045
1058
|
|
|
1046
1059
|
Returns:
|
|
1047
|
-
List[
|
|
1060
|
+
List[AsyncMosaic]: A list of Mosaic instances.
|
|
1048
1061
|
|
|
1049
1062
|
Example:
|
|
1050
1063
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1051
1064
|
>>> async with AsyncGeoboxClient() as client:
|
|
1052
1065
|
>>> mosaics = await client.get_mosaics_by_ids(ids=['1, 2, 3'])
|
|
1053
1066
|
"""
|
|
1054
|
-
return await
|
|
1067
|
+
return await AsyncMosaic.get_mosaics_by_ids(self, ids, user_id)
|
|
1055
1068
|
|
|
1056
1069
|
|
|
1057
1070
|
async def create_mosaic(self,
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1071
|
+
name:str,
|
|
1072
|
+
display_name: str = None,
|
|
1073
|
+
description: str = None,
|
|
1074
|
+
pixel_selection: str = None,
|
|
1075
|
+
min_zoom: int = None,
|
|
1076
|
+
user_id: int = None) -> 'AsyncMosaic':
|
|
1064
1077
|
"""
|
|
1065
1078
|
[async] Create New Raster Mosaic
|
|
1066
1079
|
|
|
@@ -1073,17 +1086,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1073
1086
|
user_id (int, optional): specific user. privileges required.
|
|
1074
1087
|
|
|
1075
1088
|
Returns:
|
|
1076
|
-
|
|
1089
|
+
AsyncMosaic: The created mosaic.
|
|
1077
1090
|
|
|
1078
1091
|
Example:
|
|
1079
1092
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1080
1093
|
>>> async with AsyncGeoboxClient() as client:
|
|
1081
1094
|
>>> mosaic = await client.create_mosaic(name='mosaic_name')
|
|
1082
1095
|
"""
|
|
1083
|
-
return await
|
|
1096
|
+
return await AsyncMosaic.create_mosaic(self, name, display_name, description, pixel_selection, min_zoom, user_id)
|
|
1084
1097
|
|
|
1085
1098
|
|
|
1086
|
-
async def get_mosaic(self, uuid: str, user_id: int = None) -> '
|
|
1099
|
+
async def get_mosaic(self, uuid: str, user_id: int = None) -> 'AsyncMosaic':
|
|
1087
1100
|
"""
|
|
1088
1101
|
[async] Get a mosaic by uuid.
|
|
1089
1102
|
|
|
@@ -1092,17 +1105,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1092
1105
|
user_id (int, optional): specific user. privileges required.
|
|
1093
1106
|
|
|
1094
1107
|
Returns:
|
|
1095
|
-
|
|
1108
|
+
AsyncMosaic: The mosaic object.
|
|
1096
1109
|
|
|
1097
1110
|
Example:
|
|
1098
1111
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1099
1112
|
>>> async with AsyncGeoboxClient() as client:
|
|
1100
1113
|
>>> mosaic = await client.get_mosaic(uuid="12345678-1234-5678-1234-567812345678")
|
|
1101
1114
|
"""
|
|
1102
|
-
return await
|
|
1115
|
+
return await AsyncMosaic.get_mosaic(self, uuid, user_id)
|
|
1103
1116
|
|
|
1104
1117
|
|
|
1105
|
-
async def get_mosaic_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1118
|
+
async def get_mosaic_by_name(self, name: str, user_id: int = None) -> Union['AsyncMosaic', None]:
|
|
1106
1119
|
"""
|
|
1107
1120
|
[async] Get a mosaic by name
|
|
1108
1121
|
|
|
@@ -1111,17 +1124,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1111
1124
|
user_id (int, optional): specific user. privileges required.
|
|
1112
1125
|
|
|
1113
1126
|
Returns:
|
|
1114
|
-
|
|
1127
|
+
AsyncMosaic | None: returns the mosaic if a mosaic matches the given name, else None
|
|
1115
1128
|
|
|
1116
1129
|
Example:
|
|
1117
1130
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1118
1131
|
>>> async with AsyncGeoboxClient() as client:
|
|
1119
1132
|
>>> mosaic = await client.get_mosaic_by_name(name='test')
|
|
1120
1133
|
"""
|
|
1121
|
-
return await
|
|
1134
|
+
return await AsyncMosaic.get_mosaic_by_name(self, name, user_id)
|
|
1122
1135
|
|
|
1123
1136
|
|
|
1124
|
-
async def get_models(self, **kwargs) -> Union[List['
|
|
1137
|
+
async def get_models(self, **kwargs) -> Union[List['AsyncModel'], int]:
|
|
1125
1138
|
"""
|
|
1126
1139
|
[async] Get a list of models with optional filtering and pagination.
|
|
1127
1140
|
|
|
@@ -1137,23 +1150,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1137
1150
|
shared (bool): Whether to return shared models. default is False.
|
|
1138
1151
|
|
|
1139
1152
|
Returns:
|
|
1140
|
-
List[
|
|
1153
|
+
List[AsyncModel] | int: A list of Model objects or the count number.
|
|
1141
1154
|
|
|
1142
1155
|
Example:
|
|
1143
1156
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1144
1157
|
>>> async with AsyncGeoboxClient() as client:
|
|
1145
1158
|
>>> models = await client.get_models(search="my_model",
|
|
1146
|
-
...
|
|
1147
|
-
...
|
|
1148
|
-
...
|
|
1149
|
-
...
|
|
1150
|
-
...
|
|
1151
|
-
...
|
|
1152
|
-
"""
|
|
1153
|
-
return await
|
|
1159
|
+
... search_fields="name, description",
|
|
1160
|
+
... order_by="name A",
|
|
1161
|
+
... return_count=True,
|
|
1162
|
+
... skip=0,
|
|
1163
|
+
... limit=10,
|
|
1164
|
+
... shared=False)
|
|
1165
|
+
"""
|
|
1166
|
+
return await AsyncModel.get_models(self, **kwargs)
|
|
1154
1167
|
|
|
1155
1168
|
|
|
1156
|
-
async def get_model(self, uuid: str, user_id: int = None) -> '
|
|
1169
|
+
async def get_model(self, uuid: str, user_id: int = None) -> 'AsyncModel':
|
|
1157
1170
|
"""
|
|
1158
1171
|
[async] Get a model by its UUID.
|
|
1159
1172
|
|
|
@@ -1162,7 +1175,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1162
1175
|
user_id (int, optional): Specific user. privileges required.
|
|
1163
1176
|
|
|
1164
1177
|
Returns:
|
|
1165
|
-
|
|
1178
|
+
AsyncModel: The model object.
|
|
1166
1179
|
|
|
1167
1180
|
Raises:
|
|
1168
1181
|
NotFoundError: If the model with the specified UUID is not found.
|
|
@@ -1172,10 +1185,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1172
1185
|
>>> async with AsyncGeoboxClient() as client:
|
|
1173
1186
|
>>> model = await client.get_model(uuid="12345678-1234-5678-1234-567812345678")
|
|
1174
1187
|
"""
|
|
1175
|
-
return await
|
|
1188
|
+
return await AsyncModel.get_model(self, uuid, user_id)
|
|
1176
1189
|
|
|
1177
1190
|
|
|
1178
|
-
async def get_model_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1191
|
+
async def get_model_by_name(self, name: str, user_id: int = None) -> Union['AsyncModel', None]:
|
|
1179
1192
|
"""
|
|
1180
1193
|
[async] Get a model by name
|
|
1181
1194
|
|
|
@@ -1184,17 +1197,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1184
1197
|
user_id (int, optional): specific user. privileges required.
|
|
1185
1198
|
|
|
1186
1199
|
Returns:
|
|
1187
|
-
|
|
1200
|
+
AsyncModel | None: returns the model if a model matches the given name, else None
|
|
1188
1201
|
|
|
1189
1202
|
Example:
|
|
1190
1203
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1191
1204
|
>>> async with AsyncGeoboxClient() as client:
|
|
1192
1205
|
>>> model = await client.get_model_by_name(name='test')
|
|
1193
1206
|
"""
|
|
1194
|
-
return await
|
|
1207
|
+
return await AsyncModel.get_model_by_name(self, name, user_id)
|
|
1195
1208
|
|
|
1196
1209
|
|
|
1197
|
-
async def get_maps(self, **kwargs) -> Union[List['
|
|
1210
|
+
async def get_maps(self, **kwargs) -> Union[List['AsyncMap'], int]:
|
|
1198
1211
|
"""
|
|
1199
1212
|
[async] Get list of maps with optional filtering and pagination.
|
|
1200
1213
|
|
|
@@ -1210,24 +1223,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1210
1223
|
shared (bool): Whether to return shared maps. default is False.
|
|
1211
1224
|
|
|
1212
1225
|
Returns:
|
|
1213
|
-
List[
|
|
1226
|
+
List[AsyncMap] | int: A list of Map instances or the total number of maps.
|
|
1214
1227
|
|
|
1215
1228
|
Example:
|
|
1216
1229
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1217
1230
|
>>> async with AsyncGeoboxClient() as client:
|
|
1218
1231
|
>>> maps = await client.get_maps(q="name LIKE '%My Map%'")
|
|
1219
1232
|
"""
|
|
1220
|
-
return await
|
|
1233
|
+
return await AsyncMap.get_maps(self, **kwargs)
|
|
1221
1234
|
|
|
1222
1235
|
|
|
1223
1236
|
async def create_map(self,
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1237
|
+
name: str,
|
|
1238
|
+
display_name: str = None,
|
|
1239
|
+
description: str = None,
|
|
1240
|
+
extent: List[float] = None,
|
|
1241
|
+
thumbnail: str = None,
|
|
1242
|
+
style: Dict = None,
|
|
1243
|
+
user_id: int = None) -> 'AsyncMap':
|
|
1231
1244
|
"""
|
|
1232
1245
|
[async] Create a new map.
|
|
1233
1246
|
|
|
@@ -1241,7 +1254,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1241
1254
|
user_id (int, optional): Specific user. privileges required.
|
|
1242
1255
|
|
|
1243
1256
|
Returns:
|
|
1244
|
-
|
|
1257
|
+
AsyncMap: The newly created map instance.
|
|
1245
1258
|
|
|
1246
1259
|
Raises:
|
|
1247
1260
|
ValidationError: If the map data is invalid.
|
|
@@ -1251,10 +1264,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1251
1264
|
>>> async with AsyncGeoboxClient() as client:
|
|
1252
1265
|
>>> map = await client.create_map(name="my_map", display_name="My Map", description="This is a description of my map", extent=[10, 20, 30, 40], thumbnail="https://example.com/thumbnail.png", style={"type": "style"})
|
|
1253
1266
|
"""
|
|
1254
|
-
return await
|
|
1267
|
+
return await AsyncMap.create_map(self, name, display_name, description, extent, thumbnail, style, user_id)
|
|
1255
1268
|
|
|
1256
1269
|
|
|
1257
|
-
async def get_map(self, uuid: str, user_id: int = None) -> '
|
|
1270
|
+
async def get_map(self, uuid: str, user_id: int = None) -> 'AsyncMap':
|
|
1258
1271
|
"""
|
|
1259
1272
|
[async] Get a map by its UUID.
|
|
1260
1273
|
|
|
@@ -1263,7 +1276,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1263
1276
|
user_id (int, optional): Specific user. privileges required.
|
|
1264
1277
|
|
|
1265
1278
|
Returns:
|
|
1266
|
-
|
|
1279
|
+
AsyncMap: The map object.
|
|
1267
1280
|
|
|
1268
1281
|
Raises:
|
|
1269
1282
|
NotFoundError: If the map with the specified UUID is not found.
|
|
@@ -1273,10 +1286,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1273
1286
|
>>> async with AsyncGeoboxClient() as client:
|
|
1274
1287
|
>>> map = await client.get_map(uuid="12345678-1234-5678-1234-567812345678")
|
|
1275
1288
|
"""
|
|
1276
|
-
return await
|
|
1289
|
+
return await AsyncMap.get_map(self, uuid, user_id)
|
|
1277
1290
|
|
|
1278
1291
|
|
|
1279
|
-
async def get_map_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1292
|
+
async def get_map_by_name(self, name: str, user_id: int = None) -> Union['AsyncMap', None]:
|
|
1280
1293
|
"""
|
|
1281
1294
|
[async] Get a map by name
|
|
1282
1295
|
|
|
@@ -1285,17 +1298,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1285
1298
|
user_id (int, optional): specific user. privileges required.
|
|
1286
1299
|
|
|
1287
1300
|
Returns:
|
|
1288
|
-
|
|
1301
|
+
AsyncMap | None: returns the map if a map matches the given name, else None
|
|
1289
1302
|
|
|
1290
1303
|
Example:
|
|
1291
1304
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1292
1305
|
>>> async with AsyncGeoboxClient() as client:
|
|
1293
1306
|
>>> map = await client.get_map_by_name(name='test')
|
|
1294
1307
|
"""
|
|
1295
|
-
return await
|
|
1308
|
+
return await AsyncMap.get_map_by_name(self, name, user_id)
|
|
1296
1309
|
|
|
1297
1310
|
|
|
1298
|
-
async def get_queries(self, **kwargs) -> Union[List['
|
|
1311
|
+
async def get_queries(self, **kwargs) -> Union[List['AsyncQuery'], int]:
|
|
1299
1312
|
"""
|
|
1300
1313
|
[async] Get Queries
|
|
1301
1314
|
|
|
@@ -1311,17 +1324,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1311
1324
|
shared (bool): Whether to return shared queries. default is False.
|
|
1312
1325
|
|
|
1313
1326
|
Returns:
|
|
1314
|
-
List[
|
|
1327
|
+
List[AsyncQuery] | int: list of queries or the number of queries.
|
|
1315
1328
|
|
|
1316
1329
|
Example:
|
|
1317
1330
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1318
1331
|
>>> async with AsyncGeoboxClient() as client:
|
|
1319
1332
|
>>> queries = await client.get_queries()
|
|
1320
1333
|
"""
|
|
1321
|
-
return await
|
|
1334
|
+
return await AsyncQuery.get_queries(self, **kwargs)
|
|
1322
1335
|
|
|
1323
1336
|
|
|
1324
|
-
async def create_query(self, name: str, display_name: str = None, description: str = None, sql: str = None, params: List = None) -> '
|
|
1337
|
+
async def create_query(self, name: str, display_name: str = None, description: str = None, sql: str = None, params: List = None) -> 'AsyncQuery':
|
|
1325
1338
|
"""
|
|
1326
1339
|
[async] Creates a new query.
|
|
1327
1340
|
|
|
@@ -1333,17 +1346,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1333
1346
|
params (list, optional): The parameters for the SQL statement.
|
|
1334
1347
|
|
|
1335
1348
|
Returns:
|
|
1336
|
-
|
|
1349
|
+
AsyncQuery: The created query instance.
|
|
1337
1350
|
|
|
1338
1351
|
Example:
|
|
1339
1352
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1340
1353
|
>>> async with AsyncGeoboxClient() as client:
|
|
1341
1354
|
>>> query = await client.create_query(name='query_name', display_name='Query Name', sql='SELECT * FROM some_layer')
|
|
1342
1355
|
"""
|
|
1343
|
-
return await
|
|
1356
|
+
return await AsyncQuery.create_query(self, name, display_name, description, sql, params)
|
|
1344
1357
|
|
|
1345
1358
|
|
|
1346
|
-
async def get_query(self, uuid: str, user_id: int = None) -> '
|
|
1359
|
+
async def get_query(self, uuid: str, user_id: int = None) -> 'AsyncQuery':
|
|
1347
1360
|
"""
|
|
1348
1361
|
[async] Retrieves a query by its UUID.
|
|
1349
1362
|
|
|
@@ -1352,17 +1365,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1352
1365
|
user_id (int, optional): specific user ID. privileges required.
|
|
1353
1366
|
|
|
1354
1367
|
Returns:
|
|
1355
|
-
|
|
1368
|
+
AsyncQuery: The retrieved query instance.
|
|
1356
1369
|
|
|
1357
1370
|
Example:
|
|
1358
1371
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1359
1372
|
>>> async with AsyncGeoboxClient() as client:
|
|
1360
1373
|
>>> query = await client.get_query(uuid="12345678-1234-5678-1234-567812345678")
|
|
1361
1374
|
"""
|
|
1362
|
-
return await
|
|
1375
|
+
return await AsyncQuery.get_query(self, uuid, user_id)
|
|
1363
1376
|
|
|
1364
1377
|
|
|
1365
|
-
async def get_query_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1378
|
+
async def get_query_by_name(self, name: str, user_id: int = None) -> Union['AsyncQuery', None]:
|
|
1366
1379
|
"""
|
|
1367
1380
|
[async] Get a query by name
|
|
1368
1381
|
|
|
@@ -1371,17 +1384,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1371
1384
|
user_id (int, optional): specific user. privileges required.
|
|
1372
1385
|
|
|
1373
1386
|
Returns:
|
|
1374
|
-
|
|
1387
|
+
AsyncQuery | None: returns the query if a query matches the given name, else None
|
|
1375
1388
|
|
|
1376
1389
|
Example:
|
|
1377
1390
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1378
1391
|
>>> async with AsyncGeoboxClient() as client:
|
|
1379
1392
|
>>> query = await client.get_query_by_name(name='test')
|
|
1380
1393
|
"""
|
|
1381
|
-
return await
|
|
1394
|
+
return await AsyncQuery.get_query_by_name(self, name, user_id)
|
|
1382
1395
|
|
|
1383
1396
|
|
|
1384
|
-
async def get_system_queries(self, **kwargs) -> List['
|
|
1397
|
+
async def get_system_queries(self, **kwargs) -> List['AsyncQuery']:
|
|
1385
1398
|
"""
|
|
1386
1399
|
[async] Returns the system queries as a list of Query objects.
|
|
1387
1400
|
|
|
@@ -1397,17 +1410,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1397
1410
|
shared (bool): whether to return shared queries. default is False.
|
|
1398
1411
|
|
|
1399
1412
|
Returns:
|
|
1400
|
-
List[
|
|
1413
|
+
List[AsyncQuery]: list of system queries.
|
|
1401
1414
|
|
|
1402
1415
|
Example:
|
|
1403
1416
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1404
1417
|
>>> async with AsyncGeoboxClient() as client:
|
|
1405
1418
|
>>> queries = await client.get_system_queries()
|
|
1406
1419
|
"""
|
|
1407
|
-
return await
|
|
1420
|
+
return await AsyncQuery.get_system_queries(self, **kwargs)
|
|
1408
1421
|
|
|
1409
1422
|
|
|
1410
|
-
async def get_users(self, **kwrags) -> Union[List['
|
|
1423
|
+
async def get_users(self, **kwrags) -> Union[List['AsyncUser'], int]:
|
|
1411
1424
|
"""
|
|
1412
1425
|
[async] Retrieves a list of users (Permission Required)
|
|
1413
1426
|
|
|
@@ -1424,14 +1437,14 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1424
1437
|
shared (bool): Whether to return shared maps. default is False.
|
|
1425
1438
|
|
|
1426
1439
|
Returns:
|
|
1427
|
-
List[
|
|
1440
|
+
List[AsyncUser] | int: list of users or the count number.
|
|
1428
1441
|
|
|
1429
1442
|
Example:
|
|
1430
1443
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1431
1444
|
>>> async with AsyncGeoboxClient() as client:
|
|
1432
1445
|
>>> users = await client.get_users()
|
|
1433
1446
|
"""
|
|
1434
|
-
return await
|
|
1447
|
+
return await AsyncUser.get_users(self, **kwrags)
|
|
1435
1448
|
|
|
1436
1449
|
|
|
1437
1450
|
async def create_user(self,
|
|
@@ -1442,7 +1455,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1442
1455
|
first_name: str,
|
|
1443
1456
|
last_name: str,
|
|
1444
1457
|
mobile: str,
|
|
1445
|
-
status: 'UserStatus') -> '
|
|
1458
|
+
status: 'UserStatus') -> 'AsyncUser':
|
|
1446
1459
|
"""
|
|
1447
1460
|
[async] Create a User (Permission Required)
|
|
1448
1461
|
|
|
@@ -1457,24 +1470,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1457
1470
|
status (UserStatus): the status of the user.
|
|
1458
1471
|
|
|
1459
1472
|
Returns:
|
|
1460
|
-
|
|
1473
|
+
AsyncUser: the user object.
|
|
1461
1474
|
|
|
1462
1475
|
Example:
|
|
1463
1476
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1464
1477
|
>>> async with AsyncGeoboxClient() as client:
|
|
1465
1478
|
>>> user = await client.create_user(username="user1",
|
|
1466
|
-
...
|
|
1467
|
-
...
|
|
1468
|
-
...
|
|
1469
|
-
...
|
|
1470
|
-
...
|
|
1471
|
-
...
|
|
1472
|
-
...
|
|
1473
|
-
"""
|
|
1474
|
-
return await
|
|
1479
|
+
... email="user1@example.com",
|
|
1480
|
+
... password="P@ssw0rd",
|
|
1481
|
+
... role=UserRole.ACCOUNT_ADMIN,
|
|
1482
|
+
... first_name="user 1",
|
|
1483
|
+
... last_name="user 1",
|
|
1484
|
+
... mobile="+98 9120123456",
|
|
1485
|
+
... status=UserStatus.ACTIVE)
|
|
1486
|
+
"""
|
|
1487
|
+
return await AsyncUser.create_user(self, username, email, password, role, first_name, last_name, mobile, status)
|
|
1475
1488
|
|
|
1476
1489
|
|
|
1477
|
-
async def search_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['
|
|
1490
|
+
async def search_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['AsyncUser']:
|
|
1478
1491
|
"""
|
|
1479
1492
|
[async] Get list of users based on the search term.
|
|
1480
1493
|
|
|
@@ -1484,17 +1497,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1484
1497
|
limit (int, optional): Number of items to return. default is 10.
|
|
1485
1498
|
|
|
1486
1499
|
Returns:
|
|
1487
|
-
List[
|
|
1500
|
+
List[AsyncUser]: A list of User instances.
|
|
1488
1501
|
|
|
1489
1502
|
Example:
|
|
1490
1503
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1491
1504
|
>>> async with AsyncGeoboxClient() as client:
|
|
1492
1505
|
>>> users = await client.get_users(search="John")
|
|
1493
1506
|
"""
|
|
1494
|
-
return await
|
|
1507
|
+
return await AsyncUser.search_users(self, search, skip, limit)
|
|
1495
1508
|
|
|
1496
1509
|
|
|
1497
|
-
async def get_user(self, user_id: str = 'me') -> '
|
|
1510
|
+
async def get_user(self, user_id: str = 'me') -> 'AsyncUser':
|
|
1498
1511
|
"""
|
|
1499
1512
|
[async] Get a user by its id (Permission Required)
|
|
1500
1513
|
|
|
@@ -1514,15 +1527,15 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1514
1527
|
get the current user
|
|
1515
1528
|
>>> user = await client.get_user()
|
|
1516
1529
|
"""
|
|
1517
|
-
return await
|
|
1530
|
+
return await AsyncUser.get_user(self, user_id)
|
|
1518
1531
|
|
|
1519
1532
|
|
|
1520
|
-
async def get_my_sessions(self) -> List['
|
|
1533
|
+
async def get_my_sessions(self) -> List['AsyncSession']:
|
|
1521
1534
|
"""
|
|
1522
1535
|
[async] Get a list of user available sessions (Permission Required)
|
|
1523
1536
|
|
|
1524
1537
|
Returns:
|
|
1525
|
-
List[
|
|
1538
|
+
List[AsyncSession]: list of user sessions.
|
|
1526
1539
|
|
|
1527
1540
|
Example:
|
|
1528
1541
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -1533,7 +1546,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1533
1546
|
return await user.get_sessions()
|
|
1534
1547
|
|
|
1535
1548
|
|
|
1536
|
-
async def get_workflows(self, **kwargs) -> Union[List['
|
|
1549
|
+
async def get_workflows(self, **kwargs) -> Union[List['AsyncWorkflow'], int]:
|
|
1537
1550
|
"""
|
|
1538
1551
|
[async] Get list of workflows with optional filtering and pagination.
|
|
1539
1552
|
|
|
@@ -1549,23 +1562,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1549
1562
|
shared (bool): Whether to return shared workflows. default is False.
|
|
1550
1563
|
|
|
1551
1564
|
Returns:
|
|
1552
|
-
List[
|
|
1565
|
+
List[AsyncWorkflow] | int: A list of workflow instances or the total number of workflows.
|
|
1553
1566
|
|
|
1554
1567
|
Example:
|
|
1555
1568
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1556
1569
|
>>> async with AsyncGeoboxClient() as client:
|
|
1557
1570
|
>>> workflows = await client.get_workflows(q="name LIKE '%My workflow%'")
|
|
1558
1571
|
"""
|
|
1559
|
-
return await
|
|
1572
|
+
return await AsyncWorkflow.get_workflows(self, **kwargs)
|
|
1560
1573
|
|
|
1561
1574
|
|
|
1562
1575
|
async def create_workflow(self,
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1576
|
+
name: str,
|
|
1577
|
+
display_name: str = None,
|
|
1578
|
+
description: str = None,
|
|
1579
|
+
settings: Dict = {},
|
|
1580
|
+
thumbnail: str = None,
|
|
1581
|
+
user_id: int = None) -> 'AsyncWorkflow':
|
|
1569
1582
|
"""
|
|
1570
1583
|
[async] Create a new workflow.
|
|
1571
1584
|
|
|
@@ -1578,7 +1591,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1578
1591
|
user_id (int): Specific user. privileges workflow.
|
|
1579
1592
|
|
|
1580
1593
|
Returns:
|
|
1581
|
-
|
|
1594
|
+
AsyncWorkflow: The newly created workflow instance.
|
|
1582
1595
|
|
|
1583
1596
|
Raises:
|
|
1584
1597
|
ValidationError: If the workflow data is invalid.
|
|
@@ -1588,10 +1601,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1588
1601
|
>>> async with AsyncGeoboxClient() as client:
|
|
1589
1602
|
>>> workflow = await client.create_workflow(name="my_workflow")
|
|
1590
1603
|
"""
|
|
1591
|
-
return await
|
|
1604
|
+
return await AsyncWorkflow.create_workflow(self, name, display_name, description, settings, thumbnail, user_id)
|
|
1592
1605
|
|
|
1593
1606
|
|
|
1594
|
-
async def get_workflow(self, uuid: str, user_id: int = None) -> '
|
|
1607
|
+
async def get_workflow(self, uuid: str, user_id: int = None) -> 'AsyncWorkflow':
|
|
1595
1608
|
"""
|
|
1596
1609
|
[async] Get a workflow by its UUID.
|
|
1597
1610
|
|
|
@@ -1600,7 +1613,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1600
1613
|
user_id (int): Specific user. privileges required.
|
|
1601
1614
|
|
|
1602
1615
|
Returns:
|
|
1603
|
-
|
|
1616
|
+
AsyncWorkflow: The workflow object.
|
|
1604
1617
|
|
|
1605
1618
|
Raises:
|
|
1606
1619
|
NotFoundError: If the workflow with the specified UUID is not found.
|
|
@@ -1610,10 +1623,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1610
1623
|
>>> async with AsyncGeoboxClient() as client:
|
|
1611
1624
|
>>> workflow = await client.get_workflow(uuid="12345678-1234-5678-1234-567812345678")
|
|
1612
1625
|
"""
|
|
1613
|
-
return await
|
|
1626
|
+
return await AsyncWorkflow.get_workflow(self, uuid, user_id)
|
|
1614
1627
|
|
|
1615
1628
|
|
|
1616
|
-
async def get_workflow_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1629
|
+
async def get_workflow_by_name(self, name: str, user_id: int = None) -> Union['AsyncWorkflow', None]:
|
|
1617
1630
|
"""
|
|
1618
1631
|
[async] Get a workflow by name
|
|
1619
1632
|
|
|
@@ -1622,17 +1635,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1622
1635
|
user_id (int, optional): specific user. privileges required.
|
|
1623
1636
|
|
|
1624
1637
|
Returns:
|
|
1625
|
-
|
|
1638
|
+
AsyncWorkflow | None: returns the workflow if a workflow matches the given name, else None
|
|
1626
1639
|
|
|
1627
1640
|
Example:
|
|
1628
1641
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1629
1642
|
>>> async with AsyncGeoboxClient() as client:
|
|
1630
1643
|
>>> workflow = await client.get_workflow_by_name(name='test')
|
|
1631
1644
|
"""
|
|
1632
|
-
return await
|
|
1645
|
+
return await AsyncWorkflow.get_workflow_by_name(self, name, user_id)
|
|
1633
1646
|
|
|
1634
1647
|
|
|
1635
|
-
async def get_versions(self, **kwargs) -> Union[List['
|
|
1648
|
+
async def get_versions(self, **kwargs) -> Union[List['AsyncVectorLayerVersion'], int]:
|
|
1636
1649
|
"""
|
|
1637
1650
|
[async] Get list of versions with optional filtering and pagination.
|
|
1638
1651
|
|
|
@@ -1649,17 +1662,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1649
1662
|
shared (bool): Whether to return shared versions. default is False.
|
|
1650
1663
|
|
|
1651
1664
|
Returns:
|
|
1652
|
-
List[
|
|
1665
|
+
List[AsyncVectorLayerVersion] | int: A list of vector layer version instances or the total number of versions.
|
|
1653
1666
|
|
|
1654
1667
|
Example:
|
|
1655
1668
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1656
1669
|
>>> async with AsyncGeoboxClient() as client:
|
|
1657
1670
|
>>> versions = await client.get_versions(q="name LIKE '%My version%'")
|
|
1658
1671
|
"""
|
|
1659
|
-
return await
|
|
1672
|
+
return await AsyncVectorLayerVersion.get_versions(self, **kwargs)
|
|
1660
1673
|
|
|
1661
1674
|
|
|
1662
|
-
async def get_version(self, uuid: str, user_id: int = None) -> '
|
|
1675
|
+
async def get_version(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayerVersion':
|
|
1663
1676
|
"""
|
|
1664
1677
|
[async] Get a version by its UUID.
|
|
1665
1678
|
|
|
@@ -1668,7 +1681,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1668
1681
|
user_id (int, optional): Specific user. privileges required.
|
|
1669
1682
|
|
|
1670
1683
|
Returns:
|
|
1671
|
-
|
|
1684
|
+
AsyncVectorLayerVersion: The vector layer version object.
|
|
1672
1685
|
|
|
1673
1686
|
Raises:
|
|
1674
1687
|
NotFoundError: If the version with the specified UUID is not found.
|
|
@@ -1678,10 +1691,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1678
1691
|
>>> async with AsyncGeoboxClient() as client:
|
|
1679
1692
|
>>> version = await client.get_version(uuid="12345678-1234-5678-1234-567812345678")
|
|
1680
1693
|
"""
|
|
1681
|
-
return await
|
|
1694
|
+
return await AsyncVectorLayerVersion.get_version(self, uuid, user_id)
|
|
1682
1695
|
|
|
1683
1696
|
|
|
1684
|
-
async def get_version_by_name(self, name: str, user_id: int = None) -> '
|
|
1697
|
+
async def get_version_by_name(self, name: str, user_id: int = None) -> 'AsyncVectorLayerVersion':
|
|
1685
1698
|
"""
|
|
1686
1699
|
[async] Get a version by name
|
|
1687
1700
|
|
|
@@ -1690,17 +1703,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1690
1703
|
user_id (int, optional): specific user. privileges required.
|
|
1691
1704
|
|
|
1692
1705
|
Returns:
|
|
1693
|
-
|
|
1706
|
+
AsyncVectorLayerVersion | None: returns the version if a version matches the given name, else None
|
|
1694
1707
|
|
|
1695
1708
|
Example:
|
|
1696
1709
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1697
1710
|
>>> async with AsyncGeoboxClient() as client:
|
|
1698
1711
|
>>> version = await client.get_version_by_name(name='test')
|
|
1699
1712
|
"""
|
|
1700
|
-
return await
|
|
1713
|
+
return await AsyncVectorLayerVersion.get_version_by_name(self, name, user_id)
|
|
1701
1714
|
|
|
1702
1715
|
|
|
1703
|
-
async def get_layouts(self, **kwargs) -> Union[List['
|
|
1716
|
+
async def get_layouts(self, **kwargs) -> Union[List['AsyncLayout'], int]:
|
|
1704
1717
|
"""
|
|
1705
1718
|
[async] Get list of layouts with optional filtering and pagination.
|
|
1706
1719
|
|
|
@@ -1716,23 +1729,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1716
1729
|
shared (bool): Whether to return shared layouts. default is False.
|
|
1717
1730
|
|
|
1718
1731
|
Returns:
|
|
1719
|
-
List[
|
|
1732
|
+
List[AsyncLayout] | int: A list of layout instances or the total number of layouts.
|
|
1720
1733
|
|
|
1721
1734
|
Example:
|
|
1722
1735
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1723
1736
|
>>> async with AsyncGeoboxClient() as client:
|
|
1724
1737
|
>>> layouts = await client.get_layouts(q="name LIKE '%My layout%'")
|
|
1725
1738
|
"""
|
|
1726
|
-
return await
|
|
1739
|
+
return await AsyncLayout.get_layouts(self, **kwargs)
|
|
1727
1740
|
|
|
1728
1741
|
|
|
1729
1742
|
async def create_layout(self,
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1743
|
+
name: str,
|
|
1744
|
+
display_name: str = None,
|
|
1745
|
+
description: str = None,
|
|
1746
|
+
settings: Dict = {},
|
|
1747
|
+
thumbnail: str = None,
|
|
1748
|
+
user_id: int = None) -> 'AsyncLayout':
|
|
1736
1749
|
"""
|
|
1737
1750
|
[async] Create a new layout.
|
|
1738
1751
|
|
|
@@ -1745,7 +1758,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1745
1758
|
user_id (int): Specific user. privileges layout.
|
|
1746
1759
|
|
|
1747
1760
|
Returns:
|
|
1748
|
-
|
|
1761
|
+
AsyncLayout: The newly created layout instance.
|
|
1749
1762
|
|
|
1750
1763
|
Raises:
|
|
1751
1764
|
ValidationError: If the layout data is invalid.
|
|
@@ -1755,10 +1768,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1755
1768
|
>>> async with AsyncGeoboxClient() as client:
|
|
1756
1769
|
>>> layout = await client.create_layout(name="my_layout")
|
|
1757
1770
|
"""
|
|
1758
|
-
return await
|
|
1771
|
+
return await AsyncLayout.create_layout(self, name, display_name, description, settings, thumbnail, user_id)
|
|
1759
1772
|
|
|
1760
1773
|
|
|
1761
|
-
async def get_layout(self, uuid: str, user_id: int = None) -> '
|
|
1774
|
+
async def get_layout(self, uuid: str, user_id: int = None) -> 'AsyncLayout':
|
|
1762
1775
|
"""
|
|
1763
1776
|
[async] Get a layout by its UUID.
|
|
1764
1777
|
|
|
@@ -1767,7 +1780,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1767
1780
|
user_id (int): Specific user. privileges required.
|
|
1768
1781
|
|
|
1769
1782
|
Returns:
|
|
1770
|
-
|
|
1783
|
+
AsyncLayout: The layout object.
|
|
1771
1784
|
|
|
1772
1785
|
Raises:
|
|
1773
1786
|
NotFoundError: If the layout with the specified UUID is not found.
|
|
@@ -1777,10 +1790,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1777
1790
|
>>> async with AsyncGeoboxClient() as client:
|
|
1778
1791
|
>>> layout = await client.get_layout(uuid="12345678-1234-5678-1234-567812345678")
|
|
1779
1792
|
"""
|
|
1780
|
-
return await
|
|
1793
|
+
return await AsyncLayout.get_layout(self, uuid, user_id)
|
|
1781
1794
|
|
|
1782
1795
|
|
|
1783
|
-
async def get_layout_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1796
|
+
async def get_layout_by_name(self, name: str, user_id: int = None) -> Union['AsyncLayout', None]:
|
|
1784
1797
|
"""
|
|
1785
1798
|
[async] Get a layout by name
|
|
1786
1799
|
|
|
@@ -1789,17 +1802,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1789
1802
|
user_id (int, optional): specific user. privileges required.
|
|
1790
1803
|
|
|
1791
1804
|
Returns:
|
|
1792
|
-
|
|
1805
|
+
AsyncLayout | None: returns the layout if a layout matches the given name, else None
|
|
1793
1806
|
|
|
1794
1807
|
Example:
|
|
1795
1808
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1796
1809
|
>>> async with AsyncGeoboxClient() as client:
|
|
1797
1810
|
>>> layout = await client.get_layout_by_name(name='test')
|
|
1798
1811
|
"""
|
|
1799
|
-
return await
|
|
1812
|
+
return await AsyncLayout.get_layout_by_name(self, name, user_id)
|
|
1800
1813
|
|
|
1801
1814
|
|
|
1802
|
-
async def get_3dtiles(self, **kwargs) -> Union[List['
|
|
1815
|
+
async def get_3dtiles(self, **kwargs) -> Union[List['AsyncTile3d'], int]:
|
|
1803
1816
|
"""
|
|
1804
1817
|
[async] Get list of 3D Tiles with optional filtering and pagination.
|
|
1805
1818
|
|
|
@@ -1815,17 +1828,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1815
1828
|
shared (bool): Whether to return shared maps. default is False.
|
|
1816
1829
|
|
|
1817
1830
|
Returns:
|
|
1818
|
-
List[
|
|
1831
|
+
List[AsyncTile3d] | int: A list of 3D Tile instances or the total number of 3D Tiles.
|
|
1819
1832
|
|
|
1820
1833
|
Example:
|
|
1821
1834
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1822
1835
|
>>> async with AsyncGeoboxClient() as client:
|
|
1823
1836
|
>>> tiles = await client.get_3dtiles(q="name LIKE '%My tile%'")
|
|
1824
1837
|
"""
|
|
1825
|
-
return await
|
|
1838
|
+
return await AsyncTile3d.get_3dtiles(self, **kwargs)
|
|
1826
1839
|
|
|
1827
1840
|
|
|
1828
|
-
async def get_3dtile(self, uuid: str, user_id: int = None) -> '
|
|
1841
|
+
async def get_3dtile(self, uuid: str, user_id: int = None) -> 'AsyncTile3d':
|
|
1829
1842
|
"""
|
|
1830
1843
|
[async] Get a 3D Tile by its UUID.
|
|
1831
1844
|
|
|
@@ -1834,7 +1847,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1834
1847
|
user_id (int): Specific user. privileges required.
|
|
1835
1848
|
|
|
1836
1849
|
Returns:
|
|
1837
|
-
|
|
1850
|
+
AsyncTile3d: The 3D Tile object.
|
|
1838
1851
|
|
|
1839
1852
|
Raises:
|
|
1840
1853
|
NotFoundError: If the 3D Tile with the specified UUID is not found.
|
|
@@ -1844,10 +1857,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1844
1857
|
>>> async with AsyncGeoboxClient() as client:
|
|
1845
1858
|
>>> tile = await client.get_3dtile(uuid="12345678-1234-5678-1234-567812345678")
|
|
1846
1859
|
"""
|
|
1847
|
-
return await
|
|
1860
|
+
return await AsyncTile3d.get_3dtile(self, uuid, user_id)
|
|
1848
1861
|
|
|
1849
1862
|
|
|
1850
|
-
async def get_3dtile_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1863
|
+
async def get_3dtile_by_name(self, name: str, user_id: int = None) -> Union['AsyncTile3d', None]:
|
|
1851
1864
|
"""
|
|
1852
1865
|
[async] Get a 3dtile by name
|
|
1853
1866
|
|
|
@@ -1856,32 +1869,32 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1856
1869
|
user_id (int, optional): specific user. privileges required.
|
|
1857
1870
|
|
|
1858
1871
|
Returns:
|
|
1859
|
-
|
|
1872
|
+
AsyncTile3d | None: returns the 3dtile if a 3dtile matches the given name, else None
|
|
1860
1873
|
|
|
1861
1874
|
Example:
|
|
1862
1875
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1863
1876
|
>>> async with AsyncGeoboxClient() as client:
|
|
1864
1877
|
>>> tile3d = await client.get_3dtile_by_name(name='test')
|
|
1865
1878
|
"""
|
|
1866
|
-
return await
|
|
1879
|
+
return await AsyncTile3d.get_3dtile_by_name(self, name, user_id)
|
|
1867
1880
|
|
|
1868
1881
|
|
|
1869
|
-
async def get_system_settings(self) -> '
|
|
1882
|
+
async def get_system_settings(self) -> 'AsyncSystemSettings':
|
|
1870
1883
|
"""
|
|
1871
1884
|
[async] Get System Settings object (Permission Required).
|
|
1872
1885
|
|
|
1873
1886
|
Returns:
|
|
1874
|
-
|
|
1887
|
+
AsyncSystemSetting: the system settings object.
|
|
1875
1888
|
|
|
1876
1889
|
Example:
|
|
1877
1890
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1878
1891
|
>>> async with AsyncGeoboxClient() as client:
|
|
1879
1892
|
>>> setting = await client.get_system_settings()
|
|
1880
1893
|
"""
|
|
1881
|
-
return await
|
|
1894
|
+
return await AsyncSystemSettings.get_system_settings(self)
|
|
1882
1895
|
|
|
1883
1896
|
|
|
1884
|
-
async def get_scenes(self, **kwargs) -> Union[List['
|
|
1897
|
+
async def get_scenes(self, **kwargs) -> Union[List['AsyncScene'], int]:
|
|
1885
1898
|
"""
|
|
1886
1899
|
[async] Get list of scenes with optional filtering and pagination.
|
|
1887
1900
|
|
|
@@ -1897,23 +1910,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1897
1910
|
shared (bool): Whether to return shared scenes. default is False.
|
|
1898
1911
|
|
|
1899
1912
|
Returns:
|
|
1900
|
-
List[
|
|
1913
|
+
List[AsyncScene] | int: A list of scene instances or the total number of scenes.
|
|
1901
1914
|
|
|
1902
1915
|
Example:
|
|
1903
1916
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1904
1917
|
>>> async with AsyncGeoboxClient() as client:
|
|
1905
1918
|
>>> scenes = await client.get_scenes(q="name LIKE '%My scene%'")
|
|
1906
1919
|
"""
|
|
1907
|
-
return await
|
|
1920
|
+
return await AsyncScene.get_scenes(self, **kwargs)
|
|
1908
1921
|
|
|
1909
1922
|
|
|
1910
1923
|
async def create_scene(self,
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1924
|
+
name: str,
|
|
1925
|
+
display_name: str = None,
|
|
1926
|
+
description: str = None,
|
|
1927
|
+
settings: Dict = {},
|
|
1928
|
+
thumbnail: str = None,
|
|
1929
|
+
user_id: int = None) -> 'AsyncScene':
|
|
1917
1930
|
"""
|
|
1918
1931
|
[async] Create a new scene.
|
|
1919
1932
|
|
|
@@ -1926,7 +1939,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1926
1939
|
user_id (int, optional): Specific user. privileges required.
|
|
1927
1940
|
|
|
1928
1941
|
Returns:
|
|
1929
|
-
|
|
1942
|
+
AsyncScene: The newly created scene instance.
|
|
1930
1943
|
|
|
1931
1944
|
Raises:
|
|
1932
1945
|
ValidationError: If the scene data is invalid.
|
|
@@ -1936,16 +1949,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1936
1949
|
>>> async with AsyncGeoboxClient() as client:
|
|
1937
1950
|
>>> scene = await client.create_scene(name="my_scene")
|
|
1938
1951
|
"""
|
|
1939
|
-
return await
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1952
|
+
return await AsyncScene.create_scene(self,
|
|
1953
|
+
name,
|
|
1954
|
+
display_name,
|
|
1955
|
+
description,
|
|
1956
|
+
settings,
|
|
1957
|
+
thumbnail,
|
|
1958
|
+
user_id)
|
|
1946
1959
|
|
|
1947
1960
|
|
|
1948
|
-
async def get_scene(self, uuid: str, user_id: int = None) -> '
|
|
1961
|
+
async def get_scene(self, uuid: str, user_id: int = None) -> 'AsyncScene':
|
|
1949
1962
|
"""
|
|
1950
1963
|
[async] Get a scene by its UUID.
|
|
1951
1964
|
|
|
@@ -1954,7 +1967,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1954
1967
|
user_id (int, optional): Specific user. privileges required.
|
|
1955
1968
|
|
|
1956
1969
|
Returns:
|
|
1957
|
-
|
|
1970
|
+
AsyncScene: The scene object.
|
|
1958
1971
|
|
|
1959
1972
|
Raises:
|
|
1960
1973
|
NotFoundError: If the scene with the specified UUID is not found.
|
|
@@ -1964,10 +1977,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1964
1977
|
>>> async with AsyncGeoboxClient() as client:
|
|
1965
1978
|
>>> scene = await client.get_scene(uuid="12345678-1234-5678-1234-567812345678")
|
|
1966
1979
|
"""
|
|
1967
|
-
return await
|
|
1980
|
+
return await AsyncScene.get_scene(self, uuid, user_id)
|
|
1968
1981
|
|
|
1969
1982
|
|
|
1970
|
-
async def get_scene_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1983
|
+
async def get_scene_by_name(self, name: str, user_id: int = None) -> Union['AsyncScene', None]:
|
|
1971
1984
|
"""
|
|
1972
1985
|
[async] Get a scene by name
|
|
1973
1986
|
|
|
@@ -1976,14 +1989,14 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1976
1989
|
user_id (int, optional): specific user. privileges required.
|
|
1977
1990
|
|
|
1978
1991
|
Returns:
|
|
1979
|
-
|
|
1992
|
+
AsyncScene | None: returns the scene if a scene matches the given name, else None
|
|
1980
1993
|
|
|
1981
1994
|
Example:
|
|
1982
1995
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1983
1996
|
>>> async with AsyncGeoboxClient() as client:
|
|
1984
1997
|
>>> scene = await client.get_scene_by_name(name='test')
|
|
1985
1998
|
"""
|
|
1986
|
-
return await
|
|
1999
|
+
return await AsyncScene.get_scene_by_name(self, name, user_id)
|
|
1987
2000
|
|
|
1988
2001
|
|
|
1989
2002
|
async def route(self, stops: str, **kwargs) -> Dict:
|
|
@@ -2007,16 +2020,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2007
2020
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2008
2021
|
>>> async with AsyncGeoboxClient() as client:
|
|
2009
2022
|
>>> route = await client.route(stops="53,33;56,36",
|
|
2010
|
-
...
|
|
2011
|
-
...
|
|
2012
|
-
...
|
|
2013
|
-
...
|
|
2014
|
-
...
|
|
2023
|
+
... alternatives=True,
|
|
2024
|
+
... steps=True,
|
|
2025
|
+
... geometries=RoutingGeometryType.geojson,
|
|
2026
|
+
... overview=RoutingOverviewLevel.full,
|
|
2027
|
+
... annotations=True)
|
|
2015
2028
|
"""
|
|
2016
|
-
return await
|
|
2029
|
+
return await AsyncRouting.route(self, stops, **kwargs)
|
|
2017
2030
|
|
|
2018
2031
|
|
|
2019
|
-
async def get_plans(self, **kwargs) -> Union[List['
|
|
2032
|
+
async def get_plans(self, **kwargs) -> Union[List['AsyncPlan'], int]:
|
|
2020
2033
|
"""
|
|
2021
2034
|
[async] Get list of plans with optional filtering and pagination.
|
|
2022
2035
|
|
|
@@ -2032,30 +2045,30 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2032
2045
|
shared (bool): Whether to return shared plans. default is False.
|
|
2033
2046
|
|
|
2034
2047
|
Returns:
|
|
2035
|
-
List[
|
|
2048
|
+
List[AsyncPlan] | int: A list of plan instances or the total number of plans.
|
|
2036
2049
|
|
|
2037
2050
|
Example:
|
|
2038
2051
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2039
2052
|
>>> async with AsyncGeoboxClient() as client:
|
|
2040
2053
|
>>> plans = await client.get_plans(q="name LIKE '%My plan%'")
|
|
2041
2054
|
"""
|
|
2042
|
-
return await
|
|
2055
|
+
return await AsyncPlan.get_plans(self, **kwargs)
|
|
2043
2056
|
|
|
2044
2057
|
|
|
2045
2058
|
async def create_plan(self,
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
+
name: str,
|
|
2060
|
+
plan_color: str,
|
|
2061
|
+
storage: int,
|
|
2062
|
+
concurrent_tasks: int,
|
|
2063
|
+
daily_api_calls: int,
|
|
2064
|
+
monthly_api_calls: int,
|
|
2065
|
+
daily_traffic: int,
|
|
2066
|
+
monthly_traffic: int,
|
|
2067
|
+
daily_process: int,
|
|
2068
|
+
monthly_process: int,
|
|
2069
|
+
number_of_days: int = None,
|
|
2070
|
+
display_name: str = None,
|
|
2071
|
+
description: str = None) -> 'AsyncPlan':
|
|
2059
2072
|
"""
|
|
2060
2073
|
[async] Create a new plan.
|
|
2061
2074
|
|
|
@@ -2075,7 +2088,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2075
2088
|
description (str, optional): description of the plan.
|
|
2076
2089
|
|
|
2077
2090
|
Returns:
|
|
2078
|
-
|
|
2091
|
+
AsyncPlan: The newly created plan instance.
|
|
2079
2092
|
|
|
2080
2093
|
Raises:
|
|
2081
2094
|
ValidationError: If the plan data is invalid.
|
|
@@ -2084,36 +2097,36 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2084
2097
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2085
2098
|
>>> async with AsyncGeoboxClient() as client:
|
|
2086
2099
|
>>> plan = await client.create_plan(name="new_plan",
|
|
2087
|
-
...
|
|
2088
|
-
...
|
|
2089
|
-
...
|
|
2090
|
-
...
|
|
2091
|
-
...
|
|
2092
|
-
...
|
|
2093
|
-
...
|
|
2094
|
-
...
|
|
2095
|
-
...
|
|
2096
|
-
...
|
|
2097
|
-
...
|
|
2098
|
-
...
|
|
2099
|
-
"""
|
|
2100
|
-
return await
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2100
|
+
... display_name=" New Plan",
|
|
2101
|
+
... description="new plan description",
|
|
2102
|
+
... plan_color="#000000",
|
|
2103
|
+
... storage=10,
|
|
2104
|
+
... concurrent_tasks=10,
|
|
2105
|
+
... daily_api_calls=10,
|
|
2106
|
+
... monthly_api_calls=10,
|
|
2107
|
+
... daily_traffic=10,
|
|
2108
|
+
... monthly_traffic=10,
|
|
2109
|
+
... daily_process=10,
|
|
2110
|
+
... monthly_process=10,
|
|
2111
|
+
... number_of_days=10)
|
|
2112
|
+
"""
|
|
2113
|
+
return await AsyncPlan.create_plan(self,
|
|
2114
|
+
name,
|
|
2115
|
+
plan_color,
|
|
2116
|
+
storage,
|
|
2117
|
+
concurrent_tasks,
|
|
2118
|
+
daily_api_calls,
|
|
2119
|
+
monthly_api_calls,
|
|
2120
|
+
daily_traffic,
|
|
2121
|
+
monthly_traffic,
|
|
2122
|
+
daily_process,
|
|
2123
|
+
monthly_process,
|
|
2124
|
+
number_of_days,
|
|
2125
|
+
display_name,
|
|
2126
|
+
description)
|
|
2114
2127
|
|
|
2115
2128
|
|
|
2116
|
-
async def get_plan(self, plan_id: int) -> '
|
|
2129
|
+
async def get_plan(self, plan_id: int) -> 'AsyncPlan':
|
|
2117
2130
|
"""
|
|
2118
2131
|
[async] Get a plan by its id.
|
|
2119
2132
|
|
|
@@ -2121,7 +2134,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2121
2134
|
plan_id (int): The id of the plan to get.
|
|
2122
2135
|
|
|
2123
2136
|
Returns:
|
|
2124
|
-
|
|
2137
|
+
AsyncPlan: The plan object
|
|
2125
2138
|
|
|
2126
2139
|
Raises:
|
|
2127
2140
|
NotFoundError: If the plan with the specified id is not found.
|
|
@@ -2131,10 +2144,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2131
2144
|
>>> async with AsyncGeoboxClient() as client:
|
|
2132
2145
|
>>> plan = await client.get_plan(plan_id=1)
|
|
2133
2146
|
"""
|
|
2134
|
-
return await
|
|
2147
|
+
return await AsyncPlan.get_plan(self, plan_id)
|
|
2135
2148
|
|
|
2136
2149
|
|
|
2137
|
-
async def get_plan_by_name(self, name: str) -> Union['
|
|
2150
|
+
async def get_plan_by_name(self, name: str) -> Union['AsyncPlan', None]:
|
|
2138
2151
|
"""
|
|
2139
2152
|
[async] Get a plan by name
|
|
2140
2153
|
|
|
@@ -2143,17 +2156,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2143
2156
|
name (str): the name of the plan to get
|
|
2144
2157
|
|
|
2145
2158
|
Returns:
|
|
2146
|
-
|
|
2159
|
+
AsyncPlan | None: returns the plan if a plan matches the given name, else None
|
|
2147
2160
|
|
|
2148
2161
|
Example:
|
|
2149
2162
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2150
2163
|
>>> async with AsyncGeoboxClient() as client:
|
|
2151
2164
|
>>> plan = await client.get_plan_by_name(name='test')
|
|
2152
2165
|
"""
|
|
2153
|
-
return await
|
|
2166
|
+
return await AsyncPlan.get_plan_by_name(self, name)
|
|
2154
2167
|
|
|
2155
2168
|
|
|
2156
|
-
async def get_dashboards(self, **kwargs) -> Union[List['
|
|
2169
|
+
async def get_dashboards(self, **kwargs) -> Union[List['AsyncDashboard'], int]:
|
|
2157
2170
|
"""
|
|
2158
2171
|
[async] Get list of Dashboards
|
|
2159
2172
|
|
|
@@ -2169,23 +2182,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2169
2182
|
shared (bool): Whether to return shared Dashboards. default is False.
|
|
2170
2183
|
|
|
2171
2184
|
Returns:
|
|
2172
|
-
List[
|
|
2185
|
+
List[AsyncDashboard] | int: A list of Dashboard instances or the total number of Dashboards.
|
|
2173
2186
|
|
|
2174
2187
|
Example:
|
|
2175
2188
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2176
2189
|
>>> async with AsyncGeoboxClient() as client:
|
|
2177
2190
|
>>> dashboards = await client.get_dashboards()
|
|
2178
2191
|
"""
|
|
2179
|
-
return await
|
|
2192
|
+
return await AsyncDashboard.get_dashboards(self, **kwargs)
|
|
2180
2193
|
|
|
2181
2194
|
|
|
2182
2195
|
async def create_dashboard(self,
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2196
|
+
name: str,
|
|
2197
|
+
display_name: str = None,
|
|
2198
|
+
description: str = None,
|
|
2199
|
+
settings: Dict = {},
|
|
2200
|
+
thumbnail: str = None,
|
|
2201
|
+
user_id: int = None) -> 'AsyncDashboard':
|
|
2189
2202
|
"""
|
|
2190
2203
|
[async] Create a new Dashboard.
|
|
2191
2204
|
|
|
@@ -2198,7 +2211,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2198
2211
|
user_id (int, optional): Specific user. privileges required.
|
|
2199
2212
|
|
|
2200
2213
|
Returns:
|
|
2201
|
-
|
|
2214
|
+
AsyncDashboard: The newly created Dashboard instance.
|
|
2202
2215
|
|
|
2203
2216
|
Raises:
|
|
2204
2217
|
ValidationError: If the Dashboard data is invalid.
|
|
@@ -2208,16 +2221,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2208
2221
|
>>> async with AsyncGeoboxClient() as client:
|
|
2209
2222
|
>>> dashboard = await client.create_dashboard(name="my_dashboard")
|
|
2210
2223
|
"""
|
|
2211
|
-
return await
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2224
|
+
return await AsyncDashboard.create_dashboard(self,
|
|
2225
|
+
name,
|
|
2226
|
+
display_name,
|
|
2227
|
+
description,
|
|
2228
|
+
settings,
|
|
2229
|
+
thumbnail,
|
|
2230
|
+
user_id)
|
|
2218
2231
|
|
|
2219
2232
|
|
|
2220
|
-
async def get_dashboard(self, uuid: str, user_id: int = None) -> '
|
|
2233
|
+
async def get_dashboard(self, uuid: str, user_id: int = None) -> 'AsyncDashboard':
|
|
2221
2234
|
"""
|
|
2222
2235
|
[async] Get a Dashboard by its UUID.
|
|
2223
2236
|
|
|
@@ -2226,7 +2239,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2226
2239
|
user_id (int, optional): Specific user. privileges required.
|
|
2227
2240
|
|
|
2228
2241
|
Returns:
|
|
2229
|
-
|
|
2242
|
+
AsyncDashboard: The dashboard object.
|
|
2230
2243
|
|
|
2231
2244
|
Raises:
|
|
2232
2245
|
NotFoundError: If the Dashboard with the specified UUID is not found.
|
|
@@ -2236,10 +2249,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2236
2249
|
>>> async with AsyncGeoboxClient() as client:
|
|
2237
2250
|
>>> dashboard = await client.get_dashboard(uuid="12345678-1234-5678-1234-567812345678")
|
|
2238
2251
|
"""
|
|
2239
|
-
return await
|
|
2252
|
+
return await AsyncDashboard.get_dashboard(self, uuid, user_id)
|
|
2240
2253
|
|
|
2241
2254
|
|
|
2242
|
-
async def get_dashboard_by_name(self, name: str, user_id: int = None) -> Union['
|
|
2255
|
+
async def get_dashboard_by_name(self, name: str, user_id: int = None) -> Union['AsyncDashboard', None]:
|
|
2243
2256
|
"""
|
|
2244
2257
|
[async] Get a dashboard by name
|
|
2245
2258
|
|
|
@@ -2248,32 +2261,32 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2248
2261
|
user_id (int, optional): specific user. privileges required.
|
|
2249
2262
|
|
|
2250
2263
|
Returns:
|
|
2251
|
-
|
|
2264
|
+
AsyncDashboard | None: returns the dashboard if a dashboard matches the given name, else None
|
|
2252
2265
|
|
|
2253
2266
|
Example:
|
|
2254
2267
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2255
2268
|
>>> async with AsyncGeoboxClient() as client:
|
|
2256
2269
|
>>> dashboard = await client.get_dashboard_by_name(name='test')
|
|
2257
2270
|
"""
|
|
2258
|
-
return await
|
|
2271
|
+
return await AsyncDashboard.get_dashboard_by_name(self, name, user_id)
|
|
2259
2272
|
|
|
2260
2273
|
|
|
2261
|
-
async def get_basemaps(self) -> List['
|
|
2274
|
+
async def get_basemaps(self) -> List['AsyncBasemap']:
|
|
2262
2275
|
"""
|
|
2263
2276
|
[async] Get a list of basemaps
|
|
2264
2277
|
|
|
2265
2278
|
Returns:
|
|
2266
|
-
List[
|
|
2279
|
+
List[AsyncBaseMap]: list of basemaps.
|
|
2267
2280
|
|
|
2268
2281
|
Example:
|
|
2269
2282
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2270
2283
|
>>> async with AsyncGeoboxClient() as client:
|
|
2271
2284
|
>>> basemaps = await client.get_basemaps()
|
|
2272
2285
|
"""
|
|
2273
|
-
return await
|
|
2286
|
+
return await AsyncBasemap.get_basemaps(self)
|
|
2274
2287
|
|
|
2275
2288
|
|
|
2276
|
-
async def get_basemap(self, name: str) -> '
|
|
2289
|
+
async def get_basemap(self, name: str) -> 'AsyncBasemap':
|
|
2277
2290
|
"""
|
|
2278
2291
|
[async] Get a basemap object
|
|
2279
2292
|
|
|
@@ -2281,7 +2294,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2281
2294
|
name: the basemap name
|
|
2282
2295
|
|
|
2283
2296
|
Returns:
|
|
2284
|
-
|
|
2297
|
+
AsyncBasemap: the basemap object
|
|
2285
2298
|
|
|
2286
2299
|
Raises:
|
|
2287
2300
|
NotFoundError: if the base,ap with the specified name not found
|
|
@@ -2291,7 +2304,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2291
2304
|
>>> async with AsyncGeoboxClient() as client:
|
|
2292
2305
|
>>> basemap = await client.get_basemap(name='test')
|
|
2293
2306
|
"""
|
|
2294
|
-
return await
|
|
2307
|
+
return await AsyncBasemap.get_basemap(self, name)
|
|
2295
2308
|
|
|
2296
2309
|
|
|
2297
2310
|
async def proxy_basemap(self, url: str) -> None:
|
|
@@ -2309,15 +2322,15 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2309
2322
|
>>> async with AsyncGeoboxClient() as client:
|
|
2310
2323
|
>>> await client.proxy_basemap(url='proxy_server_url')
|
|
2311
2324
|
"""
|
|
2312
|
-
return await
|
|
2325
|
+
return await AsyncBasemap.proxy_basemap(self, url)
|
|
2313
2326
|
|
|
2314
2327
|
|
|
2315
|
-
async def get_attachments(self, resource: Union['
|
|
2328
|
+
async def get_attachments(self, resource: Union['AsyncMap', 'AsyncVectorLayer', 'AsyncVectorLayerView'], **kwargs) -> List['AsyncAttachment']:
|
|
2316
2329
|
"""
|
|
2317
2330
|
[async] Get the resouces attachments
|
|
2318
2331
|
|
|
2319
2332
|
Args:
|
|
2320
|
-
resource (
|
|
2333
|
+
resource (AsyncMap | AsyncVectorLayer | AsyncVectorLayerView): options are: Map, Vector, View objects
|
|
2321
2334
|
|
|
2322
2335
|
Keyword Args:
|
|
2323
2336
|
element_id (str): the id of the element with attachment.
|
|
@@ -2328,7 +2341,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2328
2341
|
return_count (bool): Whether to return total count. default is False.
|
|
2329
2342
|
|
|
2330
2343
|
Returns:
|
|
2331
|
-
List[
|
|
2344
|
+
List[AsyncAttachment] | int: A list of attachments instances or the total number of attachments.
|
|
2332
2345
|
|
|
2333
2346
|
Raises:
|
|
2334
2347
|
TypeError: if the resource type is not supported
|
|
@@ -2340,18 +2353,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2340
2353
|
>>> map = maps[0]
|
|
2341
2354
|
>>> attachments = await client.get_attachments(resource=map)
|
|
2342
2355
|
"""
|
|
2343
|
-
return await
|
|
2356
|
+
return await AsyncAttachment.get_attachments(self, resource=resource, **kwargs)
|
|
2344
2357
|
|
|
2345
2358
|
|
|
2346
2359
|
async def create_attachment(self,
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2360
|
+
name: str,
|
|
2361
|
+
loc_x: int,
|
|
2362
|
+
loc_y: int,
|
|
2363
|
+
resource: Union['AsyncMap', 'AsyncVectorLayer', 'AsyncVectorLayerView'],
|
|
2364
|
+
file: 'AsyncFile',
|
|
2365
|
+
feature: 'AsyncFeature' = None,
|
|
2366
|
+
display_name: str = None,
|
|
2367
|
+
description: str = None, ) -> 'AsyncAttachment':
|
|
2355
2368
|
"""
|
|
2356
2369
|
[async] Create a new Attachment.
|
|
2357
2370
|
|
|
@@ -2359,9 +2372,9 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2359
2372
|
name (str): The name of the scene.
|
|
2360
2373
|
loc_x (int): x parameter of the attachment location.
|
|
2361
2374
|
loc_y (int): y parameter of the attachment location.
|
|
2362
|
-
resource (
|
|
2363
|
-
file (
|
|
2364
|
-
feature (
|
|
2375
|
+
resource (AsyncMap | AsyncVectorLayer | AsyncVectorLayerView): the resource object.
|
|
2376
|
+
file (AsyncFile): the file object.
|
|
2377
|
+
feature (AsyncFeature, optional): the feature object.
|
|
2365
2378
|
display_name (str, optional): The display name of the scene.
|
|
2366
2379
|
description (str, optional): The description of the scene.
|
|
2367
2380
|
|
|
@@ -2378,23 +2391,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2378
2391
|
>>> feature = await layer.get_feature(feature_id=1)
|
|
2379
2392
|
>>> file = await client.get_file(uuid="12345678-1234-5678-1234-567812345678")
|
|
2380
2393
|
>>> attachment = await client.create_attachment(name="my_attachment",
|
|
2381
|
-
...
|
|
2382
|
-
...
|
|
2383
|
-
...
|
|
2384
|
-
...
|
|
2385
|
-
...
|
|
2386
|
-
...
|
|
2387
|
-
...
|
|
2388
|
-
"""
|
|
2389
|
-
return await
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2394
|
+
... loc_x=30,
|
|
2395
|
+
... loc_y=50,
|
|
2396
|
+
... resource=layer,
|
|
2397
|
+
... file=file,
|
|
2398
|
+
... feature=feature,
|
|
2399
|
+
... display_name="My Attachment",
|
|
2400
|
+
... description="Attachment Description")
|
|
2401
|
+
"""
|
|
2402
|
+
return await AsyncAttachment.create_attachment(self,
|
|
2403
|
+
name,
|
|
2404
|
+
loc_x,
|
|
2405
|
+
loc_y,
|
|
2406
|
+
resource,
|
|
2407
|
+
file,
|
|
2408
|
+
feature,
|
|
2409
|
+
display_name,
|
|
2410
|
+
description)
|
|
2398
2411
|
|
|
2399
2412
|
|
|
2400
2413
|
async def update_attachment(self, attachment_id: int, **kwargs) -> Dict:
|
|
@@ -2422,10 +2435,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2422
2435
|
>>> async with AsyncGeoboxClient() as client:
|
|
2423
2436
|
>>> await client.update_attachment(attachment_id=1, display_name="New Display Name")
|
|
2424
2437
|
"""
|
|
2425
|
-
return await
|
|
2438
|
+
return await AsyncAttachment.update_attachment(self, attachment_id, **kwargs)
|
|
2426
2439
|
|
|
2427
2440
|
|
|
2428
|
-
async def get_apikeys(self, **kwargs) -> List['
|
|
2441
|
+
async def get_apikeys(self, **kwargs) -> List['AsyncApiKey']:
|
|
2429
2442
|
"""
|
|
2430
2443
|
[async] Get a list of apikeys
|
|
2431
2444
|
|
|
@@ -2436,15 +2449,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2436
2449
|
limit (int): Maximum number of layers to return. default is 10.
|
|
2437
2450
|
user_id (int): Specific user. privileges required.
|
|
2438
2451
|
|
|
2452
|
+
Returns:
|
|
2453
|
+
AsyncApiKey: list of apikey objects
|
|
2454
|
+
|
|
2439
2455
|
Example:
|
|
2440
2456
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2441
2457
|
>>> async with AsyncGeoboxClient() as client:
|
|
2442
2458
|
>>> apikeys = await client.get_apikeys()
|
|
2443
2459
|
"""
|
|
2444
|
-
return await
|
|
2460
|
+
return await AsyncApiKey.get_apikeys(self, **kwargs)
|
|
2445
2461
|
|
|
2446
2462
|
|
|
2447
|
-
async def create_apikey(self, name: str, user_id: int = None) -> '
|
|
2463
|
+
async def create_apikey(self, name: str, user_id: int = None) -> 'AsyncApiKey':
|
|
2448
2464
|
"""
|
|
2449
2465
|
[async] Create an ApiKey
|
|
2450
2466
|
|
|
@@ -2453,17 +2469,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2453
2469
|
user_id (int, optional): Specific user. privileges required.
|
|
2454
2470
|
|
|
2455
2471
|
Returns:
|
|
2456
|
-
|
|
2472
|
+
AsyncApiKey: the apikey object
|
|
2457
2473
|
|
|
2458
2474
|
Example:
|
|
2459
2475
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2460
2476
|
>>> async with AsyncGeoboxClient() as client:
|
|
2461
2477
|
>>> apikey = await client.create_apikey(name='test')
|
|
2462
2478
|
"""
|
|
2463
|
-
return await
|
|
2479
|
+
return await AsyncApiKey.create_apikey(self, name, user_id)
|
|
2464
2480
|
|
|
2465
2481
|
|
|
2466
|
-
async def get_apikey(self, key_id: int) -> '
|
|
2482
|
+
async def get_apikey(self, key_id: int) -> 'AsyncApiKey':
|
|
2467
2483
|
"""
|
|
2468
2484
|
[async] Get an ApiKey
|
|
2469
2485
|
|
|
@@ -2471,17 +2487,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2471
2487
|
key_id (str): the id of the apikey.
|
|
2472
2488
|
|
|
2473
2489
|
Returns:
|
|
2474
|
-
|
|
2490
|
+
AsyncApiKey: the ApiKey object
|
|
2475
2491
|
|
|
2476
2492
|
Example:
|
|
2477
2493
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2478
2494
|
>>> async with AsyncGeoboxClient() as client:
|
|
2479
2495
|
>>> apikey = await client.get_apikey(key_id=1)
|
|
2480
2496
|
"""
|
|
2481
|
-
return await
|
|
2497
|
+
return await AsyncApiKey.get_apikey(self, key_id)
|
|
2482
2498
|
|
|
2483
2499
|
|
|
2484
|
-
async def get_apikey_by_name(self, name: str, user_id: int = None) -> '
|
|
2500
|
+
async def get_apikey_by_name(self, name: str, user_id: int = None) -> 'AsyncApiKey':
|
|
2485
2501
|
"""
|
|
2486
2502
|
[async] Get an ApiKey by name
|
|
2487
2503
|
|
|
@@ -2490,17 +2506,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2490
2506
|
user_id (int, optional): specific user. privileges required.
|
|
2491
2507
|
|
|
2492
2508
|
Returns:
|
|
2493
|
-
|
|
2509
|
+
AsyncApiKey | None: returns the key if a key matches the given name, else None
|
|
2494
2510
|
|
|
2495
2511
|
Example:
|
|
2496
2512
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2497
2513
|
>>> async with AsyncGeoboxClient() as client:
|
|
2498
2514
|
>>> apikey = await client.get_apikey_by_name(name='test')
|
|
2499
2515
|
"""
|
|
2500
|
-
return await
|
|
2516
|
+
return await AsyncApiKey.get_apikey_by_name(self, name, user_id)
|
|
2501
2517
|
|
|
2502
2518
|
|
|
2503
|
-
async def get_logs(self, **kwargs) -> List['
|
|
2519
|
+
async def get_logs(self, **kwargs) -> List['AsyncLog']:
|
|
2504
2520
|
"""
|
|
2505
2521
|
[async] Get a list of Logs
|
|
2506
2522
|
|
|
@@ -2516,29 +2532,29 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2516
2532
|
activity_type (str): the user activity type.
|
|
2517
2533
|
|
|
2518
2534
|
Returns:
|
|
2519
|
-
List[
|
|
2535
|
+
List[AsyncLog]: a list of logs
|
|
2520
2536
|
|
|
2521
2537
|
Example:
|
|
2522
2538
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2523
2539
|
>>> async with AsyncGeoboxClient() as client:
|
|
2524
2540
|
>>> logs = await client.get_logs()
|
|
2525
2541
|
"""
|
|
2526
|
-
return await
|
|
2542
|
+
return await AsyncLog.get_logs(self, **kwargs)
|
|
2527
2543
|
|
|
2528
2544
|
|
|
2529
2545
|
async def get_api_usage(self,
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2546
|
+
resource: Union['AsyncUser', 'AsyncApiKey'],
|
|
2547
|
+
scale: 'UsageScale',
|
|
2548
|
+
param: 'UsageParam',
|
|
2549
|
+
from_date: 'datetime' = None,
|
|
2550
|
+
to_date: 'datetime' = None,
|
|
2551
|
+
days_before_now: int = None,
|
|
2552
|
+
limit: int = None) -> List:
|
|
2537
2553
|
"""
|
|
2538
2554
|
[async] Get the api usage of a user
|
|
2539
2555
|
|
|
2540
2556
|
Args:
|
|
2541
|
-
resource (
|
|
2557
|
+
resource (AsyncUser | AsyncApiKey): User or ApiKey object.
|
|
2542
2558
|
scale (UsageScale): the scale of the report.
|
|
2543
2559
|
param (UsageParam): traffic or calls.
|
|
2544
2560
|
from_date (datetime, optional): datetime object in this format: "%Y-%m-%dT%H:%M:%S".
|
|
@@ -2562,21 +2578,21 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2562
2578
|
... param=UsageParam.Calls,
|
|
2563
2579
|
... days_before_now=5)
|
|
2564
2580
|
"""
|
|
2565
|
-
return await
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2581
|
+
return await AsyncUsage.get_api_usage(self,
|
|
2582
|
+
resource=resource,
|
|
2583
|
+
scale=scale,
|
|
2584
|
+
param=param,
|
|
2585
|
+
from_date=from_date,
|
|
2586
|
+
to_date=to_date,
|
|
2587
|
+
days_before_now=days_before_now,
|
|
2588
|
+
limit=limit)
|
|
2573
2589
|
|
|
2574
2590
|
|
|
2575
2591
|
async def get_process_usage(self,
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2592
|
+
user_id: int = None,
|
|
2593
|
+
from_date: datetime = None,
|
|
2594
|
+
to_date: datetime = None,
|
|
2595
|
+
days_before_now: int = None) -> float:
|
|
2580
2596
|
"""
|
|
2581
2597
|
[async] Get process usage of a user in seconds
|
|
2582
2598
|
|
|
@@ -2597,11 +2613,11 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2597
2613
|
>>> async with AsyncGeoboxClient() as client:
|
|
2598
2614
|
>>> process_usage = await client.get_process_usage(days_before_now=5)
|
|
2599
2615
|
"""
|
|
2600
|
-
return await
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2616
|
+
return await AsyncUsage.get_process_usage(self,
|
|
2617
|
+
user_id=user_id,
|
|
2618
|
+
from_date=from_date,
|
|
2619
|
+
to_date=to_date,
|
|
2620
|
+
days_before_now=days_before_now)
|
|
2605
2621
|
|
|
2606
2622
|
|
|
2607
2623
|
async def get_usage_summary(self, user_id: int = None) -> Dict:
|
|
@@ -2619,7 +2635,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2619
2635
|
>>> async with AsyncGeoboxClient() as client:
|
|
2620
2636
|
>>> usage_summary = await client.get_usage_summary()
|
|
2621
2637
|
"""
|
|
2622
|
-
return await
|
|
2638
|
+
return await AsyncUsage.get_usage_summary(self, user_id=user_id)
|
|
2623
2639
|
|
|
2624
2640
|
|
|
2625
2641
|
async def update_usage(self, user_id: int = None) -> Dict:
|
|
@@ -2637,4 +2653,4 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2637
2653
|
>>> async with AsyncGeoboxClient() as client:
|
|
2638
2654
|
>>> await client.update_usage()
|
|
2639
2655
|
"""
|
|
2640
|
-
return await
|
|
2656
|
+
return await AsyncUsage.update_usage(self, user_id=user_id)
|