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,766 @@
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 typing import Annotated
13
+ from typing import Any
14
+
15
+ from pydantic import Field
16
+ from pydantic import StrictFloat
17
+ from pydantic import StrictInt
18
+ from pydantic import StrictStr
19
+ from pydantic import validate_call
20
+
21
+ from ..api_client import ApiClient
22
+ from ..api_client import RequestSerialized
23
+ from ..api_response import ApiResponse
24
+ from ..models.complete_response import CompleteResponse
25
+ from ..models.get_vardok_vardef_mapping_by_id200_response import (
26
+ GetVardokVardefMappingById200Response,
27
+ )
28
+ from ..models.vardok_vardef_id_pair_response import VardokVardefIdPairResponse
29
+ from ..rest import RESTResponseType
30
+
31
+
32
+ class DataMigrationApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+ @validate_call
45
+ def create_variable_definition_from_var_dok(
46
+ self,
47
+ vardok_id: Annotated[
48
+ StrictStr, Field(description="The ID of the definition in Vardok.")
49
+ ],
50
+ active_group: Annotated[
51
+ StrictStr,
52
+ Field(description="The group which the user currently represents."),
53
+ ],
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
+ """Create a variable definition from a VarDok variable definition.
65
+
66
+ Create a variable definition from a VarDok variable definition.
67
+
68
+ :param vardok_id: The ID of the definition in Vardok. (required)
69
+ :type vardok_id: str
70
+ :param active_group: The group which the user currently represents. (required)
71
+ :type active_group: str
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._create_variable_definition_from_var_dok_serialize(
94
+ vardok_id=vardok_id,
95
+ active_group=active_group,
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
+ "201": "CompleteResponse",
104
+ "400": "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 create_variable_definition_from_var_dok_with_http_info(
117
+ self,
118
+ vardok_id: Annotated[
119
+ StrictStr, Field(description="The ID of the definition in Vardok.")
120
+ ],
121
+ active_group: Annotated[
122
+ StrictStr,
123
+ Field(description="The group which the user currently represents."),
124
+ ],
125
+ _request_timeout: None
126
+ | Annotated[StrictFloat, Field(gt=0)]
127
+ | tuple[
128
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
129
+ ] = None,
130
+ _request_auth: dict[StrictStr, Any] | None = None,
131
+ _content_type: StrictStr | None = None,
132
+ _headers: dict[StrictStr, Any] | None = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[CompleteResponse]:
135
+ """Create a variable definition from a VarDok variable definition.
136
+
137
+ Create a variable definition from a VarDok variable definition.
138
+
139
+ :param vardok_id: The ID of the definition in Vardok. (required)
140
+ :type vardok_id: str
141
+ :param active_group: The group which the user currently represents. (required)
142
+ :type active_group: str
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """
164
+ _param = self._create_variable_definition_from_var_dok_serialize(
165
+ vardok_id=vardok_id,
166
+ active_group=active_group,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index,
171
+ )
172
+
173
+ _response_types_map: dict[str, str | None] = {
174
+ "201": "CompleteResponse",
175
+ "400": "Problem",
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param, _request_timeout=_request_timeout
179
+ )
180
+ response_data.read()
181
+ return self.api_client.response_deserialize(
182
+ response_data=response_data,
183
+ response_types_map=_response_types_map,
184
+ )
185
+
186
+ @validate_call
187
+ def create_variable_definition_from_var_dok_without_preload_content(
188
+ self,
189
+ vardok_id: Annotated[
190
+ StrictStr, Field(description="The ID of the definition in Vardok.")
191
+ ],
192
+ active_group: Annotated[
193
+ StrictStr,
194
+ Field(description="The group which the user currently represents."),
195
+ ],
196
+ _request_timeout: None
197
+ | Annotated[StrictFloat, Field(gt=0)]
198
+ | tuple[
199
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
200
+ ] = None,
201
+ _request_auth: dict[StrictStr, Any] | None = None,
202
+ _content_type: StrictStr | None = None,
203
+ _headers: dict[StrictStr, Any] | None = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Create a variable definition from a VarDok variable definition.
207
+
208
+ Create a variable definition from a VarDok variable definition.
209
+
210
+ :param vardok_id: The ID of the definition in Vardok. (required)
211
+ :type vardok_id: str
212
+ :param active_group: The group which the user currently represents. (required)
213
+ :type active_group: str
214
+ :param _request_timeout: timeout setting for this request. If one
215
+ number provided, it will be total request
216
+ timeout. It can also be a pair (tuple) of
217
+ (connection, read) timeouts.
218
+ :type _request_timeout: int, tuple(int, int), optional
219
+ :param _request_auth: set to override the auth_settings for an a single
220
+ request; this effectively ignores the
221
+ authentication in the spec for a single request.
222
+ :type _request_auth: dict, optional
223
+ :param _content_type: force content-type for the request.
224
+ :type _content_type: str, Optional
225
+ :param _headers: set to override the headers for a single
226
+ request; this effectively ignores the headers
227
+ in the spec for a single request.
228
+ :type _headers: dict, optional
229
+ :param _host_index: set to override the host_index for a single
230
+ request; this effectively ignores the host_index
231
+ in the spec for a single request.
232
+ :type _host_index: int, optional
233
+ :return: Returns the result object.
234
+ """
235
+ _param = self._create_variable_definition_from_var_dok_serialize(
236
+ vardok_id=vardok_id,
237
+ active_group=active_group,
238
+ _request_auth=_request_auth,
239
+ _content_type=_content_type,
240
+ _headers=_headers,
241
+ _host_index=_host_index,
242
+ )
243
+
244
+ _response_types_map: dict[str, str | None] = {
245
+ "201": "CompleteResponse",
246
+ "400": "Problem",
247
+ }
248
+ response_data = self.api_client.call_api(
249
+ *_param, _request_timeout=_request_timeout
250
+ )
251
+ return response_data.response
252
+
253
+ def _create_variable_definition_from_var_dok_serialize(
254
+ self,
255
+ vardok_id,
256
+ active_group,
257
+ _request_auth,
258
+ _content_type,
259
+ _headers,
260
+ _host_index,
261
+ ) -> RequestSerialized:
262
+ _host = None
263
+
264
+ _collection_formats: dict[str, str] = {}
265
+
266
+ _path_params: dict[str, str] = {}
267
+ _query_params: list[tuple[str, str]] = []
268
+ _header_params: dict[str, str | None] = _headers or {}
269
+ _form_params: list[tuple[str, str]] = []
270
+ _files: dict[
271
+ str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
272
+ ] = {}
273
+ _body_params: bytes | None = None
274
+
275
+ # process the path parameters
276
+ if vardok_id is not None:
277
+ _path_params["vardok-id"] = vardok_id
278
+ # process the query parameters
279
+ if active_group is not None:
280
+ _query_params.append(("active_group", active_group))
281
+
282
+ # process the header parameters
283
+ # process the form parameters
284
+ # process the body parameter
285
+
286
+ # set the HTTP header `Accept`
287
+ if "Accept" not in _header_params:
288
+ _header_params["Accept"] = self.api_client.select_header_accept(
289
+ ["application/json", "application/problem+json"]
290
+ )
291
+
292
+ # authentication setting
293
+ _auth_settings: list[str] = ["keycloak_token"]
294
+
295
+ return self.api_client.param_serialize(
296
+ method="POST",
297
+ resource_path="/vardok-migration/{vardok-id}",
298
+ path_params=_path_params,
299
+ query_params=_query_params,
300
+ header_params=_header_params,
301
+ body=_body_params,
302
+ post_params=_form_params,
303
+ files=_files,
304
+ auth_settings=_auth_settings,
305
+ collection_formats=_collection_formats,
306
+ _host=_host,
307
+ _request_auth=_request_auth,
308
+ )
309
+
310
+ @validate_call
311
+ def get_vardok_vardef_mapping(
312
+ self,
313
+ _request_timeout: None
314
+ | Annotated[StrictFloat, Field(gt=0)]
315
+ | tuple[
316
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
317
+ ] = None,
318
+ _request_auth: dict[StrictStr, Any] | None = None,
319
+ _content_type: StrictStr | None = None,
320
+ _headers: dict[StrictStr, Any] | None = None,
321
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
322
+ ) -> list[VardokVardefIdPairResponse]:
323
+ """Get a list of all vardok and vardef id mappings
324
+
325
+ Get a list of all vardok and vardef id mappings
326
+
327
+ :param _request_timeout: timeout setting for this request. If one
328
+ number provided, it will be total request
329
+ timeout. It can also be a pair (tuple) of
330
+ (connection, read) timeouts.
331
+ :type _request_timeout: int, tuple(int, int), optional
332
+ :param _request_auth: set to override the auth_settings for an a single
333
+ request; this effectively ignores the
334
+ authentication in the spec for a single request.
335
+ :type _request_auth: dict, optional
336
+ :param _content_type: force content-type for the request.
337
+ :type _content_type: str, Optional
338
+ :param _headers: set to override the headers for a single
339
+ request; this effectively ignores the headers
340
+ in the spec for a single request.
341
+ :type _headers: dict, optional
342
+ :param _host_index: set to override the host_index for a single
343
+ request; this effectively ignores the host_index
344
+ in the spec for a single request.
345
+ :type _host_index: int, optional
346
+ :return: Returns the result object.
347
+ """
348
+ _param = self._get_vardok_vardef_mapping_serialize(
349
+ _request_auth=_request_auth,
350
+ _content_type=_content_type,
351
+ _headers=_headers,
352
+ _host_index=_host_index,
353
+ )
354
+
355
+ _response_types_map: dict[str, str | None] = {
356
+ "200": "List[VardokVardefIdPairResponse]",
357
+ }
358
+ response_data = self.api_client.call_api(
359
+ *_param, _request_timeout=_request_timeout
360
+ )
361
+ response_data.read()
362
+ return self.api_client.response_deserialize(
363
+ response_data=response_data,
364
+ response_types_map=_response_types_map,
365
+ ).data
366
+
367
+ @validate_call
368
+ def get_vardok_vardef_mapping_with_http_info(
369
+ self,
370
+ _request_timeout: None
371
+ | Annotated[StrictFloat, Field(gt=0)]
372
+ | tuple[
373
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
374
+ ] = None,
375
+ _request_auth: dict[StrictStr, Any] | None = None,
376
+ _content_type: StrictStr | None = None,
377
+ _headers: dict[StrictStr, Any] | None = None,
378
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
379
+ ) -> ApiResponse[list[VardokVardefIdPairResponse]]:
380
+ """Get a list of all vardok and vardef id mappings
381
+
382
+ Get a list of all vardok and vardef id mappings
383
+
384
+ :param _request_timeout: timeout setting for this request. If one
385
+ number provided, it will be total request
386
+ timeout. It can also be a pair (tuple) of
387
+ (connection, read) timeouts.
388
+ :type _request_timeout: int, tuple(int, int), optional
389
+ :param _request_auth: set to override the auth_settings for an a single
390
+ request; this effectively ignores the
391
+ authentication in the spec for a single request.
392
+ :type _request_auth: dict, optional
393
+ :param _content_type: force content-type for the request.
394
+ :type _content_type: str, Optional
395
+ :param _headers: set to override the headers for a single
396
+ request; this effectively ignores the headers
397
+ in the spec for a single request.
398
+ :type _headers: dict, optional
399
+ :param _host_index: set to override the host_index for a single
400
+ request; this effectively ignores the host_index
401
+ in the spec for a single request.
402
+ :type _host_index: int, optional
403
+ :return: Returns the result object.
404
+ """
405
+ _param = self._get_vardok_vardef_mapping_serialize(
406
+ _request_auth=_request_auth,
407
+ _content_type=_content_type,
408
+ _headers=_headers,
409
+ _host_index=_host_index,
410
+ )
411
+
412
+ _response_types_map: dict[str, str | None] = {
413
+ "200": "List[VardokVardefIdPairResponse]",
414
+ }
415
+ response_data = self.api_client.call_api(
416
+ *_param, _request_timeout=_request_timeout
417
+ )
418
+ response_data.read()
419
+ return self.api_client.response_deserialize(
420
+ response_data=response_data,
421
+ response_types_map=_response_types_map,
422
+ )
423
+
424
+ @validate_call
425
+ def get_vardok_vardef_mapping_without_preload_content(
426
+ self,
427
+ _request_timeout: None
428
+ | Annotated[StrictFloat, Field(gt=0)]
429
+ | tuple[
430
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
431
+ ] = None,
432
+ _request_auth: dict[StrictStr, Any] | None = None,
433
+ _content_type: StrictStr | None = None,
434
+ _headers: dict[StrictStr, Any] | None = None,
435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
436
+ ) -> RESTResponseType:
437
+ """Get a list of all vardok and vardef id mappings
438
+
439
+ Get a list of all vardok and vardef id mappings
440
+
441
+ :param _request_timeout: timeout setting for this request. If one
442
+ number provided, it will be total request
443
+ timeout. It can also be a pair (tuple) of
444
+ (connection, read) timeouts.
445
+ :type _request_timeout: int, tuple(int, int), optional
446
+ :param _request_auth: set to override the auth_settings for an a single
447
+ request; this effectively ignores the
448
+ authentication in the spec for a single request.
449
+ :type _request_auth: dict, optional
450
+ :param _content_type: force content-type for the request.
451
+ :type _content_type: str, Optional
452
+ :param _headers: set to override the headers for a single
453
+ request; this effectively ignores the headers
454
+ in the spec for a single request.
455
+ :type _headers: dict, optional
456
+ :param _host_index: set to override the host_index for a single
457
+ request; this effectively ignores the host_index
458
+ in the spec for a single request.
459
+ :type _host_index: int, optional
460
+ :return: Returns the result object.
461
+ """
462
+ _param = self._get_vardok_vardef_mapping_serialize(
463
+ _request_auth=_request_auth,
464
+ _content_type=_content_type,
465
+ _headers=_headers,
466
+ _host_index=_host_index,
467
+ )
468
+
469
+ _response_types_map: dict[str, str | None] = {
470
+ "200": "List[VardokVardefIdPairResponse]",
471
+ }
472
+ response_data = self.api_client.call_api(
473
+ *_param, _request_timeout=_request_timeout
474
+ )
475
+ return response_data.response
476
+
477
+ def _get_vardok_vardef_mapping_serialize(
478
+ self,
479
+ _request_auth,
480
+ _content_type,
481
+ _headers,
482
+ _host_index,
483
+ ) -> RequestSerialized:
484
+ _host = None
485
+
486
+ _collection_formats: dict[str, str] = {}
487
+
488
+ _path_params: dict[str, str] = {}
489
+ _query_params: list[tuple[str, str]] = []
490
+ _header_params: dict[str, str | None] = _headers or {}
491
+ _form_params: list[tuple[str, str]] = []
492
+ _files: dict[
493
+ str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
494
+ ] = {}
495
+ _body_params: bytes | None = None
496
+
497
+ # process the path parameters
498
+ # process the query parameters
499
+ # process the header parameters
500
+ # process the form parameters
501
+ # process the body parameter
502
+
503
+ # set the HTTP header `Accept`
504
+ if "Accept" not in _header_params:
505
+ _header_params["Accept"] = self.api_client.select_header_accept(
506
+ ["application/json"]
507
+ )
508
+
509
+ # authentication setting
510
+ _auth_settings: list[str] = ["keycloak_token"]
511
+
512
+ return self.api_client.param_serialize(
513
+ method="GET",
514
+ resource_path="/vardok-migration",
515
+ path_params=_path_params,
516
+ query_params=_query_params,
517
+ header_params=_header_params,
518
+ body=_body_params,
519
+ post_params=_form_params,
520
+ files=_files,
521
+ auth_settings=_auth_settings,
522
+ collection_formats=_collection_formats,
523
+ _host=_host,
524
+ _request_auth=_request_auth,
525
+ )
526
+
527
+ @validate_call
528
+ def get_vardok_vardef_mapping_by_id(
529
+ self,
530
+ id: Annotated[
531
+ StrictStr,
532
+ Field(description="The ID of the definition in Vardok or Vardef."),
533
+ ],
534
+ _request_timeout: None
535
+ | Annotated[StrictFloat, Field(gt=0)]
536
+ | tuple[
537
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
538
+ ] = None,
539
+ _request_auth: dict[StrictStr, Any] | None = None,
540
+ _content_type: StrictStr | None = None,
541
+ _headers: dict[StrictStr, Any] | None = None,
542
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
543
+ ) -> GetVardokVardefMappingById200Response:
544
+ """Get one variable definition by vardok id or get the vardok id by vardef id.
545
+
546
+ Get one variable definition by vardok id or get the vardok id by vardef id.
547
+
548
+ :param id: The ID of the definition in Vardok or Vardef. (required)
549
+ :type id: str
550
+ :param _request_timeout: timeout setting for this request. If one
551
+ number provided, it will be total request
552
+ timeout. It can also be a pair (tuple) of
553
+ (connection, read) timeouts.
554
+ :type _request_timeout: int, tuple(int, int), optional
555
+ :param _request_auth: set to override the auth_settings for an a single
556
+ request; this effectively ignores the
557
+ authentication in the spec for a single request.
558
+ :type _request_auth: dict, optional
559
+ :param _content_type: force content-type for the request.
560
+ :type _content_type: str, Optional
561
+ :param _headers: set to override the headers for a single
562
+ request; this effectively ignores the headers
563
+ in the spec for a single request.
564
+ :type _headers: dict, optional
565
+ :param _host_index: set to override the host_index for a single
566
+ request; this effectively ignores the host_index
567
+ in the spec for a single request.
568
+ :type _host_index: int, optional
569
+ :return: Returns the result object.
570
+ """
571
+ _param = self._get_vardok_vardef_mapping_by_id_serialize(
572
+ id=id,
573
+ _request_auth=_request_auth,
574
+ _content_type=_content_type,
575
+ _headers=_headers,
576
+ _host_index=_host_index,
577
+ )
578
+
579
+ _response_types_map: dict[str, str | None] = {
580
+ "200": "GetVardokVardefMappingById200Response",
581
+ }
582
+ response_data = self.api_client.call_api(
583
+ *_param, _request_timeout=_request_timeout
584
+ )
585
+ response_data.read()
586
+ return self.api_client.response_deserialize(
587
+ response_data=response_data,
588
+ response_types_map=_response_types_map,
589
+ ).data
590
+
591
+ @validate_call
592
+ def get_vardok_vardef_mapping_by_id_with_http_info(
593
+ self,
594
+ id: Annotated[
595
+ StrictStr,
596
+ Field(description="The ID of the definition in Vardok or Vardef."),
597
+ ],
598
+ _request_timeout: None
599
+ | Annotated[StrictFloat, Field(gt=0)]
600
+ | tuple[
601
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
602
+ ] = None,
603
+ _request_auth: dict[StrictStr, Any] | None = None,
604
+ _content_type: StrictStr | None = None,
605
+ _headers: dict[StrictStr, Any] | None = None,
606
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
607
+ ) -> ApiResponse[GetVardokVardefMappingById200Response]:
608
+ """Get one variable definition by vardok id or get the vardok id by vardef id.
609
+
610
+ Get one variable definition by vardok id or get the vardok id by vardef id.
611
+
612
+ :param id: The ID of the definition in Vardok or Vardef. (required)
613
+ :type id: str
614
+ :param _request_timeout: timeout setting for this request. If one
615
+ number provided, it will be total request
616
+ timeout. It can also be a pair (tuple) of
617
+ (connection, read) timeouts.
618
+ :type _request_timeout: int, tuple(int, int), optional
619
+ :param _request_auth: set to override the auth_settings for an a single
620
+ request; this effectively ignores the
621
+ authentication in the spec for a single request.
622
+ :type _request_auth: dict, optional
623
+ :param _content_type: force content-type for the request.
624
+ :type _content_type: str, Optional
625
+ :param _headers: set to override the headers for a single
626
+ request; this effectively ignores the headers
627
+ in the spec for a single request.
628
+ :type _headers: dict, optional
629
+ :param _host_index: set to override the host_index for a single
630
+ request; this effectively ignores the host_index
631
+ in the spec for a single request.
632
+ :type _host_index: int, optional
633
+ :return: Returns the result object.
634
+ """
635
+ _param = self._get_vardok_vardef_mapping_by_id_serialize(
636
+ id=id,
637
+ _request_auth=_request_auth,
638
+ _content_type=_content_type,
639
+ _headers=_headers,
640
+ _host_index=_host_index,
641
+ )
642
+
643
+ _response_types_map: dict[str, str | None] = {
644
+ "200": "GetVardokVardefMappingById200Response",
645
+ }
646
+ response_data = self.api_client.call_api(
647
+ *_param, _request_timeout=_request_timeout
648
+ )
649
+ response_data.read()
650
+ return self.api_client.response_deserialize(
651
+ response_data=response_data,
652
+ response_types_map=_response_types_map,
653
+ )
654
+
655
+ @validate_call
656
+ def get_vardok_vardef_mapping_by_id_without_preload_content(
657
+ self,
658
+ id: Annotated[
659
+ StrictStr,
660
+ Field(description="The ID of the definition in Vardok or Vardef."),
661
+ ],
662
+ _request_timeout: None
663
+ | Annotated[StrictFloat, Field(gt=0)]
664
+ | tuple[
665
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
666
+ ] = None,
667
+ _request_auth: dict[StrictStr, Any] | None = None,
668
+ _content_type: StrictStr | None = None,
669
+ _headers: dict[StrictStr, Any] | None = None,
670
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
671
+ ) -> RESTResponseType:
672
+ """Get one variable definition by vardok id or get the vardok id by vardef id.
673
+
674
+ Get one variable definition by vardok id or get the vardok id by vardef id.
675
+
676
+ :param id: The ID of the definition in Vardok or Vardef. (required)
677
+ :type id: str
678
+ :param _request_timeout: timeout setting for this request. If one
679
+ number provided, it will be total request
680
+ timeout. It can also be a pair (tuple) of
681
+ (connection, read) timeouts.
682
+ :type _request_timeout: int, tuple(int, int), optional
683
+ :param _request_auth: set to override the auth_settings for an a single
684
+ request; this effectively ignores the
685
+ authentication in the spec for a single request.
686
+ :type _request_auth: dict, optional
687
+ :param _content_type: force content-type for the request.
688
+ :type _content_type: str, Optional
689
+ :param _headers: set to override the headers for a single
690
+ request; this effectively ignores the headers
691
+ in the spec for a single request.
692
+ :type _headers: dict, optional
693
+ :param _host_index: set to override the host_index for a single
694
+ request; this effectively ignores the host_index
695
+ in the spec for a single request.
696
+ :type _host_index: int, optional
697
+ :return: Returns the result object.
698
+ """
699
+ _param = self._get_vardok_vardef_mapping_by_id_serialize(
700
+ id=id,
701
+ _request_auth=_request_auth,
702
+ _content_type=_content_type,
703
+ _headers=_headers,
704
+ _host_index=_host_index,
705
+ )
706
+
707
+ _response_types_map: dict[str, str | None] = {
708
+ "200": "GetVardokVardefMappingById200Response",
709
+ }
710
+ response_data = self.api_client.call_api(
711
+ *_param, _request_timeout=_request_timeout
712
+ )
713
+ return response_data.response
714
+
715
+ def _get_vardok_vardef_mapping_by_id_serialize(
716
+ self,
717
+ id,
718
+ _request_auth,
719
+ _content_type,
720
+ _headers,
721
+ _host_index,
722
+ ) -> RequestSerialized:
723
+ _host = None
724
+
725
+ _collection_formats: dict[str, str] = {}
726
+
727
+ _path_params: dict[str, str] = {}
728
+ _query_params: list[tuple[str, str]] = []
729
+ _header_params: dict[str, str | None] = _headers or {}
730
+ _form_params: list[tuple[str, str]] = []
731
+ _files: dict[
732
+ str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
733
+ ] = {}
734
+ _body_params: bytes | None = None
735
+
736
+ # process the path parameters
737
+ if id is not None:
738
+ _path_params["id"] = id
739
+ # process the query parameters
740
+ # process the header parameters
741
+ # process the form parameters
742
+ # process the body parameter
743
+
744
+ # set the HTTP header `Accept`
745
+ if "Accept" not in _header_params:
746
+ _header_params["Accept"] = self.api_client.select_header_accept(
747
+ ["application/json"]
748
+ )
749
+
750
+ # authentication setting
751
+ _auth_settings: list[str] = ["keycloak_token"]
752
+
753
+ return self.api_client.param_serialize(
754
+ method="GET",
755
+ resource_path="/vardok-migration/{id}",
756
+ path_params=_path_params,
757
+ query_params=_query_params,
758
+ header_params=_header_params,
759
+ body=_body_params,
760
+ post_params=_form_params,
761
+ files=_files,
762
+ auth_settings=_auth_settings,
763
+ collection_formats=_collection_formats,
764
+ _host=_host,
765
+ _request_auth=_request_auth,
766
+ )