stackit-auditlog 0.1.1__tar.gz → 0.2.0__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 (25) hide show
  1. stackit_auditlog-0.2.0/.gitignore +267 -0
  2. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/PKG-INFO +10 -11
  3. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/pyproject.toml +49 -37
  4. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/__init__.py +1 -1
  5. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/api/default_api.py +20 -19
  6. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/api_client.py +37 -26
  7. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/configuration.py +1 -1
  8. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/exceptions.py +2 -2
  9. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/__init__.py +1 -2
  10. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/audit_log_entry_context_response.py +5 -4
  11. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/audit_log_entry_initiator_response.py +5 -4
  12. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/audit_log_entry_request_response.py +5 -4
  13. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/audit_log_entry_response.py +5 -4
  14. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/audit_log_entry_service_account_delegation_info_response.py +8 -7
  15. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/error_response.py +5 -4
  16. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/gateway_error_response.py +5 -4
  17. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/list_audit_log_entries_response.py +8 -7
  18. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/models/service_account_delegation_info_principal_response.py +5 -4
  19. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/rest.py +20 -4
  20. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/LICENSE.md +0 -0
  21. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/NOTICE.txt +0 -0
  22. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/README.md +0 -0
  23. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/api/__init__.py +0 -0
  24. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/api_response.py +0 -0
  25. {stackit_auditlog-0.1.1 → stackit_auditlog-0.2.0}/src/stackit/auditlog/py.typed +0 -0
