python3-core-api-client 1.0.1__py3-none-any.whl → 1.0.3__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.
@@ -3,15 +3,43 @@ from __future__ import annotations
3
3
  from datetime import datetime
4
4
  from enum import StrEnum, IntEnum
5
5
  from ipaddress import IPv4Address, IPv6Address
6
- from typing import Dict, List, Literal, Optional, Union
6
+ from typing import Dict, List, Literal, Optional, Union, Any
7
7
 
8
8
  from pydantic import UUID4, AnyUrl, EmailStr, Field, confloat, conint, constr, BaseModel
9
+ from typing import Iterator
9
10
 
10
11
 
11
12
  class CoreApiModel(BaseModel):
12
13
  pass
13
14
 
14
15
 
16
+ class RootModelCollectionMixin:
17
+ """Mixin supporting iterating over and accessing items in a root model, without explicitly accessing __root__.
18
+
19
+ Inspired by https://docs.pydantic.dev/2.0/usage/models/#rootmodel-and-custom-root-types
20
+ """
21
+
22
+ __root__: dict | list | None
23
+
24
+ def __iter__(self) -> Iterator:
25
+ if not isinstance(self.__root__, (list, dict)):
26
+ raise TypeError("Type does not support iter")
27
+
28
+ return iter(self.__root__)
29
+
30
+ def __getitem__(self, item: Any) -> Any:
31
+ if not isinstance(self.__root__, (list, dict)):
32
+ raise TypeError("Type does not support getitem")
33
+
34
+ return self.__root__[item]
35
+
36
+ def items(self) -> Any:
37
+ if not isinstance(self.__root__, (dict)):
38
+ raise TypeError("Type does not support items")
39
+
40
+ return self.__root__.items()
41
+
42
+
15
43
  class APIUserAuthenticationMethod(StrEnum):
16
44
  API_KEY = "API Key"
17
45
  JWT_TOKEN = "JWT Token"
@@ -438,7 +466,7 @@ class ClusterIPAddress(CoreApiModel):
438
466
  l3_ddos_protection_enabled: bool = Field(..., title="L3 Ddos Protection Enabled")
439
467
 
440
468
 
