dapla-toolbelt-metadata 0.2.1__py3-none-any.whl → 0.9.11__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.

Potentially problematic release.


This version of dapla-toolbelt-metadata might be problematic. Click here for more details.

Files changed (97) hide show
  1. dapla_metadata/__init__.py +11 -1
  2. dapla_metadata/_shared/__init__.py +1 -0
  3. dapla_metadata/_shared/config.py +109 -0
  4. dapla_metadata/_shared/enums.py +27 -0
  5. dapla_metadata/_shared/py.typed +0 -0
  6. dapla_metadata/dapla/__init__.py +4 -0
  7. dapla_metadata/dapla/user_info.py +138 -0
  8. dapla_metadata/datasets/__init__.py +1 -1
  9. dapla_metadata/datasets/_merge.py +333 -0
  10. dapla_metadata/datasets/code_list.py +5 -6
  11. dapla_metadata/datasets/compatibility/__init__.py +10 -0
  12. dapla_metadata/datasets/compatibility/_handlers.py +363 -0
  13. dapla_metadata/datasets/compatibility/_utils.py +259 -0
  14. dapla_metadata/datasets/compatibility/model_backwards_compatibility.py +135 -0
  15. dapla_metadata/datasets/core.py +136 -182
  16. dapla_metadata/datasets/dapla_dataset_path_info.py +145 -19
  17. dapla_metadata/datasets/dataset_parser.py +41 -28
  18. dapla_metadata/datasets/model_validation.py +29 -20
  19. dapla_metadata/datasets/statistic_subject_mapping.py +5 -1
  20. dapla_metadata/datasets/utility/constants.py +22 -15
  21. dapla_metadata/datasets/utility/enums.py +8 -20
  22. dapla_metadata/datasets/utility/urn.py +234 -0
  23. dapla_metadata/datasets/utility/utils.py +183 -111
  24. dapla_metadata/standards/__init__.py +4 -0
  25. dapla_metadata/standards/name_validator.py +250 -0
  26. dapla_metadata/standards/standard_validators.py +98 -0
  27. dapla_metadata/standards/utils/__init__.py +1 -0
  28. dapla_metadata/standards/utils/constants.py +49 -0
  29. dapla_metadata/variable_definitions/__init__.py +11 -0
  30. dapla_metadata/variable_definitions/_generated/.openapi-generator/FILES +20 -0
  31. dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
  32. dapla_metadata/variable_definitions/_generated/.openapi-generator-ignore +6 -0
  33. dapla_metadata/variable_definitions/_generated/README.md +148 -0
  34. dapla_metadata/variable_definitions/_generated/__init__.py +0 -0
  35. dapla_metadata/variable_definitions/_generated/vardef_client/__init__.py +47 -0
  36. dapla_metadata/variable_definitions/_generated/vardef_client/api/__init__.py +8 -0
  37. dapla_metadata/variable_definitions/_generated/vardef_client/api/data_migration_api.py +766 -0
  38. dapla_metadata/variable_definitions/_generated/vardef_client/api/draft_variable_definitions_api.py +888 -0
  39. dapla_metadata/variable_definitions/_generated/vardef_client/api/patches_api.py +888 -0
  40. dapla_metadata/variable_definitions/_generated/vardef_client/api/validity_periods_api.py +583 -0
  41. dapla_metadata/variable_definitions/_generated/vardef_client/api/variable_definitions_api.py +613 -0
  42. dapla_metadata/variable_definitions/_generated/vardef_client/api_client.py +779 -0
  43. dapla_metadata/variable_definitions/_generated/vardef_client/api_response.py +27 -0
  44. dapla_metadata/variable_definitions/_generated/vardef_client/configuration.py +474 -0
  45. dapla_metadata/variable_definitions/_generated/vardef_client/docs/CompleteResponse.md +51 -0
  46. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Contact.md +30 -0
  47. dapla_metadata/variable_definitions/_generated/vardef_client/docs/DataMigrationApi.md +90 -0
  48. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Draft.md +42 -0
  49. dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
  50. dapla_metadata/variable_definitions/_generated/vardef_client/docs/LanguageStringType.md +31 -0
  51. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Owner.md +31 -0
  52. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Patch.md +43 -0
  53. dapla_metadata/variable_definitions/_generated/vardef_client/docs/PatchesApi.md +249 -0
  54. dapla_metadata/variable_definitions/_generated/vardef_client/docs/PublicApi.md +218 -0
  55. dapla_metadata/variable_definitions/_generated/vardef_client/docs/SupportedLanguages.md +15 -0
  56. dapla_metadata/variable_definitions/_generated/vardef_client/docs/UpdateDraft.md +44 -0
  57. dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriod.md +42 -0
  58. dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
  59. dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
  60. dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableStatus.md +17 -0
  61. dapla_metadata/variable_definitions/_generated/vardef_client/exceptions.py +193 -0
  62. dapla_metadata/variable_definitions/_generated/vardef_client/models/__init__.py +31 -0
  63. dapla_metadata/variable_definitions/_generated/vardef_client/models/complete_response.py +260 -0
  64. dapla_metadata/variable_definitions/_generated/vardef_client/models/contact.py +94 -0
  65. dapla_metadata/variable_definitions/_generated/vardef_client/models/draft.py +228 -0
  66. dapla_metadata/variable_definitions/_generated/vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py +158 -0
  67. dapla_metadata/variable_definitions/_generated/vardef_client/models/language_string_type.py +101 -0
  68. dapla_metadata/variable_definitions/_generated/vardef_client/models/owner.py +87 -0
  69. dapla_metadata/variable_definitions/_generated/vardef_client/models/patch.py +244 -0
  70. dapla_metadata/variable_definitions/_generated/vardef_client/models/problem.py +118 -0
  71. dapla_metadata/variable_definitions/_generated/vardef_client/models/update_draft.py +274 -0
  72. dapla_metadata/variable_definitions/_generated/vardef_client/models/validity_period.py +225 -0
  73. dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_id_response.py +81 -0
  74. dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_vardef_id_pair_response.py +84 -0
  75. dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
  76. dapla_metadata/variable_definitions/_generated/vardef_client/py.typed +0 -0
  77. dapla_metadata/variable_definitions/_generated/vardef_client/rest.py +249 -0
  78. dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
  79. dapla_metadata/variable_definitions/_utils/_client.py +32 -0
  80. dapla_metadata/variable_definitions/_utils/config.py +54 -0
  81. dapla_metadata/variable_definitions/_utils/constants.py +80 -0
  82. dapla_metadata/variable_definitions/_utils/files.py +309 -0
  83. dapla_metadata/variable_definitions/_utils/template_files.py +99 -0
  84. dapla_metadata/variable_definitions/_utils/variable_definition_files.py +143 -0
  85. dapla_metadata/variable_definitions/exceptions.py +255 -0
  86. dapla_metadata/variable_definitions/vardef.py +372 -0
  87. dapla_metadata/variable_definitions/vardok_id.py +48 -0
  88. dapla_metadata/variable_definitions/vardok_vardef_id_pair.py +47 -0
  89. dapla_metadata/variable_definitions/variable_definition.py +422 -0
  90. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/METADATA +34 -36
  91. dapla_toolbelt_metadata-0.9.11.dist-info/RECORD +97 -0
  92. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/WHEEL +1 -1
  93. dapla_metadata/datasets/config.py +0 -80
  94. dapla_metadata/datasets/model_backwards_compatibility.py +0 -520
  95. dapla_metadata/datasets/user_info.py +0 -88
  96. dapla_toolbelt_metadata-0.2.1.dist-info/RECORD +0 -22
  97. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,613 @@