@@ -0,0 +1,267 @@
1
+ ### VisualStudioCode template
2
+ .vscode/*
3
+ !.vscode/settings.json
4
+ !.vscode/tasks.json
5
+ !.vscode/launch.json
6
+ !.vscode/extensions.json
7
+ !.vscode/*.code-snippets
8
+
9
+ # Local History for Visual Studio Code
10
+ .history/
11
+
12
+ # Built Visual Studio Code Extensions
13
+ *.vsix
14
+
15
+ ### JetBrains template
16
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
17
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
18
+
19
+ # User-specific stuff
20
+ .idea/**/workspace.xml
21
+ .idea/**/tasks.xml
22
+ .idea/**/usage.statistics.xml
23
+ .idea/**/dictionaries
24
+ .idea/**/shelf
25
+
26
+ # AWS User-specific
27
+ .idea/**/aws.xml
28
+
29
+ # Generated files
30
+ .idea/**/contentModel.xml
31
+
32
+ # Sensitive or high-churn files
33
+ .idea/**/dataSources/
34
+ .idea/**/dataSources.ids
35
+ .idea/**/dataSources.local.xml
36
+ .idea/**/sqlDataSources.xml
37
+ .idea/**/dynamic.xml
38
+ .idea/**/uiDesigner.xml
39
+ .idea/**/dbnavigator.xml
40
+
41
+ # Gradle
42
+ .idea/**/gradle.xml
43
+ .idea/**/libraries
44
+
45
+ # Gradle and Maven with auto-import
46
+ # When using Gradle or Maven with auto-import, you should exclude module files,
47
+ # since they will be recreated, and may cause churn. Uncomment if using
48
+ # auto-import.
49
+ # .idea/artifacts
50
+ # .idea/compiler.xml
51
+ # .idea/jarRepositories.xml
52
+ # .idea/modules.xml
53
+ # .idea/*.iml
54
+ # .idea/modules
55
+ # *.iml
56
+ # *.ipr
57
+
58
+ # CMake
59
+ cmake-build-*/
60
+
61
+ # Mongo Explorer plugin
62
+ .idea/**/mongoSettings.xml
63
+
64
+ # File-based project format
65
+ *.iws
66
+
67
+ # IntelliJ
68
+ out/
69
+
70
+ # mpeltonen/sbt-idea plugin
71
+ .idea_modules/
72
+
73
+ # JIRA plugin
74
+ atlassian-ide-plugin.xml
75
+
76
+ # Cursive Clojure plugin
77
+ .idea/replstate.xml
78
+
79
+ # SonarLint plugin
80
+ .idea/sonarlint/
81
+
82
+ # Crashlytics plugin (for Android Studio and IntelliJ)
83
+ com_crashlytics_export_strings.xml
84
+ crashlytics.properties
85
+ crashlytics-build.properties
86
+ fabric.properties
87
+
88
+ # Editor-based Rest Client
89
+ .idea/httpRequests
90
+
91
+ # Android studio 3.1+ serialized cache file
92
+ .idea/caches/build_file_checksums.ser
93
+
94
+ ### VirtualEnv template
95
+ # Virtualenv
96
+ # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
97
+ .Python
98
+ [Bb]in
99
+ [Ii]nclude
100
+ [Ll]ib
101
+ [Ll]ib64
102
+ [Ll]ocal
103
+ [Ss]cripts
104
+ pyvenv.cfg
105
+ .venv
106
+ pip-selfcheck.json
107
+
108
+ ### Python template
109
+ # Byte-compiled / optimized / DLL files
110
+ __pycache__/
111
+ *.py[cod]
112
+ *$py.class
113
+
114
+ # C extensions
115
+ *.so
116
+
117
+ # Distribution / packaging
118
+ build/
119
+ develop-eggs/
120
+ dist/
121
+ downloads/
122
+ eggs/
123
+ .eggs/
124
+ lib/
125
+ lib64/
126
+ parts/
127
+ sdist/
128
+ var/
129
+ wheels/
130
+ share/python-wheels/
131
+ *.egg-info/
132
+ .installed.cfg
133
+ *.egg
134
+ MANIFEST
135
+
136
+ # PyInstaller
137
+ # Usually these files are written by a python script from a template
138
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
139
+ *.manifest
140
+ *.spec
141
+
142
+ # Installer logs
143
+ pip-log.txt
144
+ pip-delete-this-directory.txt
145
+
146
+ # Unit test / coverage reports
147
+ htmlcov/
148
+ .tox/
149
+ .nox/
150
+ .coverage
151
+ .coverage.*
152
+ .cache
153
+ nosetests.xml
154
+ coverage.xml
155
+ *.cover
156
+ *.py,cover
157
+ .hypothesis/
158
+ .pytest_cache/
159
+ cover/
160
+
161
+ # Translations
162
+ *.mo
163
+ *.pot
164
+
165
+ # Django stuff:
166
+ *.log
167
+ local_settings.py
168
+ db.sqlite3
169
+ db.sqlite3-journal
170
+
171
+ # Flask stuff:
172
+ instance/
173
+ .webassets-cache
174
+
175
+ # Scrapy stuff:
176
+ .scrapy
177
+
178
+ # Sphinx documentation
179
+ docs/_build/
180
+
181
+ # PyBuilder
182
+ .pybuilder/
183
+ target/
184
+
185
+ # Jupyter Notebook
186
+ .ipynb_checkpoints
187
+
188
+ # IPython
189
+ profile_default/
190
+ ipython_config.py
191
+
192
+ # pyenv
193
+ # For a library or package, you might want to ignore these files since the code is
194
+ # intended to run in multiple environments; otherwise, check them in:
195
+ # .python-version
196
+
197
+ # pipenv
198
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
199
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
200
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
201
+ # install all needed dependencies.
202
+ #Pipfile.lock
203
+
204
+ # poetry
205
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
206
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
207
+ # commonly ignored for libraries.
208
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
209
+ #poetry.lock
210
+
211
+ # pdm
212
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
213
+ #pdm.lock
214
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
215
+ # in version control.
216
+ # https://pdm.fming.dev/#use-with-ide
217
+ .pdm.toml
218
+
219
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
220
+ __pypackages__/
221
+
222
+ # Celery stuff
223
+ celerybeat-schedule
224
+ celerybeat.pid
225
+
226
+ # SageMath parsed files
227
+ *.sage.py
228
+
229
+ # Environments
230
+ .env
231
+ env/
232
+ venv/
233
+ ENV/
234
+ env.bak/
235
+ venv.bak/
236
+
237
+ # Spyder project settings
238
+ .spyderproject
239
+ .spyproject
240
+
241
+ # Rope project settings
242
+ .ropeproject
243
+
244
+ # mkdocs documentation
245
+ /site
246
+
247
+ # mypy
248
+ .mypy_cache/
249
+ .dmypy.json
250
+ dmypy.json
251
+
252
+ # Pyre type checker
253
+ .pyre/
254
+
255
+ # pytype static type analyzer
256
+ .pytype/
257
+
258
+ # Cython debug symbols
259
+ cython_debug/
260
+
261
+ # PyCharm
262
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
263
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
264
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
265
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
266
+ .idea/
267
+
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-auditlog
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: Audit Log API
5
+ Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
+ Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
7
+ Author-email: STACKIT Developer Tools <developer-tools@stackit.cloud>
5
8
  License-File: LICENSE.md
6
9
  License-File: NOTICE.txt
7
- Author: STACKIT Developer Tools
8
- Author-email: developer-tools@stackit.cloud
9
- Requires-Python: >=3.9,<4.0
10
10
  Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
@@ -16,12 +16,11 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.14
19
- Requires-Dist: pydantic (>=2.9.2)
20
- Requires-Dist: python-dateutil (>=2.9.0.post0)
21
- Requires-Dist: requests (>=2.32.3)
22
- Requires-Dist: stackit-core (>=0.0.1a)
23
- Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
24
- Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
19
+ Requires-Python: <4,>=3.9
20
+ Requires-Dist: pydantic>=2.9.2
21
+ Requires-Dist: python-dateutil>=2.9.0.post0
22
+ Requires-Dist: requests>=2.32.3
23
+ Requires-Dist: stackit-core>=0.0.1a
25
24
  Description-Content-Type: text/markdown