441
- class ClusterIPAddresses(CoreApiModel):
469
+ class ClusterIPAddresses(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
442
470
  __root__: Optional[Dict[str, Dict[str, List[ClusterIPAddress]]]] = None
443
471
 
444
472
 
@@ -634,7 +662,7 @@ class CustomerIPAddressDatabase(CoreApiModel):
634
662
  dns_name: Optional[str] = Field(..., title="Dns Name")
635
663
 
636
664
 
637
- class CustomerIPAddresses(CoreApiModel):
665
+ class CustomerIPAddresses(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
638
666
  __root__: Optional[Dict[str, Dict[str, List[CustomerIPAddressDatabase]]]] = None
639
667
 
640
668
 
@@ -1380,7 +1408,7 @@ class MeilisearchEnvironmentEnum(StrEnum):
1380
1408
  DEVELOPMENT = "development"
1381
1409
 
1382
1410
 
1383
- class NestedPathsDict(CoreApiModel):
1411
+ class NestedPathsDict(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
1384
1412
  __root__: Optional[Dict[str, Optional[NestedPathsDict]]] = None
1385
1413
 
1386
1414
 
@@ -1550,6 +1578,7 @@ class PHPExtensionEnum(StrEnum):
1550
1578
  EXCIMER = "excimer"
1551
1579
  MAILPARSE = "mailparse"
1552
1580
  UV = "uv"
1581
+ AMQP = "amqp"
1553
1582
 
1554
1583
 
1555
1584
  class PHPSettings(CoreApiModel):
@@ -1569,7 +1598,7 @@ class PHPSettings(CoreApiModel):
1569
1598
  post_max_size: conint(ge=32, le=256) = Field(32, title="Post Max Size")
1570
1599
  upload_max_filesize: conint(ge=32, le=256) = Field(32, title="Upload Max Filesize")
1571
1600
  tideways_api_key: Optional[
1572
- constr(regex=r"^[a-zA-Z0-9]+$", min_length=16, max_length=16)
1601
+ constr(regex=r"^[a-zA-Z0-9]+$", min_length=16, max_length=32)
1573
1602
  ] = Field(None, title="Tideways Api Key")
1574
1603
  tideways_sample_rate: Optional[conint(ge=1, le=100)] = Field(
1575
1604
  None, title="Tideways Sample Rate"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Python client for Core API.
5
5
  Author-email: Cyberfusion <support@cyberfusion.io>
6
6
  Project-URL: Source, https://github.com/CyberfusionIO/python3-core-api-client
@@ -4,7 +4,7 @@ cyberfusion/CoreApiClient/connector.py,sha256=7yQs9fH8ldGHpw41xHU07NkXD5OPm3_pjc
4
4
  cyberfusion/CoreApiClient/exceptions.py,sha256=fNxPtzVL4SzPiVNZmBTu1l8D57dkCxMxflyIXDPLE4Q,204
5
5
  cyberfusion/CoreApiClient/http.py,sha256=z6ZyfQyUnA3QDCmej2BEIw9BOlTYoCE8zvTZ0-u_VoQ,429
6
6
  cyberfusion/CoreApiClient/interfaces.py,sha256=P0wCbmSNEpB-eF49PHudc_qXM4blIXm4TsD2AB0z_7Q,269
7
- cyberfusion/CoreApiClient/models.py,sha256=PGZlyBMaCgyar_ILM9hgJZukWIspSGT-1TcpaqFiBcw,267284
7
+ cyberfusion/CoreApiClient/models.py,sha256=nk7VIt4LqEOQxXKB2QIztHKAVNvdZvXGdi5gTcksURk,268325
8
8
  cyberfusion/CoreApiClient/resources/__init__.py,sha256=E5VMFXttOmN7TjJt0WeARL_tYVoJcLoRoOnIYkCF748,1881
9
9
  cyberfusion/CoreApiClient/resources/basic_authentication_realms.py,sha256=A0B4auQlBSV-kYrww613PwozMey-VsROguycrQBxB4E,2739
10
10
  cyberfusion/CoreApiClient/resources/borg_archives.py,sha256=Dj5seJanmRYZZFSnaagJBkfR7LL-uYO5vpbjody-y0g,4346
@@ -53,7 +53,7 @@ cyberfusion/CoreApiClient/resources/tombstones.py,sha256=brtaywIKuIHfzrhAQSg8wtx
53
53
  cyberfusion/CoreApiClient/resources/unix_users.py,sha256=64j14_pfh4jWgM1hzJUYCicHcYQ7CT84cFzePCp0zTg,3622
54
54
  cyberfusion/CoreApiClient/resources/url_redirects.py,sha256=GBUin-MRtkuKk9191-8EsYc6iZf5X2cMOk_Y-xleW2s,2358
55
55
  cyberfusion/CoreApiClient/resources/virtual_hosts.py,sha256=ZwlymtfSp8sMtglm8iGrUb7wpw4cGtFU6h5b7HTu9Kw,3702
56
- python3_core_api_client-1.0.1.dist-info/METADATA,sha256=nfU7o0rtVJ3rIMR3bJcbuhIrjFhRvR69z5IMAiUKO3w,7031
57
- python3_core_api_client-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
- python3_core_api_client-1.0.1.dist-info/top_level.txt,sha256=ss011q9S6SL_KIIyq7iujFmIYa0grSjlnInO7cDkeag,12
59
- python3_core_api_client-1.0.1.dist-info/RECORD,,
56
+ python3_core_api_client-1.0.3.dist-info/METADATA,sha256=mW06GlleEtvRcVYTeR8CHQ_tTYtDxDmsSmtQxzLBBXg,7031
57
+ python3_core_api_client-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
+ python3_core_api_client-1.0.3.dist-info/top_level.txt,sha256=ss011q9S6SL_KIIyq7iujFmIYa0grSjlnInO7cDkeag,12
59
+ python3_core_api_client-1.0.3.dist-info/RECORD,,