cecil 0.0.18__tar.gz → 0.0.20__tar.gz
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.
Potentially problematic release.
This version of cecil might be problematic. Click here for more details.
- {cecil-0.0.18 → cecil-0.0.20}/PKG-INFO +1 -1
- {cecil-0.0.18 → cecil-0.0.20}/src/cecil/client.py +21 -2
- {cecil-0.0.18 → cecil-0.0.20}/src/cecil/models.py +15 -1
- cecil-0.0.20/src/cecil/version.py +1 -0
- cecil-0.0.18/src/cecil/version.py +0 -1
- {cecil-0.0.18 → cecil-0.0.20}/.editorconfig +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/.gitignore +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/CONTRIBUTING.md +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/LICENSE.txt +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/Makefile +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/README.md +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/pyproject.toml +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/src/cecil/__init__.py +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/src/cecil/errors.py +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/tests/__init__.py +0 -0
- {cecil-0.0.18 → cecil-0.0.20}/tests/test_client.py +0 -0
|
@@ -17,10 +17,12 @@ from .errors import (
|
|
|
17
17
|
)
|
|
18
18
|
from .models import (
|
|
19
19
|
AOI,
|
|
20
|
+
AOIRecord,
|
|
20
21
|
AOICreate,
|
|
21
22
|
DataRequest,
|
|
22
23
|
DataRequestCreate,
|
|
23
24
|
OrganisationCreate,
|
|
25
|
+
OrganisationSettings,
|
|
24
26
|
RecoverAPIKey,
|
|
25
27
|
RecoverAPIKeyRequest,
|
|
26
28
|
RotateAPIKey,
|
|
@@ -53,9 +55,9 @@ class Client:
|
|
|
53
55
|
res = self._get(url=f"/v0/aois/{id}")
|
|
54
56
|
return AOI(**res)
|
|
55
57
|
|
|
56
|
-
def list_aois(self) -> List[
|
|
58
|
+
def list_aois(self) -> List[AOIRecord]:
|
|
57
59
|
res = self._get(url="/v0/aois")
|
|
58
|
-
return [
|
|
60
|
+
return [AOIRecord(**record) for record in res["records"]]
|
|
59
61
|
|
|
60
62
|
def create_data_request(self, aoi_id: str, dataset_id: str) -> DataRequest:
|
|
61
63
|
res = self._post(
|
|
@@ -160,6 +162,23 @@ class Client:
|
|
|
160
162
|
res = self._get(url="/v0/users")
|
|
161
163
|
return [User(**record) for record in res["records"]]
|
|
162
164
|
|
|
165
|
+
def get_organisation_settings(self) -> OrganisationSettings:
|
|
166
|
+
res = self._get(url="/v0/organisation/settings")
|
|
167
|
+
return OrganisationSettings(**res)
|
|
168
|
+
|
|
169
|
+
def update_organisation_settings(
|
|
170
|
+
self,
|
|
171
|
+
*,
|
|
172
|
+
monthly_data_request_limit,
|
|
173
|
+
) -> OrganisationSettings:
|
|
174
|
+
res = self._post(
|
|
175
|
+
url="/v0/organisation/settings",
|
|
176
|
+
model=OrganisationSettings(
|
|
177
|
+
monthly_data_request_limit=monthly_data_request_limit,
|
|
178
|
+
),
|
|
179
|
+
)
|
|
180
|
+
return OrganisationSettings(**res)
|
|
181
|
+
|
|
163
182
|
def _request(self, method: str, url: str, skip_auth=False, **kwargs) -> Dict:
|
|
164
183
|
|
|
165
184
|
if skip_auth is False:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from typing import Dict
|
|
2
|
+
from typing import Dict, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, ConfigDict, SecretStr
|
|
5
5
|
from pydantic.alias_generators import to_camel
|
|
@@ -15,6 +15,15 @@ class AOI(BaseModel):
|
|
|
15
15
|
created_by: str
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
class AOIRecord(BaseModel):
|
|
19
|
+
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
20
|
+
id: str
|
|
21
|
+
name: str
|
|
22
|
+
hectares: float
|
|
23
|
+
created_at: datetime.datetime
|
|
24
|
+
created_by: str
|
|
25
|
+
|
|
26
|
+
|
|
18
27
|
class AOICreate(BaseModel):
|
|
19
28
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
20
29
|
name: str
|
|
@@ -41,6 +50,11 @@ class OrganisationCreate(BaseModel):
|
|
|
41
50
|
name: str
|
|
42
51
|
|
|
43
52
|
|
|
53
|
+
class OrganisationSettings(BaseModel):
|
|
54
|
+
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
55
|
+
monthly_data_request_limit: Optional[int] = None
|
|
56
|
+
|
|
57
|
+
|
|
44
58
|
class RecoverAPIKey(BaseModel):
|
|
45
59
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
46
60
|
message: str
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.20"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.18"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|