26
25
 
27
26
  # stackit.auditlog
@@ -58,4 +57,4 @@ import stackit.auditlog
58
57
 
59
58
  ## Getting Started
60
59
 
61
- [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
60
+ [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
@@ -1,55 +1,67 @@
1
1
  [project]
2
2
  name = "stackit-auditlog"
3
-
4
- [tool.poetry]
5
- name = "stackit-auditlog"
6
- version = "v0.1.1"
7
- authors = [
8
- "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
- ]
3
+ version = "v0.2.0"
10
4
  description = "Audit Log API"
5
+ authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
+ requires-python = ">=3.9,<4"
11
7
  readme = "README.md"
12
- #license = "NoLicense"
13
8
  classifiers = [
14
9
  "Programming Language :: Python :: 3",
15
10
  "License :: OSI Approved :: Apache Software License",
16
11
  "Operating System :: OS Independent",
12
+ "Programming Language :: Python :: 3.9",
13
+ "Programming Language :: Python :: 3.10",
14
+ "Programming Language :: Python :: 3.11",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Programming Language :: Python :: 3.14",
17
18
  ]
18
- packages = [
19
- { include = "stackit", from="src" }
19
+ dependencies = [
20
+ "stackit-core>=0.0.1a",
21
+ "requests>=2.32.3",
22
+ "pydantic>=2.9.2",
23
+ "python-dateutil>=2.9.0.post0",
20
24
  ]
21
25
 
22
- [tool.poetry.dependencies]
23
- python = "^3.9"
24
- stackit-core = ">=0.0.1a"
25
- requests = ">=2.32.3"
26
- pydantic = ">=2.9.2"
27
- python-dateutil = ">=2.9.0.post0"
28
-
29
- [tool.poetry.group.dev.dependencies]
30
- black = ">=24.8.0"
31
- pytest = ">=8.3.3"
32
- flake8 = [
33
- { version= ">=5.0.3", python="<3.12"},
34
- { version= ">=6.0.1", python=">=3.12"}
35
- ]
36
- flake8-black = ">=0.3.6"
37
- flake8-pyproject = ">=1.2.3"
38
- autoimport = ">=1.6.1"
39
- flake8-eol = ">=0.0.8"
40
- flake8-eradicate = ">=1.5.0"
41
- flake8-bandit = ">=4.1.1"
42
- flake8-bugbear = ">=23.1.14"
43
- flake8-quotes = ">=3.4.0"
44
- isort = ">=5.13.2"
45
-
46
26
  [project.urls]
47
27
  Homepage = "https://github.com/stackitcloud/stackit-sdk-python"
48
28
  Issues = "https://github.com/stackitcloud/stackit-sdk-python/issues"
49
29
 
30
+ [dependency-groups]
31
+ dev = [
32
+ "black>=24.8.0",
33
+ "pytest>=8.3.3",
34
+ "flake8>=5.0.3 ; python_full_version < '3.12'",
35
+ "flake8>=6.0.1 ; python_full_version >= '3.12'",
36
+ "flake8-black>=0.3.6",
37
+ "flake8-pyproject>=1.2.3",
38
+ "autoimport>=1.6.1",
39
+ "flake8-eol>=0.0.8",
40
+ "flake8-eradicate>=1.5.0",
41
+ "flake8-bandit>=4.1.1",
42
+ "flake8-bugbear>=23.1.14",
43
+ "flake8-quotes>=3.4.0",
44
+ "isort>=5.13.2",
45
+ ]
46
+
47
+ [tool.uv]
48
+ default-groups = "all"
49
+
50
+ [tool.uv.sources]
51
+ stackit-core = { path = "../../core" }
52
+
53
+ [tool.hatch.build.targets.sdist]
54
+ include = ["src/stackit"]
55
+
56
+ [tool.hatch.build.targets.wheel]
57
+ include = ["src/stackit"]
58
+
59
+ [tool.hatch.build.targets.wheel.sources]
60
+ "src/stackit" = "stackit"
61
+
50
62
  [build-system]
51
- requires = ["setuptools", "poetry-core"]
52
- build-backend = "poetry.core.masonry.api"
63
+ requires = ["hatchling"]
64
+ build-backend = "hatchling.build"
53
65
 
54
66
  [tool.pytest.ini_options]
55
67
  pythonpath = [
@@ -96,4 +108,4 @@ docstring-quotes = '"""'
96
108
  multiline-quotes = '"""'
97
109
  ban-relative-imports = true
98
110
  # Exclude generated code
99
- extend-exclude = [ "src/stackit/*/models/*", "src/stackit/*/api/*", "src/stackit/*/*.py" ]
111
+ extend-exclude = [ "src/stackit/*/models/*", "src/stackit/*/api/*", "src/stackit/*/*.py" ]
@@ -3,7 +3,7 @@
3
3
  # flake8: noqa
4
4
 
5
5
  """
6
- Audit Log API
6
+ STACKIT Audit Log API
7
7
 
8
8
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
9
9
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -13,6 +13,7 @@
13
13
 
14
14
  from datetime import datetime
15
15
  from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from uuid import UUID
16
17
 
17
18
  from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
19
  from stackit.core.configuration import Configuration
@@ -42,7 +43,7 @@ class DefaultApi:
42
43
  @validate_call
43
44
  def list_folder_audit_log_entries(
44
45
  self,
45
- folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
46
+ folder_id: Annotated[UUID, Field(description="ID of the folder for which entries should be returned.")],
46
47
  start_time_range: Annotated[
47
48
  datetime,
48
49
  Field(
@@ -86,7 +87,7 @@ class DefaultApi:
86
87
  Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
87
88
 
88
89
  :param folder_id: ID of the folder for which entries should be returned. (required)
89
- :type folder_id: str
90
+ :type folder_id: UUID
90
91
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
91
92
  :type start_time_range: datetime
92
93
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -146,7 +147,7 @@ class DefaultApi:
146
147
  @validate_call
147
148
  def list_folder_audit_log_entries_with_http_info(
148
149
  self,
149
- folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
150
+ folder_id: Annotated[UUID, Field(description="ID of the folder for which entries should be returned.")],
150
151
  start_time_range: Annotated[
151
152
  datetime,
152
153
  Field(
@@ -190,7 +191,7 @@ class DefaultApi:
190
191
  Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
191
192
 
192
193
  :param folder_id: ID of the folder for which entries should be returned. (required)
193
- :type folder_id: str
194
+ :type folder_id: UUID
194
195
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
195
196
  :type start_time_range: datetime
196
197
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -250,7 +251,7 @@ class DefaultApi:
250
251
  @validate_call
251
252
  def list_folder_audit_log_entries_without_preload_content(
252
253
  self,
253
- folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
254
+ folder_id: Annotated[UUID, Field(description="ID of the folder for which entries should be returned.")],
254
255
  start_time_range: Annotated[
255
256
  datetime,
256
257
  Field(
@@ -294,7 +295,7 @@ class DefaultApi:
294
295
  Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
295
296
 
296
297
  :param folder_id: ID of the folder for which entries should be returned. (required)
297
- :type folder_id: str
298
+ :type folder_id: UUID
298
299
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
299
300
  :type start_time_range: datetime
300
301
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -429,7 +430,7 @@ class DefaultApi:
429
430
  def list_organization_audit_log_entries(
430
431
  self,
431
432
  organization_id: Annotated[
432
- StrictStr, Field(description="ID of the organization for which entries should be returned.")
433
+ UUID, Field(description="ID of the organization for which entries should be returned.")
433
434
  ],
434
435
  start_time_range: Annotated[
435
436
  datetime,
@@ -474,7 +475,7 @@ class DefaultApi:
474
475
  Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
475
476
 
476
477
  :param organization_id: ID of the organization for which entries should be returned. (required)
477
- :type organization_id: str
478
+ :type organization_id: UUID
478
479
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
479
480
  :type start_time_range: datetime
480
481
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -535,7 +536,7 @@ class DefaultApi:
535
536
  def list_organization_audit_log_entries_with_http_info(
536
537
  self,
537
538
  organization_id: Annotated[
538
- StrictStr, Field(description="ID of the organization for which entries should be returned.")
539
+ UUID, Field(description="ID of the organization for which entries should be returned.")
539
540
  ],
540
541
  start_time_range: Annotated[
541
542
  datetime,
@@ -580,7 +581,7 @@ class DefaultApi:
580
581
  Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
581
582
 
582
583
  :param organization_id: ID of the organization for which entries should be returned. (required)
583
- :type organization_id: str
584
+ :type organization_id: UUID
584
585
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
585
586
  :type start_time_range: datetime
586
587
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -641,7 +642,7 @@ class DefaultApi:
641
642
  def list_organization_audit_log_entries_without_preload_content(
642
643
  self,
643
644
  organization_id: Annotated[
644
- StrictStr, Field(description="ID of the organization for which entries should be returned.")
645
+ UUID, Field(description="ID of the organization for which entries should be returned.")
645
646
  ],
646
647
  start_time_range: Annotated[
647
648
  datetime,
@@ -686,7 +687,7 @@ class DefaultApi:
686
687
  Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
687
688
 
688
689
  :param organization_id: ID of the organization for which entries should be returned. (required)
689
- :type organization_id: str
690
+ :type organization_id: UUID
690
691
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
691
692
  :type start_time_range: datetime
692
693
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -820,7 +821,7 @@ class DefaultApi:
820
821
  @validate_call
821
822
  def list_project_audit_log_entries(
822
823
  self,
823
- project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
824
+ project_id: Annotated[UUID, Field(description="ID of the project for which entries should be returned.")],
824
825
  start_time_range: Annotated[
825
826
  datetime,
826
827
  Field(
@@ -864,7 +865,7 @@ class DefaultApi:
864
865
  Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
865
866
 
866
867
  :param project_id: ID of the project for which entries should be returned. (required)
867
- :type project_id: str
868
+ :type project_id: UUID
868
869
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
869
870
  :type start_time_range: datetime
870
871
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -924,7 +925,7 @@ class DefaultApi:
924
925
  @validate_call
925
926
  def list_project_audit_log_entries_with_http_info(
926
927
  self,
927
- project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
928
+ project_id: Annotated[UUID, Field(description="ID of the project for which entries should be returned.")],
928
929
  start_time_range: Annotated[
929
930
  datetime,
930
931
  Field(
@@ -968,7 +969,7 @@ class DefaultApi:
968
969
  Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
969
970
 
970
971
  :param project_id: ID of the project for which entries should be returned. (required)
971
- :type project_id: str
972
+ :type project_id: UUID
972
973
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
973
974
  :type start_time_range: datetime
974
975
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -1028,7 +1029,7 @@ class DefaultApi:
1028
1029
  @validate_call
1029
1030
  def list_project_audit_log_entries_without_preload_content(
1030
1031
  self,
1031
- project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
1032
+ project_id: Annotated[UUID, Field(description="ID of the project for which entries should be returned.")],
1032
1033
  start_time_range: Annotated[
1033
1034
  datetime,
1034
1035
  Field(
@@ -1072,7 +1073,7 @@ class DefaultApi:
1072
1073
  Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
1073
1074
 
1074
1075
  :param project_id: ID of the project for which entries should be returned. (required)
1075
- :type project_id: str
1076
+ :type project_id: UUID
1076
1077
  :param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
1077
1078
  :type start_time_range: datetime
1078
1079
  :param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -12,11 +12,13 @@
12
12
  """ # noqa: E501
13
13
 
14
14
  import datetime
15
+ import decimal
15
16
  import json
16
17
  import mimetypes
17
18
  import os
18
19
  import re
19
20
  import tempfile
21
+ import uuid
20
22
  from enum import Enum
21
23
  from typing import Dict, List, Optional, Tuple, Union
22
24
  from urllib.parse import quote
@@ -63,8 +65,11 @@ class ApiClient:
63
65
  "bool": bool,
64
66
  "date": datetime.date,
65
67
  "datetime": datetime.datetime,
68
+ "decimal": decimal.Decimal,
69
+ "UUID": uuid.UUID,
66
70
  "object": object,
67
71
  }
72
+ _pool = None
68
73
 
69
74
  def __init__(self, configuration, header_name=None, header_value=None, cookie=None) -> None:
70
75
  self.config: Configuration = configuration
@@ -261,13 +266,13 @@ class ApiClient:
261
266
  response_text = None
262
267
  return_data = None
263
268
  try:
264
- if response_type == "bytearray":
269
+ if response_type in ("bytearray", "bytes"):
265
270
  return_data = response_data.data
266
271
  elif response_type == "file":
267
272
  return_data = self.__deserialize_file(response_data)
268
273
  elif response_type is not None:
269
274
  match = None
270
- content_type = response_data.getheader("content-type")
275
+ content_type = response_data.headers.get("content-type")
271
276
  if content_type is not None:
272
277
  match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
273
278
  encoding = match.group(1) if match else "utf-8"
@@ -284,7 +289,7 @@ class ApiClient:
284
289
  return ApiResponse(
285
290
  status_code=response_data.status,
286
291
  data=return_data,
287
- headers=response_data.getheaders(),
292
+ headers=response_data.headers,
288
293
  raw_data=response_data.data,
289
294
  )
290
295
 
@@ -296,6 +301,7 @@ class ApiClient:
296
301
  If obj is str, int, long, float, bool, return directly.
297
302
  If obj is datetime.datetime, datetime.date
298
303
  convert to string in iso8601 format.
304
+ If obj is decimal.Decimal return string representation.
299
305
  If obj is list, sanitize each element in the list.
300
306
  If obj is dict, return the dict.
301
307
  If obj is OpenAPI model, return the properties dict.
@@ -311,31 +317,30 @@ class ApiClient:
311
317
  return obj.get_secret_value()
312
318
  elif isinstance(obj, self.PRIMITIVE_TYPES):
313
319
  return obj
320
+ elif isinstance(obj, uuid.UUID):
321
+ return str(obj)
314
322
  elif isinstance(obj, list):
315
323
  return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
316
324
  elif isinstance(obj, tuple):
317
325
  return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
318
326
  elif isinstance(obj, (datetime.datetime, datetime.date)):
319
327
  return obj.isoformat()
320
-
328
+ elif isinstance(obj, decimal.Decimal):
329
+ return str(obj)
321
330
  elif isinstance(obj, dict):
322
- obj_dict = obj
331
+ return {key: self.sanitize_for_serialization(val) for key, val in obj.items()}
332
+
333
+ # Convert model obj to dict except
334
+ # attributes `openapi_types`, `attribute_map`
335
+ # and attributes which value is not None.
336
+ # Convert attribute name to json key in
337
+ # model definition for request.
338
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
339
+ obj_dict = obj.to_dict()
323
340
  else:
324
- # Convert model obj to dict except
325
- # attributes `openapi_types`, `attribute_map`
326
- # and attributes which value is not None.
327
- # Convert attribute name to json key in
328
- # model definition for request.
329
- if hasattr(obj, "to_dict") and callable(obj.to_dict):
330
- obj_dict = obj.to_dict()
331
- else:
332
- obj_dict = obj.__dict__
333
-
334
- if isinstance(obj_dict, list):
335
- # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501
336
- return self.sanitize_for_serialization(obj_dict)
341
+ obj_dict = obj.__dict__
337
342
 
338
- return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
343
+ return self.sanitize_for_serialization(obj_dict)
339
344
 
340
345
  def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
341
346
  """Deserializes response into an object.
@@ -354,7 +359,7 @@ class ApiClient:
354
359
  data = json.loads(response_text)
355
360
  except ValueError:
356
361
  data = response_text
357
- elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
362
+ elif re.match(r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
358
363
  if response_text == "":
359
364
  data = ""
360
365
  else:
@@ -400,12 +405,16 @@ class ApiClient:
400
405
 
401
406
  if klass in self.PRIMITIVE_TYPES:
402
407
  return self.__deserialize_primitive(data, klass)
403
- elif klass == object:
408
+ elif klass is object:
404
409
  return self.__deserialize_object(data)
405
- elif klass == datetime.date:
410
+ elif klass is datetime.date:
406
411
  return self.__deserialize_date(data)
407
- elif klass == datetime.datetime:
412
+ elif klass is datetime.datetime:
408
413
  return self.__deserialize_datetime(data)
414
+ elif klass is decimal.Decimal:
415
+ return decimal.Decimal(data)
416
+ elif klass is uuid.UUID:
417
+ return uuid.UUID(data)
409
418
  elif issubclass(klass, Enum):
410
419
  return self.__deserialize_enum(data, klass)
411
420
  else:
@@ -553,12 +562,14 @@ class ApiClient:
553
562
  os.close(fd)
554
563
  os.remove(path)
555
564
 
556
- content_disposition = response.getheader("Content-Disposition")
565
+ content_disposition = response.headers.get("Content-Disposition")
557
566
  if content_disposition:
558
567
  m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition)
559
568
  if m is None:
560
569
  raise ValueError("Unexpected 'content-disposition' header value")
561
- filename = m.group(1)
570
+ filename = os.path.basename(m.group(1)) # Strip any directory traversal
571
+ if filename in ("", ".", ".."): # fall back to tmp filename
572
+ filename = os.path.basename(path)
562
573
  path = os.path.join(os.path.dirname(path), filename)
563
574
 
564
575
  with open(path, "wb") as f:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -129,7 +129,7 @@ class ApiException(OpenApiException):
129
129
  self.body = http_resp.data.decode("utf-8")
130
130
  except Exception: # noqa: S110
131
131
  pass
132
- self.headers = http_resp.getheaders()
132
+ self.headers = http_resp.headers
133
133
 
134
134
  @classmethod
135
135
  def from_response(
@@ -2,7 +2,7 @@
2
2
 
3
3
  # flake8: noqa
4
4
  """
5
- Audit Log API
5
+ STACKIT Audit Log API
6
6
 
7
7
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
8
8
 
@@ -12,7 +12,6 @@
12
12
  Do not edit the class manually.
13
13
  """ # noqa: E501
14
14
 
15
-
16
15
  # import models into model package
17
16
  from stackit.auditlog.models.audit_log_entry_context_response import (
18
17
  AuditLogEntryContextResponse,
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -38,7 +39,8 @@ class AuditLogEntryContextResponse(BaseModel):
38
39
  __properties: ClassVar[List[str]] = ["folderId", "organizationId", "projectId"]
39
40
 
40
41
  model_config = ConfigDict(
41
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
42
44
  validate_assignment=True,
43
45
  protected_namespaces=(),
44
46
  )
@@ -49,8 +51,7 @@ class AuditLogEntryContextResponse(BaseModel):
49
51
 
50
52
  def to_json(self) -> str:
51
53
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
55
 
55
56
  @classmethod
56
57
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -33,7 +34,8 @@ class AuditLogEntryInitiatorResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["email", "id"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class AuditLogEntryInitiatorResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -38,7 +39,8 @@ class AuditLogEntryRequestResponse(BaseModel):
38
39
  __properties: ClassVar[List[str]] = ["body", "endpoint", "headers", "parameters"]
39
40
 
40
41
  model_config = ConfigDict(
41
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
42
44
  validate_assignment=True,
43
45
  protected_namespaces=(),
44
46
  )
@@ -49,8 +51,7 @@ class AuditLogEntryRequestResponse(BaseModel):
49
51
 
50
52
  def to_json(self) -> str:
51
53
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
55
 
55
56
  @classmethod
56
57
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -20,6 +20,7 @@ from datetime import datetime
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from pydantic_core import to_jsonable_python
23
24
  from typing_extensions import Annotated, Self
24
25
 
25
26
  from stackit.auditlog.models.audit_log_entry_context_response import (
@@ -167,7 +168,8 @@ class AuditLogEntryResponse(BaseModel):
167
168
  return value
168
169
 
169
170
  model_config = ConfigDict(
170
- populate_by_name=True,
171
+ validate_by_name=True,
172
+ validate_by_alias=True,
171
173
  validate_assignment=True,
172
174
  protected_namespaces=(),
173
175
  )
@@ -178,8 +180,7 @@ class AuditLogEntryResponse(BaseModel):
178
180
 
179
181
  def to_json(self) -> str:
180
182
  """Returns the JSON representation of the model using alias"""
181
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
182
- return json.dumps(self.to_dict())
183
+ return json.dumps(to_jsonable_python(self.to_dict()))
183
184
 
184
185
  @classmethod
185
186
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
  from stackit.auditlog.models.service_account_delegation_info_principal_response import (
@@ -36,7 +37,8 @@ class AuditLogEntryServiceAccountDelegationInfoResponse(BaseModel):
36
37
  __properties: ClassVar[List[str]] = ["principals"]
37
38
 
38
39
  model_config = ConfigDict(
39
- populate_by_name=True,
40
+ validate_by_name=True,
41
+ validate_by_alias=True,
40
42
  validate_assignment=True,
41
43
  protected_namespaces=(),
42
44
  )
@@ -47,8 +49,7 @@ class AuditLogEntryServiceAccountDelegationInfoResponse(BaseModel):
47
49
 
48
50
  def to_json(self) -> str:
49
51
  """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
53
 
53
54
  @classmethod
54
55
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -75,9 +76,9 @@ class AuditLogEntryServiceAccountDelegationInfoResponse(BaseModel):
75
76
  # override the default output from pydantic by calling `to_dict()` of each item in principals (list)
76
77
  _items = []
77
78
  if self.principals:
78
- for _item in self.principals:
79
- if _item:
80
- _items.append(_item.to_dict())
79
+ for _item_principals in self.principals:
80
+ if _item_principals:
81
+ _items.append(_item_principals.to_dict())
81
82
  _dict["principals"] = _items
82
83
  return _dict
83
84
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -28,6 +28,7 @@ from pydantic import (
28
28
  StrictStr,
29
29
  field_validator,
30
30
  )
31
+ from pydantic_core import to_jsonable_python
31
32
  from typing_extensions import Self
32
33
 
33
34
 
@@ -56,7 +57,8 @@ class ErrorResponse(BaseModel):
56
57
  return value
57
58
 
58
59
  model_config = ConfigDict(
59
- populate_by_name=True,
60
+ validate_by_name=True,
61
+ validate_by_alias=True,
60
62
  validate_assignment=True,
61
63
  protected_namespaces=(),
62
64
  )
@@ -67,8 +69,7 @@ class ErrorResponse(BaseModel):
67
69
 
68
70
  def to_json(self) -> str:
69
71
  """Returns the JSON representation of the model using alias"""
70
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
71
- return json.dumps(self.to_dict())
72
+ return json.dumps(to_jsonable_python(self.to_dict()))
72
73
 
73
74
  @classmethod
74
75
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -25,6 +25,7 @@ from pydantic import (
25
25
  StrictInt,
26
26
  StrictStr,
27
27
  )
28
+ from pydantic_core import to_jsonable_python
28
29
  from typing_extensions import Self
29
30
 
30
31
 
@@ -38,7 +39,8 @@ class GatewayErrorResponse(BaseModel):
38
39
  __properties: ClassVar[List[str]] = ["message", "status"]
39
40
 
40
41
  model_config = ConfigDict(
41
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
42
44
  validate_assignment=True,
43
45
  protected_namespaces=(),
44
46
  )
@@ -49,8 +51,7 @@ class GatewayErrorResponse(BaseModel):
49
51
 
50
52
  def to_json(self) -> str:
51
53
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
55
 
55
56
  @classmethod
56
57
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -25,6 +25,7 @@ from pydantic import (
25
25
  StrictInt,
26
26
  StrictStr,
27
27
  )
28
+ from pydantic_core import to_jsonable_python
28
29
  from typing_extensions import Self
29
30
 
30
31
  from stackit.auditlog.models.audit_log_entry_response import AuditLogEntryResponse
@@ -43,7 +44,8 @@ class ListAuditLogEntriesResponse(BaseModel):
43
44
  __properties: ClassVar[List[str]] = ["cursor", "items", "limit"]
44
45
 
45
46
  model_config = ConfigDict(
46
- populate_by_name=True,
47
+ validate_by_name=True,
48
+ validate_by_alias=True,
47
49
  validate_assignment=True,
48
50
  protected_namespaces=(),
49
51
  )
@@ -54,8 +56,7 @@ class ListAuditLogEntriesResponse(BaseModel):
54
56
 
55
57
  def to_json(self) -> str:
56
58
  """Returns the JSON representation of the model using alias"""
57
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
- return json.dumps(self.to_dict())
59
+ return json.dumps(to_jsonable_python(self.to_dict()))
59
60
 
60
61
  @classmethod
61
62
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -82,9 +83,9 @@ class ListAuditLogEntriesResponse(BaseModel):
82
83
  # override the default output from pydantic by calling `to_dict()` of each item in items (list)
83
84
  _items = []
84
85
  if self.items:
85
- for _item in self.items:
86
- if _item:
87
- _items.append(_item.to_dict())
86
+ for _item_items in self.items:
87
+ if _item_items:
88
+ _items.append(_item_items.to_dict())
88
89
  _dict["items"] = _items
89
90
  return _dict
90
91
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -33,7 +34,8 @@ class ServiceAccountDelegationInfoPrincipalResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["email", "id"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class ServiceAccountDelegationInfoPrincipalResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Audit Log API
4
+ STACKIT Audit Log API
5
5
 
6
6
  API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
7
7
 
@@ -38,12 +38,17 @@ class RESTResponse(io.IOBase):
38
38
  self.data = self.response.content
39
39
  return self.data
40
40
 
41
+ @property
42
+ def headers(self):
43
+ """Returns a dictionary of response headers."""
44
+ return self.response.headers
45
+
41
46
  def getheaders(self):
42
- """Returns a dictionary of the response headers."""
47
+ """Returns a dictionary of the response headers; use ``headers`` instead."""
43
48
  return self.response.headers
44
49
 
45
50
  def getheader(self, name, default=None):
46
- """Returns a given response header."""
51
+ """Returns a given response header; use ``headers.get()`` instead."""
47
52
  return self.response.headers.get(name, default)
48
53
 
49
54
 
@@ -93,6 +98,7 @@ class RESTClientObject:
93
98
  url,
94
99
  data=request_body,
95
100
  headers=headers,
101
+ timeout=_request_timeout,
96
102
  )
97
103
  elif content_type == "application/x-www-form-urlencoded":
98
104
  r = self.session.request(
@@ -100,6 +106,7 @@ class RESTClientObject:
100
106
  url,
101
107
  params=post_params,
102
108
  headers=headers,
109
+ timeout=_request_timeout,
103
110
  )
104
111
  elif content_type == "multipart/form-data":
105
112
  # must del headers['Content-Type'], or the correct
@@ -113,6 +120,7 @@ class RESTClientObject:
113
120
  url,
114
121
  files=post_params,
115
122
  headers=headers,
123
+ timeout=_request_timeout,
116
124
  )
117
125
  # Pass a `string` parameter directly in the body to support
118
126
  # other content types than JSON when `body` argument is
@@ -123,10 +131,17 @@ class RESTClientObject:
123
131
  url,
124
132
  data=body,
125
133
  headers=headers,
134
+ timeout=_request_timeout,
126
135
  )
127
136
  elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
128
137
  request_body = "true" if body else "false"
129
- r = self.session.request(method, url, data=request_body, headers=headers)
138
+ r = self.session.request(
139
+ method,
140
+ url,
141
+ data=request_body,
142
+ headers=headers,
143
+ timeout=_request_timeout,
144
+ )
130
145
  else:
131
146
  # Cannot generate the request from given parameters
132
147
  msg = """Cannot prepare a request message for provided
@@ -140,6 +155,7 @@ class RESTClientObject:
140
155
  url,
141
156
  params={},
142
157
  headers=headers,
158
+ timeout=_request_timeout,
143
159
  )
144
160
  except requests.exceptions.SSLError as e:
145
161
  msg = "\n".join([type(e).__name__, str(e)])