python3-core-api-client 5.0__tar.gz → 6.0.1__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.
Files changed (65) hide show
  1. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/PKG-INFO +1 -1
  2. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/pyproject.toml +1 -1
  3. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/connector.py +35 -0
  4. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/http.py +23 -11
  5. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/basic_authentication_realms.py +8 -14
  6. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/borg_archives.py +9 -15
  7. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/borg_repositories.py +12 -16
  8. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/certificate_managers.py +9 -15
  9. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/certificates.py +6 -12
  10. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/clusters.py +142 -256
  11. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/cmses.py +20 -26
  12. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/crons.py +7 -13
  13. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/custom_config_snippets.py +8 -14
  14. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/custom_configs.py +7 -13
  15. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/customers.py +8 -14
  16. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/daemons.py +10 -18
  17. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/database_user_grants.py +6 -12
  18. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/database_users.py +7 -13
  19. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/databases.py +10 -16
  20. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/domain_routers.py +4 -10
  21. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/firewall_groups.py +7 -13
  22. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/firewall_rules.py +6 -12
  23. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/fpm_pools.py +12 -18
  24. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/ftp_users.py +8 -14
  25. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/haproxy_listens.py +6 -12
  26. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/haproxy_listens_to_nodes.py +7 -13
  27. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/health.py +1 -1
  28. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/hosts_entries.py +6 -12
  29. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/htpasswd_files.py +6 -12
  30. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/htpasswd_users.py +7 -13
  31. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/login.py +2 -2
  32. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/logs.py +6 -18
  33. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/mail_accounts.py +8 -14
  34. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/mail_aliases.py +7 -13
  35. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/mail_domains.py +7 -13
  36. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/mail_hostnames.py +7 -13
  37. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/malwares.py +3 -9
  38. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/mariadb_encryption_keys.py +6 -12
  39. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/n8n_instances.py +7 -13
  40. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/node_add_ons.py +7 -13
  41. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/nodes.py +10 -16
  42. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/passenger_apps.py +8 -14
  43. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/redis_instances.py +7 -13
  44. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/regions.py +3 -9
  45. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/root_ssh_keys.py +7 -13
  46. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/security_txt_policies.py +8 -14
  47. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/ssh_keys.py +7 -13
  48. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/task_collections.py +2 -2
  49. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/unix_users.py +9 -15
  50. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/url_redirects.py +7 -13
  51. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/virtual_hosts.py +17 -25
  52. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/python3_core_api_client.egg-info/PKG-INFO +1 -1
  53. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/README.md +0 -0
  54. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/setup.cfg +0 -0
  55. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/__init__.py +0 -0
  56. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/_encoders.py +0 -0
  57. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/_helpers.py +0 -0
  58. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/exceptions.py +0 -0
  59. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/interfaces.py +0 -0
  60. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/models.py +0 -0
  61. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/cyberfusion/CoreApiClient/resources/__init__.py +0 -0
  62. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/python3_core_api_client.egg-info/SOURCES.txt +0 -0
  63. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/python3_core_api_client.egg-info/dependency_links.txt +0 -0
  64. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/python3_core_api_client.egg-info/requires.txt +0 -0
  65. {python3_core_api_client-5.0 → python3_core_api_client-6.0.1}/src/python3_core_api_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 5.0
3
+ Version: 6.0.1
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 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python3-core-api-client"
7
- version = "5.0"
7
+ version = "6.0.1"
8
8
  description = "Python client for Core API."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -15,6 +15,8 @@ import datetime
15
15
  import importlib.metadata
16
16
  from cyberfusion.CoreApiClient.http import Response
17
17
 
18
+ DEFAULT_PER_PAGE = 50
19
+
18
20
 
19
21
  class CoreApiClient:
20
22
  def __init__(
@@ -154,6 +156,39 @@ class CoreApiClient:
154
156
 
155
157
  return local_response
156
158
 
159
+ def send_or_fail_with_auto_pagination(
160
+ self,
161
+ method: str,
162
+ path: str,
163
+ data: Optional[dict] = None,
164
+ query_parameters: Optional[dict] = None,
165
+ *,
166
+ per_page: int = DEFAULT_PER_PAGE,
167
+ content_type: str = "application/json",
168
+ ) -> list[Response]:
169
+ query_parameters = dict(query_parameters) if query_parameters else {}
170
+
171
+ query_parameters["per_page"] = per_page
172
+
173
+ responses: list[Response] = []
174
+ page = 1
175
+
176
+ while True:
177
+ query_parameters["page"] = page
178
+
179
+ response = self.send_or_fail(
180
+ method, path, data, query_parameters, content_type=content_type
181
+ )
182
+
183
+ responses.append(response)
184
+
185
+ if "next" not in response.requests_response.links:
186
+ break
187
+
188
+ page += 1
189
+
190
+ return responses
191
+
157
192
  def get_default_requests_session(self) -> requests.sessions.Session:
158
193
  session = requests.Session()
159
194
 
@@ -32,20 +32,32 @@ class Response:
32
32
 
33
33
 
34
34
  @dataclass
35
- class DtoResponse(Generic[DtoType], Response):
35
+ class DtoResponse(Generic[DtoType]):
36
+ requests_responses: list[RequestsResponse]
36
37
  dto: DtoType
37
38
 
38
39
  @classmethod
39
- def from_response(cls, response: Response, model: type[ModelType]) -> "DtoResponse":
40
- if isinstance(response.json, list):
41
- dto = [model.model_validate(object_) for object_ in response.json]
42
- else:
43
- dto = model.model_validate(response.json)
40
+ def from_responses(
41
+ cls, responses: Response | list[Response], model: type[ModelType]
42
+ ) -> "DtoResponse":
43
+ if isinstance(responses, Response):
44
+ responses = [responses]
45
+
46
+ dto: list = []
47
+
48
+ is_list_response = False
49
+
50
+ for response in responses:
51
+ items = response.json
52
+
53
+ if isinstance(items, list):
54
+ is_list_response = True
55
+
56
+ dto.extend(model.model_validate(object_) for object_ in items)
57
+ else:
58
+ dto.append(model.model_validate(items))
44
59
 
45
60
  return cls(
46
- status_code=response.status_code,
47
- body=response.body,
48
- headers=response.headers,
49
- requests_response=response.requests_response,
50
- dto=dto,
61
+ requests_responses=[r.requests_response for r in responses],
62
+ dto=dto if is_list_response else dto[0],
51
63
  )
@@ -17,27 +17,21 @@ class BasicAuthenticationRealms(Resource):
17
17
  query_parameters={},
18
18
  )
19
19
 