1
+ """Internal Variable Definitions Administration API
2
+
3
+ ## Introduction Variable Definitions are centralized definitions of concrete variables which are typically present in multiple datasets. Variable Definitions support standardization of data and metadata and facilitate sharing and joining of data by clarifying when variables have an identical definition. ## Maintenance of Variable Definitions This API allows for creation, maintenance and access of Variable Definitions. ### Ownership Creation and maintenance of variables may only be performed by Statistics Norway employees representing a specific Dapla team, who are defined as the owners of a given Variable Definition. The team an owner represents must be specified when making a request through the `active_group` query parameter. All maintenance is to be performed by the owners, with no intervention from administrators. ### Status All Variable Definitions have an associated status. The possible values for status are `DRAFT`, `PUBLISHED_INTERNAL` and `PUBLISHED_EXTERNAL`. #### Draft When a Variable Definition is created it is assigned the status `DRAFT`. Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Mutable (it may be changed directly without need for versioning). - Not suitable to refer to from other systems. This status may be changed to `PUBLISHED_INTERNAL` or `PUBLISHED_EXTERNAL` with a direct update. #### Published Internal Under this status the Variable Definition is: - Only visible to Statistics Norway employees. - Immutable (all changes are versioned). - Suitable to refer to in internal systems for statistics production. - Not suitable to refer to for external use (for example in Statistikkbanken). This status may be changed to `PUBLISHED_EXTERNAL` by creating a Patch version. #### Published External Under this status the Variable Definition is: - Visible to the general public. - Immutable (all changes are versioned). - Suitable to refer to from any system. This status may not be changed as it would break immutability. If a Variable Definition is no longer relevant then its period of validity should be ended by specifying a `valid_until` date in a Patch version. ### Immutability Variable Definitions are immutable. This means that any changes must be performed in a strict versioning system. Consumers can avoid being exposed to breaking changes by specifying a `date_of_validity` when they request a Variable Definition. #### Patches Patches are for changes which do not affect the fundamental meaning of the Variable Definition. #### Validity Periods Validity Periods are versions with a period defined by a `valid_from` date and optionally a `valid_until` date. If the fundamental meaning of a Variable Definition is to be changed, it should be done by creating a new Validity Period.
4
+
5
+ The version of the OpenAPI document: 0.1
6
+ Contact: metadata@ssb.no
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """
11
+
12
+ from datetime import date
13
+ from typing import Annotated
14
+ from typing import Any
15
+
16
+ from pydantic import Field
17
+ from pydantic import StrictFloat
18
+ from pydantic import StrictInt
19
+ from pydantic import StrictStr
20
+ from pydantic import validate_call
21
+
22
+ from ..api_client import ApiClient
23
+ from ..api_client import RequestSerialized
24
+ from ..api_response import ApiResponse
25
+ from ..models.complete_response import CompleteResponse
26
+ from ..rest import RESTResponseType
27
+
28
+
29
+ class VariableDefinitionsApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+ @validate_call
42
+ def get_variable_definition_by_id(
43
+ self,
44
+ variable_definition_id: Annotated[
45
+ StrictStr,
46
+ Field(description="Unique identifier for the variable definition."),
47
+ ],
48
+ date_of_validity: Annotated[
49
+ date | None,
50
+ Field(
51
+ description="List only variable definitions which are valid on this date."
52
+ ),
53
+ ] = None,
54
+ _request_timeout: None
55
+ | Annotated[StrictFloat, Field(gt=0)]
56
+ | tuple[
57
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
58
+ ] = None,
59
+ _request_auth: dict[StrictStr, Any] | None = None,
60
+ _content_type: StrictStr | None = None,
61
+ _headers: dict[StrictStr, Any] | None = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> CompleteResponse:
64
+ """Get one variable definition.
65
+
66
+ Get one variable definition.
67
+
68
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
69
+ :type variable_definition_id: str
70
+ :param date_of_validity: List only variable definitions which are valid on this date.
71
+ :type date_of_validity: date
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """
93
+ _param = self._get_variable_definition_by_id_serialize(
94
+ variable_definition_id=variable_definition_id,
95
+ date_of_validity=date_of_validity,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index,
100
+ )
101
+
102
+ _response_types_map: dict[str, str | None] = {
103
+ "200": "CompleteResponse",
104
+ "404": "Problem",
105
+ }
106
+ response_data = self.api_client.call_api(
107
+ *_param, _request_timeout=_request_timeout
108
+ )
109
+ response_data.read()
110
+ return self.api_client.response_deserialize(
111
+ response_data=response_data,
112
+ response_types_map=_response_types_map,
113
+ ).data
114
+
115
+ @validate_call
116
+ def get_variable_definition_by_id_with_http_info(
117
+ self,
118
+ variable_definition_id: Annotated[
119
+ StrictStr,
120
+ Field(description="Unique identifier for the variable definition."),
121
+ ],
122
+ date_of_validity: Annotated[
123
+ date | None,
124
+ Field(
125
+ description="List only variable definitions which are valid on this date."
126
+ ),
127
+ ] = None,
128
+ _request_timeout: None
129
+ | Annotated[StrictFloat, Field(gt=0)]
130
+ | tuple[
131
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
132
+ ] = None,
133
+ _request_auth: dict[StrictStr, Any] | None = None,
134
+ _content_type: StrictStr | None = None,
135
+ _headers: dict[StrictStr, Any] | None = None,
136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
137
+ ) -> ApiResponse[CompleteResponse]:
138
+ """Get one variable definition.
139
+
140
+ Get one variable definition.
141
+
142
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
143
+ :type variable_definition_id: str
144
+ :param date_of_validity: List only variable definitions which are valid on this date.
145
+ :type date_of_validity: date
146
+ :param _request_timeout: timeout setting for this request. If one
147
+ number provided, it will be total request
148
+ timeout. It can also be a pair (tuple) of
149
+ (connection, read) timeouts.
150
+ :type _request_timeout: int, tuple(int, int), optional
151
+ :param _request_auth: set to override the auth_settings for an a single
152
+ request; this effectively ignores the
153
+ authentication in the spec for a single request.
154
+ :type _request_auth: dict, optional
155
+ :param _content_type: force content-type for the request.
156
+ :type _content_type: str, Optional
157
+ :param _headers: set to override the headers for a single
158
+ request; this effectively ignores the headers
159
+ in the spec for a single request.
160
+ :type _headers: dict, optional
161
+ :param _host_index: set to override the host_index for a single
162
+ request; this effectively ignores the host_index
163
+ in the spec for a single request.
164
+ :type _host_index: int, optional
165
+ :return: Returns the result object.
166
+ """
167
+ _param = self._get_variable_definition_by_id_serialize(
168
+ variable_definition_id=variable_definition_id,
169
+ date_of_validity=date_of_validity,
170
+ _request_auth=_request_auth,
171
+ _content_type=_content_type,
172
+ _headers=_headers,
173
+ _host_index=_host_index,
174
+ )
175
+
176
+ _response_types_map: dict[str, str | None] = {
177
+ "200": "CompleteResponse",
178
+ "404": "Problem",
179
+ }
180
+ response_data = self.api_client.call_api(
181
+ *_param, _request_timeout=_request_timeout
182
+ )
183
+ response_data.read()
184
+ return self.api_client.response_deserialize(
185
+ response_data=response_data,
186
+ response_types_map=_response_types_map,
187
+ )
188
+
189
+ @validate_call
190
+ def get_variable_definition_by_id_without_preload_content(
191
+ self,
192
+ variable_definition_id: Annotated[
193
+ StrictStr,
194
+ Field(description="Unique identifier for the variable definition."),
195
+ ],
196
+ date_of_validity: Annotated[
197
+ date | None,
198
+ Field(
199
+ description="List only variable definitions which are valid on this date."
200
+ ),
201
+ ] = None,
202
+ _request_timeout: None
203
+ | Annotated[StrictFloat, Field(gt=0)]
204
+ | tuple[
205
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
206
+ ] = None,
207
+ _request_auth: dict[StrictStr, Any] | None = None,
208
+ _content_type: StrictStr | None = None,
209
+ _headers: dict[StrictStr, Any] | None = None,
210
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
211
+ ) -> RESTResponseType:
212
+ """Get one variable definition.
213
+
214
+ Get one variable definition.
215
+
216
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
217
+ :type variable_definition_id: str
218
+ :param date_of_validity: List only variable definitions which are valid on this date.
219
+ :type date_of_validity: date
220
+ :param _request_timeout: timeout setting for this request. If one
221
+ number provided, it will be total request
222
+ timeout. It can also be a pair (tuple) of
223
+ (connection, read) timeouts.
224
+ :type _request_timeout: int, tuple(int, int), optional
225
+ :param _request_auth: set to override the auth_settings for an a single
226
+ request; this effectively ignores the
227
+ authentication in the spec for a single request.
228
+ :type _request_auth: dict, optional
229
+ :param _content_type: force content-type for the request.
230
+ :type _content_type: str, Optional
231
+ :param _headers: set to override the headers for a single
232
+ request; this effectively ignores the headers
233
+ in the spec for a single request.
234
+ :type _headers: dict, optional
235
+ :param _host_index: set to override the host_index for a single
236
+ request; this effectively ignores the host_index
237
+ in the spec for a single request.
238
+ :type _host_index: int, optional
239
+ :return: Returns the result object.
240
+ """
241
+ _param = self._get_variable_definition_by_id_serialize(
242
+ variable_definition_id=variable_definition_id,
243
+ date_of_validity=date_of_validity,
244
+ _request_auth=_request_auth,
245
+ _content_type=_content_type,
246
+ _headers=_headers,
247
+ _host_index=_host_index,
248
+ )
249
+
250
+ _response_types_map: dict[str, str | None] = {
251
+ "200": "CompleteResponse",
252
+ "404": "Problem",
253
+ }
254
+ response_data = self.api_client.call_api(
255
+ *_param, _request_timeout=_request_timeout
256
+ )
257
+ return response_data.response
258
+
259
+ def _get_variable_definition_by_id_serialize(
260
+ self,
261
+ variable_definition_id,
262
+ date_of_validity,
263
+ _request_auth,
264
+ _content_type,
265
+ _headers,
266
+ _host_index,
267
+ ) -> RequestSerialized:
268
+ _host = None
269
+
270
+ _collection_formats: dict[str, str] = {}
271
+
272
+ _path_params: dict[str, str] = {}
273
+ _query_params: list[tuple[str, str]] = []
274
+ _header_params: dict[str, str | None] = _headers or {}
275
+ _form_params: list[tuple[str, str]] = []
276
+ _files: dict[
277
+ str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
278
+ ] = {}
279
+ _body_params: bytes | None = None
280
+
281
+ # process the path parameters
282
+ if variable_definition_id is not None:
283
+ _path_params["variable-definition-id"] = variable_definition_id
284
+ # process the query parameters
285
+ if date_of_validity is not None:
286
+ if isinstance(date_of_validity, date):
287
+ _query_params.append(
288
+ (
289
+ "date_of_validity",
290
+ date_of_validity.strftime(
291
+ self.api_client.configuration.date_format
292
+ ),
293
+ )
294
+ )
295
+ else:
296
+ _query_params.append(("date_of_validity", date_of_validity))
297
+
298
+ # process the header parameters
299
+ # process the form parameters
300
+ # process the body parameter
301
+
302
+ # set the HTTP header `Accept`
303
+ if "Accept" not in _header_params:
304
+ _header_params["Accept"] = self.api_client.select_header_accept(
305
+ ["application/json", "application/problem+json"]
306
+ )
307
+
308
+ # authentication setting
309
+ _auth_settings: list[str] = ["keycloak_token"]
310
+
311
+ return self.api_client.param_serialize(
312
+ method="GET",
313
+ resource_path="/variable-definitions/{variable-definition-id}",
314
+ path_params=_path_params,
315
+ query_params=_query_params,
316
+ header_params=_header_params,
317
+ body=_body_params,
318
+ post_params=_form_params,
319
+ files=_files,
320
+ auth_settings=_auth_settings,
321
+ collection_formats=_collection_formats,
322
+ _host=_host,
323
+ _request_auth=_request_auth,
324
+ )
325
+
326
+ @validate_call
327
+ def list_variable_definitions(
328
+ self,
329
+ date_of_validity: Annotated[
330
+ date | None,
331
+ Field(
332
+ description="List only variable definitions which are valid on this date."
333
+ ),
334
+ ] = None,
335
+ short_name: Annotated[
336
+ StrictStr | None,
337
+ Field(
338
+ description="List only the variable definition with the given short name."
339
+ ),
340
+ ] = None,
341
+ _request_timeout: None
342
+ | Annotated[StrictFloat, Field(gt=0)]
343
+ | tuple[
344
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
345
+ ] = None,
346
+ _request_auth: dict[StrictStr, Any] | None = None,
347
+ _content_type: StrictStr | None = None,
348
+ _headers: dict[StrictStr, Any] | None = None,
349
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
350
+ ) -> list[CompleteResponse]:
351
+ """List all variable definitions.
352
+
353
+ List all variable definitions.
354
+
355
+ :param date_of_validity: List only variable definitions which are valid on this date.
356
+ :type date_of_validity: date
357
+ :param short_name: List only the variable definition with the given short name.
358
+ :type short_name: str
359
+ :param _request_timeout: timeout setting for this request. If one
360
+ number provided, it will be total request
361
+ timeout. It can also be a pair (tuple) of
362
+ (connection, read) timeouts.
363
+ :type _request_timeout: int, tuple(int, int), optional
364
+ :param _request_auth: set to override the auth_settings for an a single
365
+ request; this effectively ignores the
366
+ authentication in the spec for a single request.
367
+ :type _request_auth: dict, optional
368
+ :param _content_type: force content-type for the request.
369
+ :type _content_type: str, Optional
370
+ :param _headers: set to override the headers for a single
371
+ request; this effectively ignores the headers
372
+ in the spec for a single request.
373
+ :type _headers: dict, optional
374
+ :param _host_index: set to override the host_index for a single
375
+ request; this effectively ignores the host_index
376
+ in the spec for a single request.
377
+ :type _host_index: int, optional
378
+ :return: Returns the result object.
379
+ """
380
+ _param = self._list_variable_definitions_serialize(
381
+ date_of_validity=date_of_validity,
382
+ short_name=short_name,
383
+ _request_auth=_request_auth,
384
+ _content_type=_content_type,
385
+ _headers=_headers,
386
+ _host_index=_host_index,
387
+ )
388
+
389
+ _response_types_map: dict[str, str | None] = {
390
+ "200": "List[CompleteResponse]",
391
+ }
392
+ response_data = self.api_client.call_api(
393
+ *_param, _request_timeout=_request_timeout
394
+ )
395
+ response_data.read()
396
+ return self.api_client.response_deserialize(
397
+ response_data=response_data,
398
+ response_types_map=_response_types_map,
399
+ ).data
400
+
401
+ @validate_call
402
+ def list_variable_definitions_with_http_info(
403
+ self,
404
+ date_of_validity: Annotated[
405
+ date | None,
406
+ Field(
407
+ description="List only variable definitions which are valid on this date."
408
+ ),
409
+ ] = None,
410
+ short_name: Annotated[
411
+ StrictStr | None,
412
+ Field(
413
+ description="List only the variable definition with the given short name."
414
+ ),
415
+ ] = None,
416
+ _request_timeout: None
417
+ | Annotated[StrictFloat, Field(gt=0)]
418
+ | tuple[
419
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
420
+ ] = None,
421
+ _request_auth: dict[StrictStr, Any] | None = None,
422
+ _content_type: StrictStr | None = None,
423
+ _headers: dict[StrictStr, Any] | None = None,
424
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
425
+ ) -> ApiResponse[list[CompleteResponse]]:
426
+ """List all variable definitions.
427
+
428
+ List all variable definitions.
429
+
430
+ :param date_of_validity: List only variable definitions which are valid on this date.
431
+ :type date_of_validity: date
432
+ :param short_name: List only the variable definition with the given short name.
433
+ :type short_name: str
434
+ :param _request_timeout: timeout setting for this request. If one
435
+ number provided, it will be total request
436
+ timeout. It can also be a pair (tuple) of
437
+ (connection, read) timeouts.
438
+ :type _request_timeout: int, tuple(int, int), optional
439
+ :param _request_auth: set to override the auth_settings for an a single
440
+ request; this effectively ignores the
441
+ authentication in the spec for a single request.
442
+ :type _request_auth: dict, optional
443
+ :param _content_type: force content-type for the request.
444
+ :type _content_type: str, Optional
445
+ :param _headers: set to override the headers for a single
446
+ request; this effectively ignores the headers
447
+ in the spec for a single request.
448
+ :type _headers: dict, optional
449
+ :param _host_index: set to override the host_index for a single
450
+ request; this effectively ignores the host_index
451
+ in the spec for a single request.
452
+ :type _host_index: int, optional
453
+ :return: Returns the result object.
454
+ """
455
+ _param = self._list_variable_definitions_serialize(
456
+ date_of_validity=date_of_validity,
457
+ short_name=short_name,
458
+ _request_auth=_request_auth,
459
+ _content_type=_content_type,
460
+ _headers=_headers,
461
+ _host_index=_host_index,
462
+ )
463
+
464
+ _response_types_map: dict[str, str | None] = {
465
+ "200": "List[CompleteResponse]",
466
+ }
467
+ response_data = self.api_client.call_api(
468
+ *_param, _request_timeout=_request_timeout
469
+ )
470
+ response_data.read()
471
+ return self.api_client.response_deserialize(
472
+ response_data=response_data,
473
+ response_types_map=_response_types_map,
474
+ )
475
+
476
+ @validate_call
477
+ def list_variable_definitions_without_preload_content(
478
+ self,
479
+ date_of_validity: Annotated[
480
+ date | None,
481
+ Field(
482
+ description="List only variable definitions which are valid on this date."
483
+ ),
484
+ ] = None,
485
+ short_name: Annotated[
486
+ StrictStr | None,
487
+ Field(
488
+ description="List only the variable definition with the given short name."
489
+ ),
490
+ ] = None,
491
+ _request_timeout: None
492
+ | Annotated[StrictFloat, Field(gt=0)]
493
+ | tuple[
494
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
495
+ ] = None,
496
+ _request_auth: dict[StrictStr, Any] | None = None,
497
+ _content_type: StrictStr | None = None,
498
+ _headers: dict[StrictStr, Any] | None = None,
499
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
500
+ ) -> RESTResponseType:
501
+ """List all variable definitions.
502
+
503
+ List all variable definitions.
504
+
505
+ :param date_of_validity: List only variable definitions which are valid on this date.
506
+ :type date_of_validity: date
507
+ :param short_name: List only the variable definition with the given short name.
508
+ :type short_name: str
509
+ :param _request_timeout: timeout setting for this request. If one
510
+ number provided, it will be total request
511
+ timeout. It can also be a pair (tuple) of
512
+ (connection, read) timeouts.
513
+ :type _request_timeout: int, tuple(int, int), optional
514
+ :param _request_auth: set to override the auth_settings for an a single
515
+ request; this effectively ignores the
516
+ authentication in the spec for a single request.
517
+ :type _request_auth: dict, optional
518
+ :param _content_type: force content-type for the request.
519
+ :type _content_type: str, Optional
520
+ :param _headers: set to override the headers for a single
521
+ request; this effectively ignores the headers
522
+ in the spec for a single request.
523
+ :type _headers: dict, optional
524
+ :param _host_index: set to override the host_index for a single
525
+ request; this effectively ignores the host_index
526
+ in the spec for a single request.
527
+ :type _host_index: int, optional
528
+ :return: Returns the result object.
529
+ """
530
+ _param = self._list_variable_definitions_serialize(
531
+ date_of_validity=date_of_validity,
532
+ short_name=short_name,
533
+ _request_auth=_request_auth,
534
+ _content_type=_content_type,
535
+ _headers=_headers,
536
+ _host_index=_host_index,
537
+ )
538
+
539
+ _response_types_map: dict[str, str | None] = {
540
+ "200": "List[CompleteResponse]",
541
+ }
542
+ response_data = self.api_client.call_api(
543
+ *_param, _request_timeout=_request_timeout
544
+ )
545
+ return response_data.response
546
+
547
+ def _list_variable_definitions_serialize(
548
+ self,
549
+ date_of_validity,
550
+ short_name,
551
+ _request_auth,
552
+ _content_type,
553
+ _headers,
554
+ _host_index,
555
+ ) -> RequestSerialized:
556
+ _host = None
557
+
558
+ _collection_formats: dict[str, str] = {}
559
+
560
+ _path_params: dict[str, str] = {}
561
+ _query_params: list[tuple[str, str]] = []
562
+ _header_params: dict[str, str | None] = _headers or {}
563
+ _form_params: list[tuple[str, str]] = []
564
+ _files: dict[
565
+ str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
566
+ ] = {}
567
+ _body_params: bytes | None = None
568
+
569
+ # process the path parameters
570
+ # process the query parameters
571
+ if date_of_validity is not None:
572
+ if isinstance(date_of_validity, date):
573
+ _query_params.append(
574
+ (
575
+ "date_of_validity",
576
+ date_of_validity.strftime(
577
+ self.api_client.configuration.date_format
578
+ ),
579
+ )
580
+ )
581
+ else:
582
+ _query_params.append(("date_of_validity", date_of_validity))
583
+
584
+ if short_name is not None:
585
+ _query_params.append(("short_name", short_name))
586
+
587
+ # process the header parameters
588
+ # process the form parameters
589
+ # process the body parameter
590
+
591
+ # set the HTTP header `Accept`
592
+ if "Accept" not in _header_params:
593
+ _header_params["Accept"] = self.api_client.select_header_accept(
594
+ ["application/json"]
595
+ )
596
+
597
+ # authentication setting
598
+ _auth_settings: list[str] = ["keycloak_token"]
599
+
600
+ return self.api_client.param_serialize(
601
+ method="GET",
602
+ resource_path="/variable-definitions",
603
+ path_params=_path_params,
604
+ query_params=_query_params,
605
+ header_params=_header_params,
606
+ body=_body_params,
607
+ post_params=_form_params,
608
+ files=_files,
609
+ auth_settings=_auth_settings,
610
+ collection_formats=_collection_formats,
611
+ _host=_host,
612
+ _request_auth=_request_auth,
613
+ )