dapla-toolbelt-metadata 0.2.6__py3-none-any.whl → 0.4.0__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 (69) hide show
  1. dapla_metadata/__init__.py +1 -0
  2. dapla_metadata/_shared/__init__.py +1 -0
  3. dapla_metadata/{datasets → _shared}/config.py +42 -11
  4. dapla_metadata/_shared/enums.py +28 -0
  5. dapla_metadata/{datasets → _shared}/user_info.py +30 -3
  6. dapla_metadata/datasets/core.py +4 -2
  7. dapla_metadata/datasets/utility/enums.py +0 -19
  8. dapla_metadata/datasets/utility/utils.py +13 -0
  9. dapla_metadata/variable_definitions/__init__.py +7 -0
  10. dapla_metadata/variable_definitions/_client.py +30 -0
  11. dapla_metadata/variable_definitions/config.py +49 -0
  12. dapla_metadata/variable_definitions/exceptions.py +66 -0
  13. dapla_metadata/variable_definitions/generated/.openapi-generator/FILES +22 -0
  14. dapla_metadata/variable_definitions/generated/.openapi-generator/VERSION +1 -0
  15. dapla_metadata/variable_definitions/generated/.openapi-generator-ignore +6 -0
  16. dapla_metadata/variable_definitions/generated/README.md +148 -0
  17. dapla_metadata/variable_definitions/generated/__init__.py +0 -0
  18. dapla_metadata/variable_definitions/generated/vardef_client/__init__.py +52 -0
  19. dapla_metadata/variable_definitions/generated/vardef_client/api/__init__.py +9 -0
  20. dapla_metadata/variable_definitions/generated/vardef_client/api/data_migration_api.py +313 -0
  21. dapla_metadata/variable_definitions/generated/vardef_client/api/draft_variable_definitions_api.py +919 -0
  22. dapla_metadata/variable_definitions/generated/vardef_client/api/patches_api.py +919 -0
  23. dapla_metadata/variable_definitions/generated/vardef_client/api/public_api.py +915 -0
  24. dapla_metadata/variable_definitions/generated/vardef_client/api/validity_periods_api.py +876 -0
  25. dapla_metadata/variable_definitions/generated/vardef_client/api/variable_definitions_api.py +1205 -0
  26. dapla_metadata/variable_definitions/generated/vardef_client/api_client.py +779 -0
  27. dapla_metadata/variable_definitions/generated/vardef_client/api_response.py +27 -0
  28. dapla_metadata/variable_definitions/generated/vardef_client/configuration.py +474 -0
  29. dapla_metadata/variable_definitions/generated/vardef_client/docs/CompleteResponse.md +51 -0
  30. dapla_metadata/variable_definitions/generated/vardef_client/docs/Contact.md +30 -0
  31. dapla_metadata/variable_definitions/generated/vardef_client/docs/DataMigrationApi.md +90 -0
  32. dapla_metadata/variable_definitions/generated/vardef_client/docs/Draft.md +42 -0
  33. dapla_metadata/variable_definitions/generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
  34. dapla_metadata/variable_definitions/generated/vardef_client/docs/LanguageStringType.md +31 -0
  35. dapla_metadata/variable_definitions/generated/vardef_client/docs/Owner.md +31 -0
  36. dapla_metadata/variable_definitions/generated/vardef_client/docs/Patch.md +43 -0
  37. dapla_metadata/variable_definitions/generated/vardef_client/docs/PatchesApi.md +249 -0
  38. dapla_metadata/variable_definitions/generated/vardef_client/docs/PublicApi.md +218 -0
  39. dapla_metadata/variable_definitions/generated/vardef_client/docs/SupportedLanguages.md +15 -0
  40. dapla_metadata/variable_definitions/generated/vardef_client/docs/UpdateDraft.md +44 -0
  41. dapla_metadata/variable_definitions/generated/vardef_client/docs/ValidityPeriod.md +42 -0
  42. dapla_metadata/variable_definitions/generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
  43. dapla_metadata/variable_definitions/generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
  44. dapla_metadata/variable_definitions/generated/vardef_client/docs/VariableStatus.md +17 -0
  45. dapla_metadata/variable_definitions/generated/vardef_client/exceptions.py +193 -0
  46. dapla_metadata/variable_definitions/generated/vardef_client/models/__init__.py +30 -0
  47. dapla_metadata/variable_definitions/generated/vardef_client/models/complete_response.py +284 -0
  48. dapla_metadata/variable_definitions/generated/vardef_client/models/contact.py +94 -0
  49. dapla_metadata/variable_definitions/generated/vardef_client/models/draft.py +243 -0
  50. dapla_metadata/variable_definitions/generated/vardef_client/models/klass_reference.py +99 -0
  51. dapla_metadata/variable_definitions/generated/vardef_client/models/language_string_type.py +104 -0
  52. dapla_metadata/variable_definitions/generated/vardef_client/models/owner.py +90 -0
  53. dapla_metadata/variable_definitions/generated/vardef_client/models/patch.py +289 -0
  54. dapla_metadata/variable_definitions/generated/vardef_client/models/problem.py +118 -0
  55. dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_contact.py +92 -0
  56. dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_variable_definition.py +235 -0
  57. dapla_metadata/variable_definitions/generated/vardef_client/models/supported_languages.py +33 -0
  58. dapla_metadata/variable_definitions/generated/vardef_client/models/update_draft.py +307 -0
  59. dapla_metadata/variable_definitions/generated/vardef_client/models/validity_period.py +259 -0
  60. dapla_metadata/variable_definitions/generated/vardef_client/models/variable_status.py +33 -0
  61. dapla_metadata/variable_definitions/generated/vardef_client/py.typed +0 -0
  62. dapla_metadata/variable_definitions/generated/vardef_client/rest.py +249 -0
  63. dapla_metadata/variable_definitions/vardef.py +173 -0
  64. dapla_metadata/variable_definitions/variable_definition.py +212 -0
  65. {dapla_toolbelt_metadata-0.2.6.dist-info → dapla_toolbelt_metadata-0.4.0.dist-info}/METADATA +1 -1
  66. dapla_toolbelt_metadata-0.4.0.dist-info/RECORD +80 -0
  67. dapla_toolbelt_metadata-0.2.6.dist-info/RECORD +0 -22
  68. {dapla_toolbelt_metadata-0.2.6.dist-info → dapla_toolbelt_metadata-0.4.0.dist-info}/LICENSE +0 -0
  69. {dapla_toolbelt_metadata-0.2.6.dist-info → dapla_toolbelt_metadata-0.4.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1205 @@
1
+ """Variable Definitions
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 ..models.rendered_variable_definition import RenderedVariableDefinition
27
+ from ..models.supported_languages import SupportedLanguages
28
+ from ..rest import RESTResponseType
29
+
30
+
31
+ class VariableDefinitionsApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+ @validate_call
44
+ def get_public_variable_definition_by_id(
45
+ self,
46
+ variable_definition_id: Annotated[
47
+ StrictStr,
48
+ Field(description="Unique identifier for the variable definition."),
49
+ ],
50
+ accept_language: Annotated[
51
+ SupportedLanguages,
52
+ Field(description="Render the variable definition in the given language."),
53
+ ],
54
+ date_of_validity: Annotated[
55
+ date | None,
56
+ Field(
57
+ description="List only variable definitions which are valid on this date."
58
+ ),
59
+ ] = None,
60
+ _request_timeout: None
61
+ | Annotated[StrictFloat, Field(gt=0)]
62
+ | tuple[
63
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
64
+ ] = None,
65
+ _request_auth: dict[StrictStr, Any] | None = None,
66
+ _content_type: StrictStr | None = None,
67
+ _headers: dict[StrictStr, Any] | None = None,
68
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
69
+ ) -> RenderedVariableDefinition:
70
+ """Get one variable definition.
71
+
72
+ Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
73
+
74
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
75
+ :type variable_definition_id: str
76
+ :param accept_language: Render the variable definition in the given language. (required)
77
+ :type accept_language: SupportedLanguages
78
+ :param date_of_validity: List only variable definitions which are valid on this date.
79
+ :type date_of_validity: date
80
+ :param _request_timeout: timeout setting for this request. If one
81
+ number provided, it will be total request
82
+ timeout. It can also be a pair (tuple) of
83
+ (connection, read) timeouts.
84
+ :type _request_timeout: int, tuple(int, int), optional
85
+ :param _request_auth: set to override the auth_settings for an a single
86
+ request; this effectively ignores the
87
+ authentication in the spec for a single request.
88
+ :type _request_auth: dict, optional
89
+ :param _content_type: force content-type for the request.
90
+ :type _content_type: str, Optional
91
+ :param _headers: set to override the headers for a single
92
+ request; this effectively ignores the headers
93
+ in the spec for a single request.
94
+ :type _headers: dict, optional
95
+ :param _host_index: set to override the host_index for a single
96
+ request; this effectively ignores the host_index
97
+ in the spec for a single request.
98
+ :type _host_index: int, optional
99
+ :return: Returns the result object.
100
+ """
101
+ _param = self._get_public_variable_definition_by_id_serialize(
102
+ variable_definition_id=variable_definition_id,
103
+ accept_language=accept_language,
104
+ date_of_validity=date_of_validity,
105
+ _request_auth=_request_auth,
106
+ _content_type=_content_type,
107
+ _headers=_headers,
108
+ _host_index=_host_index,
109
+ )
110
+
111
+ _response_types_map: dict[str, str | None] = {
112
+ "200": "RenderedVariableDefinition",
113
+ "404": "Problem",
114
+ }
115
+ response_data = self.api_client.call_api(
116
+ *_param,
117
+ _request_timeout=_request_timeout,
118
+ )
119
+ response_data.read()
120
+ return self.api_client.response_deserialize(
121
+ response_data=response_data,
122
+ response_types_map=_response_types_map,
123
+ ).data
124
+
125
+ @validate_call
126
+ def get_public_variable_definition_by_id_with_http_info(
127
+ self,
128
+ variable_definition_id: Annotated[
129
+ StrictStr,
130
+ Field(description="Unique identifier for the variable definition."),
131
+ ],
132
+ accept_language: Annotated[
133
+ SupportedLanguages,
134
+ Field(description="Render the variable definition in the given language."),
135
+ ],
136
+ date_of_validity: Annotated[
137
+ date | None,
138
+ Field(
139
+ description="List only variable definitions which are valid on this date."
140
+ ),
141
+ ] = None,
142
+ _request_timeout: None
143
+ | Annotated[StrictFloat, Field(gt=0)]
144
+ | tuple[
145
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
146
+ ] = None,
147
+ _request_auth: dict[StrictStr, Any] | None = None,
148
+ _content_type: StrictStr | None = None,
149
+ _headers: dict[StrictStr, Any] | None = None,
150
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
151
+ ) -> ApiResponse[RenderedVariableDefinition]:
152
+ """Get one variable definition.
153
+
154
+ Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
155
+
156
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
157
+ :type variable_definition_id: str
158
+ :param accept_language: Render the variable definition in the given language. (required)
159
+ :type accept_language: SupportedLanguages
160
+ :param date_of_validity: List only variable definitions which are valid on this date.
161
+ :type date_of_validity: date
162
+ :param _request_timeout: timeout setting for this request. If one
163
+ number provided, it will be total request
164
+ timeout. It can also be a pair (tuple) of
165
+ (connection, read) timeouts.
166
+ :type _request_timeout: int, tuple(int, int), optional
167
+ :param _request_auth: set to override the auth_settings for an a single
168
+ request; this effectively ignores the
169
+ authentication in the spec for a single request.
170
+ :type _request_auth: dict, optional
171
+ :param _content_type: force content-type for the request.
172
+ :type _content_type: str, Optional
173
+ :param _headers: set to override the headers for a single
174
+ request; this effectively ignores the headers
175
+ in the spec for a single request.
176
+ :type _headers: dict, optional
177
+ :param _host_index: set to override the host_index for a single
178
+ request; this effectively ignores the host_index
179
+ in the spec for a single request.
180
+ :type _host_index: int, optional
181
+ :return: Returns the result object.
182
+ """
183
+ _param = self._get_public_variable_definition_by_id_serialize(
184
+ variable_definition_id=variable_definition_id,
185
+ accept_language=accept_language,
186
+ date_of_validity=date_of_validity,
187
+ _request_auth=_request_auth,
188
+ _content_type=_content_type,
189
+ _headers=_headers,
190
+ _host_index=_host_index,
191
+ )
192
+
193
+ _response_types_map: dict[str, str | None] = {
194
+ "200": "RenderedVariableDefinition",
195
+ "404": "Problem",
196
+ }
197
+ response_data = self.api_client.call_api(
198
+ *_param,
199
+ _request_timeout=_request_timeout,
200
+ )
201
+ response_data.read()
202
+ return self.api_client.response_deserialize(
203
+ response_data=response_data,
204
+ response_types_map=_response_types_map,
205
+ )
206
+
207
+ @validate_call
208
+ def get_public_variable_definition_by_id_without_preload_content(
209
+ self,
210
+ variable_definition_id: Annotated[
211
+ StrictStr,
212
+ Field(description="Unique identifier for the variable definition."),
213
+ ],
214
+ accept_language: Annotated[
215
+ SupportedLanguages,
216
+ Field(description="Render the variable definition in the given language."),
217
+ ],
218
+ date_of_validity: Annotated[
219
+ date | None,
220
+ Field(
221
+ description="List only variable definitions which are valid on this date."
222
+ ),
223
+ ] = None,
224
+ _request_timeout: None
225
+ | Annotated[StrictFloat, Field(gt=0)]
226
+ | tuple[
227
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
228
+ ] = None,
229
+ _request_auth: dict[StrictStr, Any] | None = None,
230
+ _content_type: StrictStr | None = None,
231
+ _headers: dict[StrictStr, Any] | None = None,
232
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
233
+ ) -> RESTResponseType:
234
+ """Get one variable definition.
235
+
236
+ Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
237
+
238
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
239
+ :type variable_definition_id: str
240
+ :param accept_language: Render the variable definition in the given language. (required)
241
+ :type accept_language: SupportedLanguages
242
+ :param date_of_validity: List only variable definitions which are valid on this date.
243
+ :type date_of_validity: date
244
+ :param _request_timeout: timeout setting for this request. If one
245
+ number provided, it will be total request
246
+ timeout. It can also be a pair (tuple) of
247
+ (connection, read) timeouts.
248
+ :type _request_timeout: int, tuple(int, int), optional
249
+ :param _request_auth: set to override the auth_settings for an a single
250
+ request; this effectively ignores the
251
+ authentication in the spec for a single request.
252
+ :type _request_auth: dict, optional
253
+ :param _content_type: force content-type for the request.
254
+ :type _content_type: str, Optional
255
+ :param _headers: set to override the headers for a single
256
+ request; this effectively ignores the headers
257
+ in the spec for a single request.
258
+ :type _headers: dict, optional
259
+ :param _host_index: set to override the host_index for a single
260
+ request; this effectively ignores the host_index
261
+ in the spec for a single request.
262
+ :type _host_index: int, optional
263
+ :return: Returns the result object.
264
+ """
265
+ _param = self._get_public_variable_definition_by_id_serialize(
266
+ variable_definition_id=variable_definition_id,
267
+ accept_language=accept_language,
268
+ date_of_validity=date_of_validity,
269
+ _request_auth=_request_auth,
270
+ _content_type=_content_type,
271
+ _headers=_headers,
272
+ _host_index=_host_index,
273
+ )
274
+
275
+ _response_types_map: dict[str, str | None] = {
276
+ "200": "RenderedVariableDefinition",
277
+ "404": "Problem",
278
+ }
279
+ response_data = self.api_client.call_api(
280
+ *_param,
281
+ _request_timeout=_request_timeout,
282
+ )
283
+ return response_data.response
284
+
285
+ def _get_public_variable_definition_by_id_serialize(
286
+ self,
287
+ variable_definition_id,
288
+ accept_language,
289
+ date_of_validity,
290
+ _request_auth,
291
+ _content_type,
292
+ _headers,
293
+ _host_index,
294
+ ) -> RequestSerialized:
295
+ _host = None
296
+
297
+ _collection_formats: dict[str, str] = {}
298
+
299
+ _path_params: dict[str, str] = {}
300
+ _query_params: list[tuple[str, str]] = []
301
+ _header_params: dict[str, str | None] = _headers or {}
302
+ _form_params: list[tuple[str, str]] = []
303
+ _files: dict[
304
+ str,
305
+ str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]],
306
+ ] = {}
307
+ _body_params: bytes | None = None
308
+
309
+ # process the path parameters
310
+ if variable_definition_id is not None:
311
+ _path_params["variable-definition-id"] = variable_definition_id
312
+ # process the query parameters
313
+ if date_of_validity is not None:
314
+ if isinstance(date_of_validity, date):
315
+ _query_params.append(
316
+ (
317
+ "date_of_validity",
318
+ date_of_validity.strftime(
319
+ self.api_client.configuration.date_format,
320
+ ),
321
+ ),
322
+ )
323
+ else:
324
+ _query_params.append(("date_of_validity", date_of_validity))
325
+
326
+ # process the header parameters
327
+ if accept_language is not None:
328
+ _header_params["Accept-Language"] = accept_language
329
+ # process the form parameters
330
+ # process the body parameter
331
+
332
+ # set the HTTP header `Accept`
333
+ if "Accept" not in _header_params:
334
+ _header_params["Accept"] = self.api_client.select_header_accept(
335
+ [
336
+ "application/json",
337
+ "application/problem+json",
338
+ ],
339
+ )
340
+
341
+ # authentication setting
342
+ _auth_settings: list[str] = []
343
+
344
+ return self.api_client.param_serialize(
345
+ method="GET",
346
+ resource_path="/public/variable-definitions/{variable-definition-id}",
347
+ path_params=_path_params,
348
+ query_params=_query_params,
349
+ header_params=_header_params,
350
+ body=_body_params,
351
+ post_params=_form_params,
352
+ files=_files,
353
+ auth_settings=_auth_settings,
354
+ collection_formats=_collection_formats,
355
+ _host=_host,
356
+ _request_auth=_request_auth,
357
+ )
358
+
359
+ @validate_call
360
+ def get_variable_definition_by_id(
361
+ self,
362
+ variable_definition_id: Annotated[
363
+ StrictStr,
364
+ Field(description="Unique identifier for the variable definition."),
365
+ ],
366
+ date_of_validity: Annotated[
367
+ date | None,
368
+ Field(
369
+ description="List only variable definitions which are valid on this date."
370
+ ),
371
+ ] = None,
372
+ _request_timeout: None
373
+ | Annotated[StrictFloat, Field(gt=0)]
374
+ | tuple[
375
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
376
+ ] = None,
377
+ _request_auth: dict[StrictStr, Any] | None = None,
378
+ _content_type: StrictStr | None = None,
379
+ _headers: dict[StrictStr, Any] | None = None,
380
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
381
+ ) -> CompleteResponse:
382
+ """Get one variable definition.
383
+
384
+ Get one variable definition.
385
+
386
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
387
+ :type variable_definition_id: str
388
+ :param date_of_validity: List only variable definitions which are valid on this date.
389
+ :type date_of_validity: date
390
+ :param _request_timeout: timeout setting for this request. If one
391
+ number provided, it will be total request
392
+ timeout. It can also be a pair (tuple) of
393
+ (connection, read) timeouts.
394
+ :type _request_timeout: int, tuple(int, int), optional
395
+ :param _request_auth: set to override the auth_settings for an a single
396
+ request; this effectively ignores the
397
+ authentication in the spec for a single request.
398
+ :type _request_auth: dict, optional
399
+ :param _content_type: force content-type for the request.
400
+ :type _content_type: str, Optional
401
+ :param _headers: set to override the headers for a single
402
+ request; this effectively ignores the headers
403
+ in the spec for a single request.
404
+ :type _headers: dict, optional
405
+ :param _host_index: set to override the host_index for a single
406
+ request; this effectively ignores the host_index
407
+ in the spec for a single request.
408
+ :type _host_index: int, optional
409
+ :return: Returns the result object.
410
+ """
411
+ _param = self._get_variable_definition_by_id_serialize(
412
+ variable_definition_id=variable_definition_id,
413
+ date_of_validity=date_of_validity,
414
+ _request_auth=_request_auth,
415
+ _content_type=_content_type,
416
+ _headers=_headers,
417
+ _host_index=_host_index,
418
+ )
419
+
420
+ _response_types_map: dict[str, str | None] = {
421
+ "200": "CompleteResponse",
422
+ "404": "Problem",
423
+ }
424
+ response_data = self.api_client.call_api(
425
+ *_param,
426
+ _request_timeout=_request_timeout,
427
+ )
428
+ response_data.read()
429
+ return self.api_client.response_deserialize(
430
+ response_data=response_data,
431
+ response_types_map=_response_types_map,
432
+ ).data
433
+
434
+ @validate_call
435
+ def get_variable_definition_by_id_with_http_info(
436
+ self,
437
+ variable_definition_id: Annotated[
438
+ StrictStr,
439
+ Field(description="Unique identifier for the variable definition."),
440
+ ],
441
+ date_of_validity: Annotated[
442
+ date | None,
443
+ Field(
444
+ description="List only variable definitions which are valid on this date."
445
+ ),
446
+ ] = None,
447
+ _request_timeout: None
448
+ | Annotated[StrictFloat, Field(gt=0)]
449
+ | tuple[
450
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
451
+ ] = None,
452
+ _request_auth: dict[StrictStr, Any] | None = None,
453
+ _content_type: StrictStr | None = None,
454
+ _headers: dict[StrictStr, Any] | None = None,
455
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
456
+ ) -> ApiResponse[CompleteResponse]:
457
+ """Get one variable definition.
458
+
459
+ Get one variable definition.
460
+
461
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
462
+ :type variable_definition_id: str
463
+ :param date_of_validity: List only variable definitions which are valid on this date.
464
+ :type date_of_validity: date
465
+ :param _request_timeout: timeout setting for this request. If one
466
+ number provided, it will be total request
467
+ timeout. It can also be a pair (tuple) of
468
+ (connection, read) timeouts.
469
+ :type _request_timeout: int, tuple(int, int), optional
470
+ :param _request_auth: set to override the auth_settings for an a single
471
+ request; this effectively ignores the
472
+ authentication in the spec for a single request.
473
+ :type _request_auth: dict, optional
474
+ :param _content_type: force content-type for the request.
475
+ :type _content_type: str, Optional
476
+ :param _headers: set to override the headers for a single
477
+ request; this effectively ignores the headers
478
+ in the spec for a single request.
479
+ :type _headers: dict, optional
480
+ :param _host_index: set to override the host_index for a single
481
+ request; this effectively ignores the host_index
482
+ in the spec for a single request.
483
+ :type _host_index: int, optional
484
+ :return: Returns the result object.
485
+ """
486
+ _param = self._get_variable_definition_by_id_serialize(
487
+ variable_definition_id=variable_definition_id,
488
+ date_of_validity=date_of_validity,
489
+ _request_auth=_request_auth,
490
+ _content_type=_content_type,
491
+ _headers=_headers,
492
+ _host_index=_host_index,
493
+ )
494
+
495
+ _response_types_map: dict[str, str | None] = {
496
+ "200": "CompleteResponse",
497
+ "404": "Problem",
498
+ }
499
+ response_data = self.api_client.call_api(
500
+ *_param,
501
+ _request_timeout=_request_timeout,
502
+ )
503
+ response_data.read()
504
+ return self.api_client.response_deserialize(
505
+ response_data=response_data,
506
+ response_types_map=_response_types_map,
507
+ )
508
+
509
+ @validate_call
510
+ def get_variable_definition_by_id_without_preload_content(
511
+ self,
512
+ variable_definition_id: Annotated[
513
+ StrictStr,
514
+ Field(description="Unique identifier for the variable definition."),
515
+ ],
516
+ date_of_validity: Annotated[
517
+ date | None,
518
+ Field(
519
+ description="List only variable definitions which are valid on this date."
520
+ ),
521
+ ] = None,
522
+ _request_timeout: None
523
+ | Annotated[StrictFloat, Field(gt=0)]
524
+ | tuple[
525
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
526
+ ] = None,
527
+ _request_auth: dict[StrictStr, Any] | None = None,
528
+ _content_type: StrictStr | None = None,
529
+ _headers: dict[StrictStr, Any] | None = None,
530
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
531
+ ) -> RESTResponseType:
532
+ """Get one variable definition.
533
+
534
+ Get one variable definition.
535
+
536
+ :param variable_definition_id: Unique identifier for the variable definition. (required)
537
+ :type variable_definition_id: str
538
+ :param date_of_validity: List only variable definitions which are valid on this date.
539
+ :type date_of_validity: date
540
+ :param _request_timeout: timeout setting for this request. If one
541
+ number provided, it will be total request
542
+ timeout. It can also be a pair (tuple) of
543
+ (connection, read) timeouts.
544
+ :type _request_timeout: int, tuple(int, int), optional
545
+ :param _request_auth: set to override the auth_settings for an a single
546
+ request; this effectively ignores the
547
+ authentication in the spec for a single request.
548
+ :type _request_auth: dict, optional
549
+ :param _content_type: force content-type for the request.
550
+ :type _content_type: str, Optional
551
+ :param _headers: set to override the headers for a single
552
+ request; this effectively ignores the headers
553
+ in the spec for a single request.
554
+ :type _headers: dict, optional
555
+ :param _host_index: set to override the host_index for a single
556
+ request; this effectively ignores the host_index
557
+ in the spec for a single request.
558
+ :type _host_index: int, optional
559
+ :return: Returns the result object.
560
+ """
561
+ _param = self._get_variable_definition_by_id_serialize(
562
+ variable_definition_id=variable_definition_id,
563
+ date_of_validity=date_of_validity,
564
+ _request_auth=_request_auth,
565
+ _content_type=_content_type,
566
+ _headers=_headers,
567
+ _host_index=_host_index,
568
+ )
569
+
570
+ _response_types_map: dict[str, str | None] = {
571
+ "200": "CompleteResponse",
572
+ "404": "Problem",
573
+ }
574
+ response_data = self.api_client.call_api(
575
+ *_param,
576
+ _request_timeout=_request_timeout,
577
+ )
578
+ return response_data.response
579
+
580
+ def _get_variable_definition_by_id_serialize(
581
+ self,
582
+ variable_definition_id,
583
+ date_of_validity,
584
+ _request_auth,
585
+ _content_type,
586
+ _headers,
587
+ _host_index,
588
+ ) -> RequestSerialized:
589
+ _host = None
590
+
591
+ _collection_formats: dict[str, str] = {}
592
+
593
+ _path_params: dict[str, str] = {}
594
+ _query_params: list[tuple[str, str]] = []
595
+ _header_params: dict[str, str | None] = _headers or {}
596
+ _form_params: list[tuple[str, str]] = []
597
+ _files: dict[
598
+ str,
599
+ str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]],
600
+ ] = {}
601
+ _body_params: bytes | None = None
602
+
603
+ # process the path parameters
604
+ if variable_definition_id is not None:
605
+ _path_params["variable-definition-id"] = variable_definition_id
606
+ # process the query parameters
607
+ if date_of_validity is not None:
608
+ if isinstance(date_of_validity, date):
609
+ _query_params.append(
610
+ (
611
+ "date_of_validity",
612
+ date_of_validity.strftime(
613
+ self.api_client.configuration.date_format,
614
+ ),
615
+ ),
616
+ )
617
+ else:
618
+ _query_params.append(("date_of_validity", date_of_validity))
619
+
620
+ # process the header parameters
621
+ # process the form parameters
622
+ # process the body parameter
623
+
624
+ # set the HTTP header `Accept`
625
+ if "Accept" not in _header_params:
626
+ _header_params["Accept"] = self.api_client.select_header_accept(
627
+ [
628
+ "application/json",
629
+ "application/problem+json",
630
+ ],
631
+ )
632
+
633
+ # authentication setting
634
+ _auth_settings: list[str] = [
635
+ "keycloak_token",
636
+ ]
637
+
638
+ return self.api_client.param_serialize(
639
+ method="GET",
640
+ resource_path="/variable-definitions/{variable-definition-id}",
641
+ path_params=_path_params,
642
+ query_params=_query_params,
643
+ header_params=_header_params,
644
+ body=_body_params,
645
+ post_params=_form_params,
646
+ files=_files,
647
+ auth_settings=_auth_settings,
648
+ collection_formats=_collection_formats,
649
+ _host=_host,
650
+ _request_auth=_request_auth,
651
+ )
652
+
653
+ @validate_call
654
+ def list_public_variable_definitions(
655
+ self,
656
+ accept_language: Annotated[
657
+ SupportedLanguages,
658
+ Field(description="Render the variable definition in the given language."),
659
+ ],
660
+ date_of_validity: Annotated[
661
+ date | None,
662
+ Field(
663
+ description="List only variable definitions which are valid on this date."
664
+ ),
665
+ ] = None,
666
+ _request_timeout: None
667
+ | Annotated[StrictFloat, Field(gt=0)]
668
+ | tuple[
669
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
670
+ ] = None,
671
+ _request_auth: dict[StrictStr, Any] | None = None,
672
+ _content_type: StrictStr | None = None,
673
+ _headers: dict[StrictStr, Any] | None = None,
674
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
675
+ ) -> list[RenderedVariableDefinition]:
676
+ """List all variable definitions.
677
+
678
+ List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
679
+
680
+ :param accept_language: Render the variable definition in the given language. (required)
681
+ :type accept_language: SupportedLanguages
682
+ :param date_of_validity: List only variable definitions which are valid on this date.
683
+ :type date_of_validity: date
684
+ :param _request_timeout: timeout setting for this request. If one
685
+ number provided, it will be total request
686
+ timeout. It can also be a pair (tuple) of
687
+ (connection, read) timeouts.
688
+ :type _request_timeout: int, tuple(int, int), optional
689
+ :param _request_auth: set to override the auth_settings for an a single
690
+ request; this effectively ignores the
691
+ authentication in the spec for a single request.
692
+ :type _request_auth: dict, optional
693
+ :param _content_type: force content-type for the request.
694
+ :type _content_type: str, Optional
695
+ :param _headers: set to override the headers for a single
696
+ request; this effectively ignores the headers
697
+ in the spec for a single request.
698
+ :type _headers: dict, optional
699
+ :param _host_index: set to override the host_index for a single
700
+ request; this effectively ignores the host_index
701
+ in the spec for a single request.
702
+ :type _host_index: int, optional
703
+ :return: Returns the result object.
704
+ """
705
+ _param = self._list_public_variable_definitions_serialize(
706
+ accept_language=accept_language,
707
+ date_of_validity=date_of_validity,
708
+ _request_auth=_request_auth,
709
+ _content_type=_content_type,
710
+ _headers=_headers,
711
+ _host_index=_host_index,
712
+ )
713
+
714
+ _response_types_map: dict[str, str | None] = {
715
+ "200": "List[RenderedVariableDefinition]",
716
+ }
717
+ response_data = self.api_client.call_api(
718
+ *_param,
719
+ _request_timeout=_request_timeout,
720
+ )
721
+ response_data.read()
722
+ return self.api_client.response_deserialize(
723
+ response_data=response_data,
724
+ response_types_map=_response_types_map,
725
+ ).data
726
+
727
+ @validate_call
728
+ def list_public_variable_definitions_with_http_info(
729
+ self,
730
+ accept_language: Annotated[
731
+ SupportedLanguages,
732
+ Field(description="Render the variable definition in the given language."),
733
+ ],
734
+ date_of_validity: Annotated[
735
+ date | None,
736
+ Field(
737
+ description="List only variable definitions which are valid on this date."
738
+ ),
739
+ ] = None,
740
+ _request_timeout: None
741
+ | Annotated[StrictFloat, Field(gt=0)]
742
+ | tuple[
743
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
744
+ ] = None,
745
+ _request_auth: dict[StrictStr, Any] | None = None,
746
+ _content_type: StrictStr | None = None,
747
+ _headers: dict[StrictStr, Any] | None = None,
748
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
749
+ ) -> ApiResponse[list[RenderedVariableDefinition]]:
750
+ """List all variable definitions.
751
+
752
+ List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
753
+
754
+ :param accept_language: Render the variable definition in the given language. (required)
755
+ :type accept_language: SupportedLanguages
756
+ :param date_of_validity: List only variable definitions which are valid on this date.
757
+ :type date_of_validity: date
758
+ :param _request_timeout: timeout setting for this request. If one
759
+ number provided, it will be total request
760
+ timeout. It can also be a pair (tuple) of
761
+ (connection, read) timeouts.
762
+ :type _request_timeout: int, tuple(int, int), optional
763
+ :param _request_auth: set to override the auth_settings for an a single
764
+ request; this effectively ignores the
765
+ authentication in the spec for a single request.
766
+ :type _request_auth: dict, optional
767
+ :param _content_type: force content-type for the request.
768
+ :type _content_type: str, Optional
769
+ :param _headers: set to override the headers for a single
770
+ request; this effectively ignores the headers
771
+ in the spec for a single request.
772
+ :type _headers: dict, optional
773
+ :param _host_index: set to override the host_index for a single
774
+ request; this effectively ignores the host_index
775
+ in the spec for a single request.
776
+ :type _host_index: int, optional
777
+ :return: Returns the result object.
778
+ """
779
+ _param = self._list_public_variable_definitions_serialize(
780
+ accept_language=accept_language,
781
+ date_of_validity=date_of_validity,
782
+ _request_auth=_request_auth,
783
+ _content_type=_content_type,
784
+ _headers=_headers,
785
+ _host_index=_host_index,
786
+ )
787
+
788
+ _response_types_map: dict[str, str | None] = {
789
+ "200": "List[RenderedVariableDefinition]",
790
+ }
791
+ response_data = self.api_client.call_api(
792
+ *_param,
793
+ _request_timeout=_request_timeout,
794
+ )
795
+ response_data.read()
796
+ return self.api_client.response_deserialize(
797
+ response_data=response_data,
798
+ response_types_map=_response_types_map,
799
+ )
800
+
801
+ @validate_call
802
+ def list_public_variable_definitions_without_preload_content(
803
+ self,
804
+ accept_language: Annotated[
805
+ SupportedLanguages,
806
+ Field(description="Render the variable definition in the given language."),
807
+ ],
808
+ date_of_validity: Annotated[
809
+ date | None,
810
+ Field(
811
+ description="List only variable definitions which are valid on this date."
812
+ ),
813
+ ] = None,
814
+ _request_timeout: None
815
+ | Annotated[StrictFloat, Field(gt=0)]
816
+ | tuple[
817
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
818
+ ] = None,
819
+ _request_auth: dict[StrictStr, Any] | None = None,
820
+ _content_type: StrictStr | None = None,
821
+ _headers: dict[StrictStr, Any] | None = None,
822
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
823
+ ) -> RESTResponseType:
824
+ """List all variable definitions.
825
+
826
+ List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
827
+
828
+ :param accept_language: Render the variable definition in the given language. (required)
829
+ :type accept_language: SupportedLanguages
830
+ :param date_of_validity: List only variable definitions which are valid on this date.
831
+ :type date_of_validity: date
832
+ :param _request_timeout: timeout setting for this request. If one
833
+ number provided, it will be total request
834
+ timeout. It can also be a pair (tuple) of
835
+ (connection, read) timeouts.
836
+ :type _request_timeout: int, tuple(int, int), optional
837
+ :param _request_auth: set to override the auth_settings for an a single
838
+ request; this effectively ignores the
839
+ authentication in the spec for a single request.
840
+ :type _request_auth: dict, optional
841
+ :param _content_type: force content-type for the request.
842
+ :type _content_type: str, Optional
843
+ :param _headers: set to override the headers for a single
844
+ request; this effectively ignores the headers
845
+ in the spec for a single request.
846
+ :type _headers: dict, optional
847
+ :param _host_index: set to override the host_index for a single
848
+ request; this effectively ignores the host_index
849
+ in the spec for a single request.
850
+ :type _host_index: int, optional
851
+ :return: Returns the result object.
852
+ """
853
+ _param = self._list_public_variable_definitions_serialize(
854
+ accept_language=accept_language,
855
+ date_of_validity=date_of_validity,
856
+ _request_auth=_request_auth,
857
+ _content_type=_content_type,
858
+ _headers=_headers,
859
+ _host_index=_host_index,
860
+ )
861
+
862
+ _response_types_map: dict[str, str | None] = {
863
+ "200": "List[RenderedVariableDefinition]",
864
+ }
865
+ response_data = self.api_client.call_api(
866
+ *_param,
867
+ _request_timeout=_request_timeout,
868
+ )
869
+ return response_data.response
870
+
871
+ def _list_public_variable_definitions_serialize(
872
+ self,
873
+ accept_language,
874
+ date_of_validity,
875
+ _request_auth,
876
+ _content_type,
877
+ _headers,
878
+ _host_index,
879
+ ) -> RequestSerialized:
880
+ _host = None
881
+
882
+ _collection_formats: dict[str, str] = {}
883
+
884
+ _path_params: dict[str, str] = {}
885
+ _query_params: list[tuple[str, str]] = []
886
+ _header_params: dict[str, str | None] = _headers or {}
887
+ _form_params: list[tuple[str, str]] = []
888
+ _files: dict[
889
+ str,
890
+ str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]],
891
+ ] = {}
892
+ _body_params: bytes | None = None
893
+
894
+ # process the path parameters
895
+ # process the query parameters
896
+ if date_of_validity is not None:
897
+ if isinstance(date_of_validity, date):
898
+ _query_params.append(
899
+ (
900
+ "date_of_validity",
901
+ date_of_validity.strftime(
902
+ self.api_client.configuration.date_format,
903
+ ),
904
+ ),
905
+ )
906
+ else:
907
+ _query_params.append(("date_of_validity", date_of_validity))
908
+
909
+ # process the header parameters
910
+ if accept_language is not None:
911
+ _header_params["Accept-Language"] = accept_language
912
+ # process the form parameters
913
+ # process the body parameter
914
+
915
+ # set the HTTP header `Accept`
916
+ if "Accept" not in _header_params:
917
+ _header_params["Accept"] = self.api_client.select_header_accept(
918
+ [
919
+ "application/json",
920
+ ],
921
+ )
922
+
923
+ # authentication setting
924
+ _auth_settings: list[str] = []
925
+
926
+ return self.api_client.param_serialize(
927
+ method="GET",
928
+ resource_path="/public/variable-definitions",
929
+ path_params=_path_params,
930
+ query_params=_query_params,
931
+ header_params=_header_params,
932
+ body=_body_params,
933
+ post_params=_form_params,
934
+ files=_files,
935
+ auth_settings=_auth_settings,
936
+ collection_formats=_collection_formats,
937
+ _host=_host,
938
+ _request_auth=_request_auth,
939
+ )
940
+
941
+ @validate_call
942
+ def list_variable_definitions(
943
+ self,
944
+ date_of_validity: Annotated[
945
+ date | None,
946
+ Field(
947
+ description="List only variable definitions which are valid on this date."
948
+ ),
949
+ ] = None,
950
+ _request_timeout: None
951
+ | Annotated[StrictFloat, Field(gt=0)]
952
+ | tuple[
953
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
954
+ ] = None,
955
+ _request_auth: dict[StrictStr, Any] | None = None,
956
+ _content_type: StrictStr | None = None,
957
+ _headers: dict[StrictStr, Any] | None = None,
958
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
959
+ ) -> list[CompleteResponse]:
960
+ """List all variable definitions.
961
+
962
+ List all variable definitions.
963
+
964
+ :param date_of_validity: List only variable definitions which are valid on this date.
965
+ :type date_of_validity: date
966
+ :param _request_timeout: timeout setting for this request. If one
967
+ number provided, it will be total request
968
+ timeout. It can also be a pair (tuple) of
969
+ (connection, read) timeouts.
970
+ :type _request_timeout: int, tuple(int, int), optional
971
+ :param _request_auth: set to override the auth_settings for an a single
972
+ request; this effectively ignores the
973
+ authentication in the spec for a single request.
974
+ :type _request_auth: dict, optional
975
+ :param _content_type: force content-type for the request.
976
+ :type _content_type: str, Optional
977
+ :param _headers: set to override the headers for a single
978
+ request; this effectively ignores the headers
979
+ in the spec for a single request.
980
+ :type _headers: dict, optional
981
+ :param _host_index: set to override the host_index for a single
982
+ request; this effectively ignores the host_index
983
+ in the spec for a single request.
984
+ :type _host_index: int, optional
985
+ :return: Returns the result object.
986
+ """
987
+ _param = self._list_variable_definitions_serialize(
988
+ date_of_validity=date_of_validity,
989
+ _request_auth=_request_auth,
990
+ _content_type=_content_type,
991
+ _headers=_headers,
992
+ _host_index=_host_index,
993
+ )
994
+
995
+ _response_types_map: dict[str, str | None] = {
996
+ "200": "List[CompleteResponse]",
997
+ }
998
+ response_data = self.api_client.call_api(
999
+ *_param,
1000
+ _request_timeout=_request_timeout,
1001
+ )
1002
+ response_data.read()
1003
+ return self.api_client.response_deserialize(
1004
+ response_data=response_data,
1005
+ response_types_map=_response_types_map,
1006
+ ).data
1007
+
1008
+ @validate_call
1009
+ def list_variable_definitions_with_http_info(
1010
+ self,
1011
+ date_of_validity: Annotated[
1012
+ date | None,
1013
+ Field(
1014
+ description="List only variable definitions which are valid on this date."
1015
+ ),
1016
+ ] = None,
1017
+ _request_timeout: None
1018
+ | Annotated[StrictFloat, Field(gt=0)]
1019
+ | tuple[
1020
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1021
+ ] = None,
1022
+ _request_auth: dict[StrictStr, Any] | None = None,
1023
+ _content_type: StrictStr | None = None,
1024
+ _headers: dict[StrictStr, Any] | None = None,
1025
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1026
+ ) -> ApiResponse[list[CompleteResponse]]:
1027
+ """List all variable definitions.
1028
+
1029
+ List all variable definitions.
1030
+
1031
+ :param date_of_validity: List only variable definitions which are valid on this date.
1032
+ :type date_of_validity: date
1033
+ :param _request_timeout: timeout setting for this request. If one
1034
+ number provided, it will be total request
1035
+ timeout. It can also be a pair (tuple) of
1036
+ (connection, read) timeouts.
1037
+ :type _request_timeout: int, tuple(int, int), optional
1038
+ :param _request_auth: set to override the auth_settings for an a single
1039
+ request; this effectively ignores the
1040
+ authentication in the spec for a single request.
1041
+ :type _request_auth: dict, optional
1042
+ :param _content_type: force content-type for the request.
1043
+ :type _content_type: str, Optional
1044
+ :param _headers: set to override the headers for a single
1045
+ request; this effectively ignores the headers
1046
+ in the spec for a single request.
1047
+ :type _headers: dict, optional
1048
+ :param _host_index: set to override the host_index for a single
1049
+ request; this effectively ignores the host_index
1050
+ in the spec for a single request.
1051
+ :type _host_index: int, optional
1052
+ :return: Returns the result object.
1053
+ """
1054
+ _param = self._list_variable_definitions_serialize(
1055
+ date_of_validity=date_of_validity,
1056
+ _request_auth=_request_auth,
1057
+ _content_type=_content_type,
1058
+ _headers=_headers,
1059
+ _host_index=_host_index,
1060
+ )
1061
+
1062
+ _response_types_map: dict[str, str | None] = {
1063
+ "200": "List[CompleteResponse]",
1064
+ }
1065
+ response_data = self.api_client.call_api(
1066
+ *_param,
1067
+ _request_timeout=_request_timeout,
1068
+ )
1069
+ response_data.read()
1070
+ return self.api_client.response_deserialize(
1071
+ response_data=response_data,
1072
+ response_types_map=_response_types_map,
1073
+ )
1074
+
1075
+ @validate_call
1076
+ def list_variable_definitions_without_preload_content(
1077
+ self,
1078
+ date_of_validity: Annotated[
1079
+ date | None,
1080
+ Field(
1081
+ description="List only variable definitions which are valid on this date."
1082
+ ),
1083
+ ] = None,
1084
+ _request_timeout: None
1085
+ | Annotated[StrictFloat, Field(gt=0)]
1086
+ | tuple[
1087
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1088
+ ] = None,
1089
+ _request_auth: dict[StrictStr, Any] | None = None,
1090
+ _content_type: StrictStr | None = None,
1091
+ _headers: dict[StrictStr, Any] | None = None,
1092
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1093
+ ) -> RESTResponseType:
1094
+ """List all variable definitions.
1095
+
1096
+ List all variable definitions.
1097
+
1098
+ :param date_of_validity: List only variable definitions which are valid on this date.
1099
+ :type date_of_validity: date
1100
+ :param _request_timeout: timeout setting for this request. If one
1101
+ number provided, it will be total request
1102
+ timeout. It can also be a pair (tuple) of
1103
+ (connection, read) timeouts.
1104
+ :type _request_timeout: int, tuple(int, int), optional
1105
+ :param _request_auth: set to override the auth_settings for an a single
1106
+ request; this effectively ignores the
1107
+ authentication in the spec for a single request.
1108
+ :type _request_auth: dict, optional
1109
+ :param _content_type: force content-type for the request.
1110
+ :type _content_type: str, Optional
1111
+ :param _headers: set to override the headers for a single
1112
+ request; this effectively ignores the headers
1113
+ in the spec for a single request.
1114
+ :type _headers: dict, optional
1115
+ :param _host_index: set to override the host_index for a single
1116
+ request; this effectively ignores the host_index
1117
+ in the spec for a single request.
1118
+ :type _host_index: int, optional
1119
+ :return: Returns the result object.
1120
+ """
1121
+ _param = self._list_variable_definitions_serialize(
1122
+ date_of_validity=date_of_validity,
1123
+ _request_auth=_request_auth,
1124
+ _content_type=_content_type,
1125
+ _headers=_headers,
1126
+ _host_index=_host_index,
1127
+ )
1128
+
1129
+ _response_types_map: dict[str, str | None] = {
1130
+ "200": "List[CompleteResponse]",
1131
+ }
1132
+ response_data = self.api_client.call_api(
1133
+ *_param,
1134
+ _request_timeout=_request_timeout,
1135
+ )
1136
+ return response_data.response
1137
+
1138
+ def _list_variable_definitions_serialize(
1139
+ self,
1140
+ date_of_validity,
1141
+ _request_auth,
1142
+ _content_type,
1143
+ _headers,
1144
+ _host_index,
1145
+ ) -> RequestSerialized:
1146
+ _host = None
1147
+
1148
+ _collection_formats: dict[str, str] = {}
1149
+
1150
+ _path_params: dict[str, str] = {}
1151
+ _query_params: list[tuple[str, str]] = []
1152
+ _header_params: dict[str, str | None] = _headers or {}
1153
+ _form_params: list[tuple[str, str]] = []
1154
+ _files: dict[
1155
+ str,
1156
+ str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]],
1157
+ ] = {}
1158
+ _body_params: bytes | None = None
1159
+
1160
+ # process the path parameters
1161
+ # process the query parameters
1162
+ if date_of_validity is not None:
1163
+ if isinstance(date_of_validity, date):
1164
+ _query_params.append(
1165
+ (
1166
+ "date_of_validity",
1167
+ date_of_validity.strftime(
1168
+ self.api_client.configuration.date_format,
1169
+ ),
1170
+ ),
1171
+ )
1172
+ else:
1173
+ _query_params.append(("date_of_validity", date_of_validity))
1174
+
1175
+ # process the header parameters
1176
+ # process the form parameters
1177
+ # process the body parameter
1178
+
1179
+ # set the HTTP header `Accept`
1180
+ if "Accept" not in _header_params:
1181
+ _header_params["Accept"] = self.api_client.select_header_accept(
1182
+ [
1183
+ "application/json",
1184
+ ],
1185
+ )
1186
+
1187
+ # authentication setting
1188
+ _auth_settings: list[str] = [
1189
+ "keycloak_token",
1190
+ ]
1191
+
1192
+ return self.api_client.param_serialize(
1193
+ method="GET",
1194
+ resource_path="/variable-definitions",
1195
+ path_params=_path_params,
1196
+ query_params=_query_params,
1197
+ header_params=_header_params,
1198
+ body=_body_params,
1199
+ post_params=_form_params,
1200
+ files=_files,
1201
+ auth_settings=_auth_settings,
1202
+ collection_formats=_collection_formats,
1203
+ _host=_host,
1204
+ _request_auth=_request_auth,
1205
+ )