20
- return DtoResponse.from_response(
20
+ return DtoResponse.from_responses(
21
21
  local_response, models.BasicAuthenticationRealmResource
22
22
  )
23
23
 
24
24
  def list_basic_authentication_realms(
25
25
  self,
26
26
  *,
27
- page: int = 1,
28
- per_page: int = 50,
29
27
  include_filters: models.BasicAuthenticationRealmsSearchRequest | None = None,
30
28
  includes: list[str] | None = None,
31
29
  ) -> DtoResponse[list[models.BasicAuthenticationRealmResource]]:
32
- local_response = self.api_connector.send_or_fail(
30
+ local_responses = self.api_connector.send_or_fail_with_auto_pagination(
33
31
  "GET",
34
32
  "/api/v1/basic-authentication-realms",
35
33
  data=None,
36
- query_parameters={
37
- "page": page,
38
- "per_page": per_page,
39
- }
40
- | (
34
+ query_parameters=(
41
35
  include_filters.model_dump(exclude_unset=True)
42
36
  if include_filters
43
37
  else {}
@@ -45,8 +39,8 @@ class BasicAuthenticationRealms(Resource):
45
39
  | construct_includes_query_parameter(includes),
46
40
  )
47
41
 
48
- return DtoResponse.from_response(
49
- local_response, models.BasicAuthenticationRealmResource
42
+ return DtoResponse.from_responses(
43
+ local_responses, models.BasicAuthenticationRealmResource
50
44
  )
51
45
 
52
46
  def read_basic_authentication_realm(
@@ -62,7 +56,7 @@ class BasicAuthenticationRealms(Resource):
62
56
  query_parameters=construct_includes_query_parameter(includes),
63
57
  )
64
58
 
65
- return DtoResponse.from_response(
59
+ return DtoResponse.from_responses(
66
60
  local_response,
67
61
  models.BasicAuthenticationRealmResource,
68
62
  )
@@ -80,7 +74,7 @@ class BasicAuthenticationRealms(Resource):
80
74
  query_parameters={},
81
75
  )
82
76
 
83
- return DtoResponse.from_response(
77
+ return DtoResponse.from_responses(
84
78
  local_response, models.BasicAuthenticationRealmResource
85
79
  )
86
80
 
@@ -96,4 +90,4 @@ class BasicAuthenticationRealms(Resource):
96
90
  query_parameters={},
97
91
  )
98
92
 
99
- return DtoResponse.from_response(local_response, models.DetailMessage)
93
+ return DtoResponse.from_responses(local_response, models.DetailMessage)
@@ -22,25 +22,19 @@ class BorgArchives(Resource):
22
22
  },
23
23
  )
24
24
 
25
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
25
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
26
26
 
27
27
  def list_borg_archives(
28
28
  self,
29
29
  *,
30
- page: int = 1,
31
- per_page: int = 50,
32
30
  include_filters: models.BorgArchivesSearchRequest | None = None,
33
31
  includes: list[str] | None = None,
34
32
  ) -> DtoResponse[list[models.BorgArchiveResource]]:
35
- local_response = self.api_connector.send_or_fail(
33
+ local_responses = self.api_connector.send_or_fail_with_auto_pagination(
36
34
  "GET",
37
35
  "/api/v1/borg-archives",
38
36
  data=None,
39
- query_parameters={
40
- "page": page,
41
- "per_page": per_page,
42
- }
43
- | (
37
+ query_parameters=(
44
38
  include_filters.model_dump(exclude_unset=True)
45
39
  if include_filters
46
40
  else {}
@@ -48,7 +42,7 @@ class BorgArchives(Resource):
48
42
  | construct_includes_query_parameter(includes),
49
43
  )
50
44
 
51
- return DtoResponse.from_response(local_response, models.BorgArchiveResource)
45
+ return DtoResponse.from_responses(local_responses, models.BorgArchiveResource)
52
46
 
53
47
  def read_borg_archive(
54
48
  self,
@@ -63,7 +57,7 @@ class BorgArchives(Resource):
63
57
  query_parameters=construct_includes_query_parameter(includes),
64
58
  )
65
59
 
66
- return DtoResponse.from_response(local_response, models.BorgArchiveResource)
60
+ return DtoResponse.from_responses(local_response, models.BorgArchiveResource)
67
61
 
68
62
  def get_borg_archive_metadata(
69
63
  self,
@@ -77,7 +71,7 @@ class BorgArchives(Resource):
77
71
  query_parameters={},
78
72
  )
79
73
 
80
- return DtoResponse.from_response(local_response, models.BorgArchiveMetadata)
74
+ return DtoResponse.from_responses(local_response, models.BorgArchiveMetadata)
81
75
 
82
76
  def restore_borg_archive(
83
77
  self,
@@ -96,7 +90,7 @@ class BorgArchives(Resource):
96
90
  },
97
91
  )
98
92
 
99
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
93
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
100
94
 
101
95
  def list_borg_archive_contents(
102
96
  self,
@@ -113,7 +107,7 @@ class BorgArchives(Resource):
113
107
  },
114
108
  )
115
109
 
116
- return DtoResponse.from_response(local_response, models.BorgArchiveContent)
110
+ return DtoResponse.from_responses(local_response, models.BorgArchiveContent)
117
111
 
118
112
  def download_borg_archive(
119
113
  self,
@@ -132,4 +126,4 @@ class BorgArchives(Resource):
132
126
  },
133
127
  )
134
128
 
135
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
129
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
@@ -18,25 +18,19 @@ class BorgRepositories(Resource):
18
18
  query_parameters={},
19
19
  )
20
20
 
21
- return DtoResponse.from_response(local_response, models.BorgRepositoryResource)
21
+ return DtoResponse.from_responses(local_response, models.BorgRepositoryResource)
22
22
 
23
23
  def list_borg_repositories(
24
24
  self,
25
25
  *,
26
- page: int = 1,
27
- per_page: int = 50,
28
26
  include_filters: models.BorgRepositoriesSearchRequest | None = None,
29
27
  includes: list[str] | None = None,
30
28
  ) -> DtoResponse[list[models.BorgRepositoryResource]]:
31
- local_response = self.api_connector.send_or_fail(
29
+ local_responses = self.api_connector.send_or_fail_with_auto_pagination(
32
30
  "GET",
33
31
  "/api/v1/borg-repositories",
34
32
  data=None,
35
- query_parameters={
36
- "page": page,
37
- "per_page": per_page,
38
- }
39
- | (
33
+ query_parameters=(
40
34
  include_filters.model_dump(exclude_unset=True)
41
35
  if include_filters
42
36
  else {}
@@ -44,7 +38,9 @@ class BorgRepositories(Resource):
44
38
  | construct_includes_query_parameter(includes),
45
39
  )
46
40
 
47
- return DtoResponse.from_response(local_response, models.BorgRepositoryResource)
41
+ return DtoResponse.from_responses(
42
+ local_responses, models.BorgRepositoryResource
43
+ )
48
44
 
49
45
  def read_borg_repository(
50
46
  self,
@@ -59,7 +55,7 @@ class BorgRepositories(Resource):
59
55
  query_parameters=construct_includes_query_parameter(includes),
60
56
  )
61
57
 
62
- return DtoResponse.from_response(local_response, models.BorgRepositoryResource)
58
+ return DtoResponse.from_responses(local_response, models.BorgRepositoryResource)
63
59
 
64
60
  def update_borg_repository(
65
61
  self,
@@ -74,7 +70,7 @@ class BorgRepositories(Resource):
74
70
  query_parameters={},
75
71
  )
76
72
 
77
- return DtoResponse.from_response(local_response, models.BorgRepositoryResource)
73
+ return DtoResponse.from_responses(local_response, models.BorgRepositoryResource)
78
74
 
79
75
  def delete_borg_repository(
80
76
  self,
@@ -88,7 +84,7 @@ class BorgRepositories(Resource):
88
84
  query_parameters={},
89
85
  )
90
86
 
91
- return DtoResponse.from_response(local_response, models.DetailMessage)
87
+ return DtoResponse.from_responses(local_response, models.DetailMessage)
92
88
 
93
89
  def prune_borg_repository(
94
90
  self,
@@ -105,7 +101,7 @@ class BorgRepositories(Resource):
105
101
  },
106
102
  )
107
103
 
108
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
104
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
109
105
 
110
106
  def check_borg_repository(
111
107
  self,
@@ -122,7 +118,7 @@ class BorgRepositories(Resource):
122
118
  },
123
119
  )
124
120
 
125
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
121
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
126
122
 
127
123
  def get_borg_archives_metadata(
128
124
  self,
@@ -136,4 +132,4 @@ class BorgRepositories(Resource):
136
132
  query_parameters={},
137
133
  )
138
134
 
139
- return DtoResponse.from_response(local_response, models.BorgArchiveMetadata)
135
+ return DtoResponse.from_responses(local_response, models.BorgArchiveMetadata)
@@ -17,27 +17,21 @@ class CertificateManagers(Resource):
17
17
  query_parameters={},
18
18
  )
19
19
 
20
- return DtoResponse.from_response(
20
+ return DtoResponse.from_responses(
21
21
  local_response, models.CertificateManagerResource
22
22
  )
23
23
 
24
24
  def list_certificate_managers(
25
25
  self,
26
26
  *,
27
- page: int = 1,
28
- per_page: int = 50,
29
27
  include_filters: models.CertificateManagersSearchRequest | None = None,
30
28
  includes: list[str] | None = None,
31
29
  ) -> DtoResponse[list[models.CertificateManagerResource]]:
32
- local_response = self.api_connector.send_or_fail(
30
+ local_responses = self.api_connector.send_or_fail_with_auto_pagination(
33
31
  "GET",
34
32
  "/api/v1/certificate-managers",
35
33
  data=None,
36
- query_parameters={
37
- "page": page,
38
- "per_page": per_page,
39
- }
40
- | (
34
+ query_parameters=(
41
35
  include_filters.model_dump(exclude_unset=True)
42
36
  if include_filters
43
37
  else {}
@@ -45,8 +39,8 @@ class CertificateManagers(Resource):
45
39
  | construct_includes_query_parameter(includes),
46
40
  )
47
41
 
48
- return DtoResponse.from_response(
49
- local_response, models.CertificateManagerResource
42
+ return DtoResponse.from_responses(
43
+ local_responses, models.CertificateManagerResource
50
44
  )
51
45
 
52
46
  def read_certificate_manager(
@@ -62,7 +56,7 @@ class CertificateManagers(Resource):
62
56
  query_parameters=construct_includes_query_parameter(includes),
63
57
  )
64
58
 
65
- return DtoResponse.from_response(
59
+ return DtoResponse.from_responses(
66
60
  local_response, models.CertificateManagerResource
67
61
  )
68
62
 
@@ -79,7 +73,7 @@ class CertificateManagers(Resource):
79
73
  query_parameters={},
80
74
  )
81
75
 
82
- return DtoResponse.from_response(
76
+ return DtoResponse.from_responses(
83
77
  local_response, models.CertificateManagerResource
84
78
  )
85
79
 
@@ -95,7 +89,7 @@ class CertificateManagers(Resource):
95
89
  query_parameters={},
96
90
  )
97
91
 
98
- return DtoResponse.from_response(local_response, models.DetailMessage)
92
+ return DtoResponse.from_responses(local_response, models.DetailMessage)
99
93
 
100
94
  def request_certificate(
101
95
  self,
@@ -109,4 +103,4 @@ class CertificateManagers(Resource):
109
103
  query_parameters={},
110
104
  )
111
105
 
112
- return DtoResponse.from_response(local_response, models.TaskCollectionResource)
106
+ return DtoResponse.from_responses(local_response, models.TaskCollectionResource)
@@ -17,25 +17,19 @@ class Certificates(Resource):
17
17
  query_parameters={},
18
18
  )
19
19
 
20
- return DtoResponse.from_response(local_response, models.CertificateResource)
20
+ return DtoResponse.from_responses(local_response, models.CertificateResource)
21
21
 
22
22
  def list_certificates(
23
23
  self,
24
24
  *,
25
- page: int = 1,
26
- per_page: int = 50,
27
25
  include_filters: models.CertificatesSearchRequest | None = None,
28
26
  includes: list[str] | None = None,
29
27
  ) -> DtoResponse[list[models.CertificateResource]]:
30
- local_response = self.api_connector.send_or_fail(
28
+ local_responses = self.api_connector.send_or_fail_with_auto_pagination(
31
29
  "GET",
32
30
  "/api/v1/certificates",
33
31
  data=None,
34
- query_parameters={
35
- "page": page,
36
- "per_page": per_page,
37
- }
38
- | (
32
+ query_parameters=(
39
33
  include_filters.model_dump(exclude_unset=True)
40
34
  if include_filters
41
35
  else {}
@@ -43,7 +37,7 @@ class Certificates(Resource):
43
37
  | construct_includes_query_parameter(includes),
44
38
  )
45
39
 
46
- return DtoResponse.from_response(local_response, models.CertificateResource)
40
+ return DtoResponse.from_responses(local_responses, models.CertificateResource)
47
41
 
48
42
  def read_certificate(
49
43
  self,
@@ -58,7 +52,7 @@ class Certificates(Resource):
58
52
  query_parameters=construct_includes_query_parameter(includes),
59
53
  )
60
54
 
61
- return DtoResponse.from_response(local_response, models.CertificateResource)
55
+ return DtoResponse.from_responses(local_response, models.CertificateResource)
62
56
 
63
57
  def delete_certificate(
64
58
  self,
@@ -69,4 +63,4 @@ class Certificates(Resource):
69
63
  "DELETE", f"/api/v1/certificates/{id_}", data=None, query_parameters={}
70
64
  )
71
65
 
72
- return DtoResponse.from_response(local_response, models.DetailMessage)
66
+ return DtoResponse.from_responses(local_response, models.DetailMessage)