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.
- dapla_metadata/__init__.py +11 -1
- dapla_metadata/_shared/__init__.py +1 -0
- dapla_metadata/_shared/config.py +109 -0
- dapla_metadata/_shared/enums.py +27 -0
- dapla_metadata/_shared/py.typed +0 -0
- dapla_metadata/dapla/__init__.py +4 -0
- dapla_metadata/dapla/user_info.py +138 -0
- dapla_metadata/datasets/__init__.py +1 -1
- dapla_metadata/datasets/_merge.py +333 -0
- dapla_metadata/datasets/code_list.py +5 -6
- dapla_metadata/datasets/compatibility/__init__.py +10 -0
- dapla_metadata/datasets/compatibility/_handlers.py +363 -0
- dapla_metadata/datasets/compatibility/_utils.py +259 -0
- dapla_metadata/datasets/compatibility/model_backwards_compatibility.py +135 -0
- dapla_metadata/datasets/core.py +136 -182
- dapla_metadata/datasets/dapla_dataset_path_info.py +145 -19
- dapla_metadata/datasets/dataset_parser.py +41 -28
- dapla_metadata/datasets/model_validation.py +29 -20
- dapla_metadata/datasets/statistic_subject_mapping.py +5 -1
- dapla_metadata/datasets/utility/constants.py +22 -15
- dapla_metadata/datasets/utility/enums.py +8 -20
- dapla_metadata/datasets/utility/urn.py +234 -0
- dapla_metadata/datasets/utility/utils.py +183 -111
- dapla_metadata/standards/__init__.py +4 -0
- dapla_metadata/standards/name_validator.py +250 -0
- dapla_metadata/standards/standard_validators.py +98 -0
- dapla_metadata/standards/utils/__init__.py +1 -0
- dapla_metadata/standards/utils/constants.py +49 -0
- dapla_metadata/variable_definitions/__init__.py +11 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/FILES +20 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator-ignore +6 -0
- dapla_metadata/variable_definitions/_generated/README.md +148 -0
- dapla_metadata/variable_definitions/_generated/__init__.py +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/__init__.py +47 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/__init__.py +8 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/data_migration_api.py +766 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/draft_variable_definitions_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/patches_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/validity_periods_api.py +583 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/variable_definitions_api.py +613 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_client.py +779 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_response.py +27 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/configuration.py +474 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/CompleteResponse.md +51 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Contact.md +30 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DataMigrationApi.md +90 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Draft.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/LanguageStringType.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Owner.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Patch.md +43 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PatchesApi.md +249 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PublicApi.md +218 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/SupportedLanguages.md +15 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/UpdateDraft.md +44 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriod.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableStatus.md +17 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/exceptions.py +193 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/__init__.py +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/complete_response.py +260 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/contact.py +94 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/draft.py +228 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py +158 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/language_string_type.py +101 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/owner.py +87 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/patch.py +244 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/problem.py +118 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/update_draft.py +274 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/validity_period.py +225 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_id_response.py +81 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_vardef_id_pair_response.py +84 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/py.typed +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/rest.py +249 -0
- dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
- dapla_metadata/variable_definitions/_utils/_client.py +32 -0
- dapla_metadata/variable_definitions/_utils/config.py +54 -0
- dapla_metadata/variable_definitions/_utils/constants.py +80 -0
- dapla_metadata/variable_definitions/_utils/files.py +309 -0
- dapla_metadata/variable_definitions/_utils/template_files.py +99 -0
- dapla_metadata/variable_definitions/_utils/variable_definition_files.py +143 -0
- dapla_metadata/variable_definitions/exceptions.py +255 -0
- dapla_metadata/variable_definitions/vardef.py +372 -0
- dapla_metadata/variable_definitions/vardok_id.py +48 -0
- dapla_metadata/variable_definitions/vardok_vardef_id_pair.py +47 -0
- dapla_metadata/variable_definitions/variable_definition.py +422 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/METADATA +34 -36
- dapla_toolbelt_metadata-0.9.11.dist-info/RECORD +97 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/WHEEL +1 -1
- dapla_metadata/datasets/config.py +0 -80
- dapla_metadata/datasets/model_backwards_compatibility.py +0 -520
- dapla_metadata/datasets/user_info.py +0 -88
- dapla_toolbelt_metadata-0.2.1.dist-info/RECORD +0 -22
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,583 @@
|
|
|
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.validity_period import ValidityPeriod
|
|
26
|
+
from ..rest import RESTResponseType
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ValidityPeriodsApi:
|
|
30
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
31
|
+
Ref: https://openapi-generator.tech
|
|
32
|
+
|
|
33
|
+
Do not edit the class manually.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, api_client=None) -> None:
|
|
37
|
+
if api_client is None:
|
|
38
|
+
api_client = ApiClient.get_default()
|
|
39
|
+
self.api_client = api_client
|
|
40
|
+
|
|
41
|
+
@validate_call
|
|
42
|
+
def create_validity_period(
|
|
43
|
+
self,
|
|
44
|
+
variable_definition_id: Annotated[
|
|
45
|
+
StrictStr,
|
|
46
|
+
Field(description="Unique identifier for the variable definition."),
|
|
47
|
+
],
|
|
48
|
+
active_group: Annotated[
|
|
49
|
+
StrictStr,
|
|
50
|
+
Field(description="The group which the user currently represents."),
|
|
51
|
+
],
|
|
52
|
+
validity_period: ValidityPeriod | None = None,
|
|
53
|
+
_request_timeout: None
|
|
54
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
55
|
+
| tuple[
|
|
56
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
57
|
+
] = None,
|
|
58
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
59
|
+
_content_type: StrictStr | None = None,
|
|
60
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
61
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
62
|
+
) -> CompleteResponse:
|
|
63
|
+
"""Create a new validity period for a variable definition.
|
|
64
|
+
|
|
65
|
+
Create a new validity period for a variable definition.
|
|
66
|
+
|
|
67
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
68
|
+
:type variable_definition_id: str
|
|
69
|
+
:param active_group: The group which the user currently represents. (required)
|
|
70
|
+
:type active_group: str
|
|
71
|
+
:param validity_period:
|
|
72
|
+
:type validity_period: ValidityPeriod
|
|
73
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
74
|
+
number provided, it will be total request
|
|
75
|
+
timeout. It can also be a pair (tuple) of
|
|
76
|
+
(connection, read) timeouts.
|
|
77
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
78
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
79
|
+
request; this effectively ignores the
|
|
80
|
+
authentication in the spec for a single request.
|
|
81
|
+
:type _request_auth: dict, optional
|
|
82
|
+
:param _content_type: force content-type for the request.
|
|
83
|
+
:type _content_type: str, Optional
|
|
84
|
+
:param _headers: set to override the headers for a single
|
|
85
|
+
request; this effectively ignores the headers
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _headers: dict, optional
|
|
88
|
+
:param _host_index: set to override the host_index for a single
|
|
89
|
+
request; this effectively ignores the host_index
|
|
90
|
+
in the spec for a single request.
|
|
91
|
+
:type _host_index: int, optional
|
|
92
|
+
:return: Returns the result object.
|
|
93
|
+
"""
|
|
94
|
+
_param = self._create_validity_period_serialize(
|
|
95
|
+
variable_definition_id=variable_definition_id,
|
|
96
|
+
active_group=active_group,
|
|
97
|
+
validity_period=validity_period,
|
|
98
|
+
_request_auth=_request_auth,
|
|
99
|
+
_content_type=_content_type,
|
|
100
|
+
_headers=_headers,
|
|
101
|
+
_host_index=_host_index,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
_response_types_map: dict[str, str | None] = {
|
|
105
|
+
"201": "CompleteResponse",
|
|
106
|
+
"404": "Problem",
|
|
107
|
+
"400": "Problem",
|
|
108
|
+
"405": "Problem",
|
|
109
|
+
}
|
|
110
|
+
response_data = self.api_client.call_api(
|
|
111
|
+
*_param, _request_timeout=_request_timeout
|
|
112
|
+
)
|
|
113
|
+
response_data.read()
|
|
114
|
+
return self.api_client.response_deserialize(
|
|
115
|
+
response_data=response_data,
|
|
116
|
+
response_types_map=_response_types_map,
|
|
117
|
+
).data
|
|
118
|
+
|
|
119
|
+
@validate_call
|
|
120
|
+
def create_validity_period_with_http_info(
|
|
121
|
+
self,
|
|
122
|
+
variable_definition_id: Annotated[
|
|
123
|
+
StrictStr,
|
|
124
|
+
Field(description="Unique identifier for the variable definition."),
|
|
125
|
+
],
|
|
126
|
+
active_group: Annotated[
|
|
127
|
+
StrictStr,
|
|
128
|
+
Field(description="The group which the user currently represents."),
|
|
129
|
+
],
|
|
130
|
+
validity_period: ValidityPeriod | None = None,
|
|
131
|
+
_request_timeout: None
|
|
132
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
133
|
+
| tuple[
|
|
134
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
135
|
+
] = None,
|
|
136
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
137
|
+
_content_type: StrictStr | None = None,
|
|
138
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
139
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
140
|
+
) -> ApiResponse[CompleteResponse]:
|
|
141
|
+
"""Create a new validity period for a variable definition.
|
|
142
|
+
|
|
143
|
+
Create a new validity period for a variable definition.
|
|
144
|
+
|
|
145
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
146
|
+
:type variable_definition_id: str
|
|
147
|
+
:param active_group: The group which the user currently represents. (required)
|
|
148
|
+
:type active_group: str
|
|
149
|
+
:param validity_period:
|
|
150
|
+
:type validity_period: ValidityPeriod
|
|
151
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
152
|
+
number provided, it will be total request
|
|
153
|
+
timeout. It can also be a pair (tuple) of
|
|
154
|
+
(connection, read) timeouts.
|
|
155
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
156
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
157
|
+
request; this effectively ignores the
|
|
158
|
+
authentication in the spec for a single request.
|
|
159
|
+
:type _request_auth: dict, optional
|
|
160
|
+
:param _content_type: force content-type for the request.
|
|
161
|
+
:type _content_type: str, Optional
|
|
162
|
+
:param _headers: set to override the headers for a single
|
|
163
|
+
request; this effectively ignores the headers
|
|
164
|
+
in the spec for a single request.
|
|
165
|
+
:type _headers: dict, optional
|
|
166
|
+
:param _host_index: set to override the host_index for a single
|
|
167
|
+
request; this effectively ignores the host_index
|
|
168
|
+
in the spec for a single request.
|
|
169
|
+
:type _host_index: int, optional
|
|
170
|
+
:return: Returns the result object.
|
|
171
|
+
"""
|
|
172
|
+
_param = self._create_validity_period_serialize(
|
|
173
|
+
variable_definition_id=variable_definition_id,
|
|
174
|
+
active_group=active_group,
|
|
175
|
+
validity_period=validity_period,
|
|
176
|
+
_request_auth=_request_auth,
|
|
177
|
+
_content_type=_content_type,
|
|
178
|
+
_headers=_headers,
|
|
179
|
+
_host_index=_host_index,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
_response_types_map: dict[str, str | None] = {
|
|
183
|
+
"201": "CompleteResponse",
|
|
184
|
+
"404": "Problem",
|
|
185
|
+
"400": "Problem",
|
|
186
|
+
"405": "Problem",
|
|
187
|
+
}
|
|
188
|
+
response_data = self.api_client.call_api(
|
|
189
|
+
*_param, _request_timeout=_request_timeout
|
|
190
|
+
)
|
|
191
|
+
response_data.read()
|
|
192
|
+
return self.api_client.response_deserialize(
|
|
193
|
+
response_data=response_data,
|
|
194
|
+
response_types_map=_response_types_map,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
@validate_call
|
|
198
|
+
def create_validity_period_without_preload_content(
|
|
199
|
+
self,
|
|
200
|
+
variable_definition_id: Annotated[
|
|
201
|
+
StrictStr,
|
|
202
|
+
Field(description="Unique identifier for the variable definition."),
|
|
203
|
+
],
|
|
204
|
+
active_group: Annotated[
|
|
205
|
+
StrictStr,
|
|
206
|
+
Field(description="The group which the user currently represents."),
|
|
207
|
+
],
|
|
208
|
+
validity_period: ValidityPeriod | None = None,
|
|
209
|
+
_request_timeout: None
|
|
210
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
211
|
+
| tuple[
|
|
212
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
213
|
+
] = None,
|
|
214
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
215
|
+
_content_type: StrictStr | None = None,
|
|
216
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
217
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
218
|
+
) -> RESTResponseType:
|
|
219
|
+
"""Create a new validity period for a variable definition.
|
|
220
|
+
|
|
221
|
+
Create a new validity period for a variable definition.
|
|
222
|
+
|
|
223
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
224
|
+
:type variable_definition_id: str
|
|
225
|
+
:param active_group: The group which the user currently represents. (required)
|
|
226
|
+
:type active_group: str
|
|
227
|
+
:param validity_period:
|
|
228
|
+
:type validity_period: ValidityPeriod
|
|
229
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
230
|
+
number provided, it will be total request
|
|
231
|
+
timeout. It can also be a pair (tuple) of
|
|
232
|
+
(connection, read) timeouts.
|
|
233
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
234
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
235
|
+
request; this effectively ignores the
|
|
236
|
+
authentication in the spec for a single request.
|
|
237
|
+
:type _request_auth: dict, optional
|
|
238
|
+
:param _content_type: force content-type for the request.
|
|
239
|
+
:type _content_type: str, Optional
|
|
240
|
+
:param _headers: set to override the headers for a single
|
|
241
|
+
request; this effectively ignores the headers
|
|
242
|
+
in the spec for a single request.
|
|
243
|
+
:type _headers: dict, optional
|
|
244
|
+
:param _host_index: set to override the host_index for a single
|
|
245
|
+
request; this effectively ignores the host_index
|
|
246
|
+
in the spec for a single request.
|
|
247
|
+
:type _host_index: int, optional
|
|
248
|
+
:return: Returns the result object.
|
|
249
|
+
"""
|
|
250
|
+
_param = self._create_validity_period_serialize(
|
|
251
|
+
variable_definition_id=variable_definition_id,
|
|
252
|
+
active_group=active_group,
|
|
253
|
+
validity_period=validity_period,
|
|
254
|
+
_request_auth=_request_auth,
|
|
255
|
+
_content_type=_content_type,
|
|
256
|
+
_headers=_headers,
|
|
257
|
+
_host_index=_host_index,
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
_response_types_map: dict[str, str | None] = {
|
|
261
|
+
"201": "CompleteResponse",
|
|
262
|
+
"404": "Problem",
|
|
263
|
+
"400": "Problem",
|
|
264
|
+
"405": "Problem",
|
|
265
|
+
}
|
|
266
|
+
response_data = self.api_client.call_api(
|
|
267
|
+
*_param, _request_timeout=_request_timeout
|
|
268
|
+
)
|
|
269
|
+
return response_data.response
|
|
270
|
+
|
|
271
|
+
def _create_validity_period_serialize(
|
|
272
|
+
self,
|
|
273
|
+
variable_definition_id,
|
|
274
|
+
active_group,
|
|
275
|
+
validity_period,
|
|
276
|
+
_request_auth,
|
|
277
|
+
_content_type,
|
|
278
|
+
_headers,
|
|
279
|
+
_host_index,
|
|
280
|
+
) -> RequestSerialized:
|
|
281
|
+
_host = None
|
|
282
|
+
|
|
283
|
+
_collection_formats: dict[str, str] = {}
|
|
284
|
+
|
|
285
|
+
_path_params: dict[str, str] = {}
|
|
286
|
+
_query_params: list[tuple[str, str]] = []
|
|
287
|
+
_header_params: dict[str, str | None] = _headers or {}
|
|
288
|
+
_form_params: list[tuple[str, str]] = []
|
|
289
|
+
_files: dict[
|
|
290
|
+
str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
|
|
291
|
+
] = {}
|
|
292
|
+
_body_params: bytes | None = None
|
|
293
|
+
|
|
294
|
+
# process the path parameters
|
|
295
|
+
if variable_definition_id is not None:
|
|
296
|
+
_path_params["variable-definition-id"] = variable_definition_id
|
|
297
|
+
# process the query parameters
|
|
298
|
+
if active_group is not None:
|
|
299
|
+
_query_params.append(("active_group", active_group))
|
|
300
|
+
|
|
301
|
+
# process the header parameters
|
|
302
|
+
# process the form parameters
|
|
303
|
+
# process the body parameter
|
|
304
|
+
if validity_period is not None:
|
|
305
|
+
_body_params = validity_period
|
|
306
|
+
|
|
307
|
+
# set the HTTP header `Accept`
|
|
308
|
+
if "Accept" not in _header_params:
|
|
309
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
310
|
+
["application/json", "application/problem+json"]
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
# set the HTTP header `Content-Type`
|
|
314
|
+
if _content_type:
|
|
315
|
+
_header_params["Content-Type"] = _content_type
|
|
316
|
+
else:
|
|
317
|
+
_default_content_type = self.api_client.select_header_content_type(
|
|
318
|
+
["application/json"]
|
|
319
|
+
)
|
|
320
|
+
if _default_content_type is not None:
|
|
321
|
+
_header_params["Content-Type"] = _default_content_type
|
|
322
|
+
|
|
323
|
+
# authentication setting
|
|
324
|
+
_auth_settings: list[str] = ["keycloak_token"]
|
|
325
|
+
|
|
326
|
+
return self.api_client.param_serialize(
|
|
327
|
+
method="POST",
|
|
328
|
+
resource_path="/variable-definitions/{variable-definition-id}/validity-periods",
|
|
329
|
+
path_params=_path_params,
|
|
330
|
+
query_params=_query_params,
|
|
331
|
+
header_params=_header_params,
|
|
332
|
+
body=_body_params,
|
|
333
|
+
post_params=_form_params,
|
|
334
|
+
files=_files,
|
|
335
|
+
auth_settings=_auth_settings,
|
|
336
|
+
collection_formats=_collection_formats,
|
|
337
|
+
_host=_host,
|
|
338
|
+
_request_auth=_request_auth,
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
@validate_call
|
|
342
|
+
def list_validity_periods(
|
|
343
|
+
self,
|
|
344
|
+
variable_definition_id: Annotated[
|
|
345
|
+
StrictStr,
|
|
346
|
+
Field(description="Unique identifier for the variable definition."),
|
|
347
|
+
],
|
|
348
|
+
_request_timeout: None
|
|
349
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
350
|
+
| tuple[
|
|
351
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
352
|
+
] = None,
|
|
353
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
354
|
+
_content_type: StrictStr | None = None,
|
|
355
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
356
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
357
|
+
) -> list[CompleteResponse]:
|
|
358
|
+
"""List all validity periods.
|
|
359
|
+
|
|
360
|
+
List all validity periods.
|
|
361
|
+
|
|
362
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
363
|
+
:type variable_definition_id: str
|
|
364
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
365
|
+
number provided, it will be total request
|
|
366
|
+
timeout. It can also be a pair (tuple) of
|
|
367
|
+
(connection, read) timeouts.
|
|
368
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
369
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
370
|
+
request; this effectively ignores the
|
|
371
|
+
authentication in the spec for a single request.
|
|
372
|
+
:type _request_auth: dict, optional
|
|
373
|
+
:param _content_type: force content-type for the request.
|
|
374
|
+
:type _content_type: str, Optional
|
|
375
|
+
:param _headers: set to override the headers for a single
|
|
376
|
+
request; this effectively ignores the headers
|
|
377
|
+
in the spec for a single request.
|
|
378
|
+
:type _headers: dict, optional
|
|
379
|
+
:param _host_index: set to override the host_index for a single
|
|
380
|
+
request; this effectively ignores the host_index
|
|
381
|
+
in the spec for a single request.
|
|
382
|
+
:type _host_index: int, optional
|
|
383
|
+
:return: Returns the result object.
|
|
384
|
+
"""
|
|
385
|
+
_param = self._list_validity_periods_serialize(
|
|
386
|
+
variable_definition_id=variable_definition_id,
|
|
387
|
+
_request_auth=_request_auth,
|
|
388
|
+
_content_type=_content_type,
|
|
389
|
+
_headers=_headers,
|
|
390
|
+
_host_index=_host_index,
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
_response_types_map: dict[str, str | None] = {
|
|
394
|
+
"200": "List[CompleteResponse]",
|
|
395
|
+
"404": "Problem",
|
|
396
|
+
}
|
|
397
|
+
response_data = self.api_client.call_api(
|
|
398
|
+
*_param, _request_timeout=_request_timeout
|
|
399
|
+
)
|
|
400
|
+
response_data.read()
|
|
401
|
+
return self.api_client.response_deserialize(
|
|
402
|
+
response_data=response_data,
|
|
403
|
+
response_types_map=_response_types_map,
|
|
404
|
+
).data
|
|
405
|
+
|
|
406
|
+
@validate_call
|
|
407
|
+
def list_validity_periods_with_http_info(
|
|
408
|
+
self,
|
|
409
|
+
variable_definition_id: Annotated[
|
|
410
|
+
StrictStr,
|
|
411
|
+
Field(description="Unique identifier for the variable definition."),
|
|
412
|
+
],
|
|
413
|
+
_request_timeout: None
|
|
414
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
415
|
+
| tuple[
|
|
416
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
417
|
+
] = None,
|
|
418
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
419
|
+
_content_type: StrictStr | None = None,
|
|
420
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
421
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
422
|
+
) -> ApiResponse[list[CompleteResponse]]:
|
|
423
|
+
"""List all validity periods.
|
|
424
|
+
|
|
425
|
+
List all validity periods.
|
|
426
|
+
|
|
427
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
428
|
+
:type variable_definition_id: str
|
|
429
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
430
|
+
number provided, it will be total request
|
|
431
|
+
timeout. It can also be a pair (tuple) of
|
|
432
|
+
(connection, read) timeouts.
|
|
433
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
434
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
435
|
+
request; this effectively ignores the
|
|
436
|
+
authentication in the spec for a single request.
|
|
437
|
+
:type _request_auth: dict, optional
|
|
438
|
+
:param _content_type: force content-type for the request.
|
|
439
|
+
:type _content_type: str, Optional
|
|
440
|
+
:param _headers: set to override the headers for a single
|
|
441
|
+
request; this effectively ignores the headers
|
|
442
|
+
in the spec for a single request.
|
|
443
|
+
:type _headers: dict, optional
|
|
444
|
+
:param _host_index: set to override the host_index for a single
|
|
445
|
+
request; this effectively ignores the host_index
|
|
446
|
+
in the spec for a single request.
|
|
447
|
+
:type _host_index: int, optional
|
|
448
|
+
:return: Returns the result object.
|
|
449
|
+
"""
|
|
450
|
+
_param = self._list_validity_periods_serialize(
|
|
451
|
+
variable_definition_id=variable_definition_id,
|
|
452
|
+
_request_auth=_request_auth,
|
|
453
|
+
_content_type=_content_type,
|
|
454
|
+
_headers=_headers,
|
|
455
|
+
_host_index=_host_index,
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
_response_types_map: dict[str, str | None] = {
|
|
459
|
+
"200": "List[CompleteResponse]",
|
|
460
|
+
"404": "Problem",
|
|
461
|
+
}
|
|
462
|
+
response_data = self.api_client.call_api(
|
|
463
|
+
*_param, _request_timeout=_request_timeout
|
|
464
|
+
)
|
|
465
|
+
response_data.read()
|
|
466
|
+
return self.api_client.response_deserialize(
|
|
467
|
+
response_data=response_data,
|
|
468
|
+
response_types_map=_response_types_map,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
@validate_call
|
|
472
|
+
def list_validity_periods_without_preload_content(
|
|
473
|
+
self,
|
|
474
|
+
variable_definition_id: Annotated[
|
|
475
|
+
StrictStr,
|
|
476
|
+
Field(description="Unique identifier for the variable definition."),
|
|
477
|
+
],
|
|
478
|
+
_request_timeout: None
|
|
479
|
+
| Annotated[StrictFloat, Field(gt=0)]
|
|
480
|
+
| tuple[
|
|
481
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
482
|
+
] = None,
|
|
483
|
+
_request_auth: dict[StrictStr, Any] | None = None,
|
|
484
|
+
_content_type: StrictStr | None = None,
|
|
485
|
+
_headers: dict[StrictStr, Any] | None = None,
|
|
486
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
487
|
+
) -> RESTResponseType:
|
|
488
|
+
"""List all validity periods.
|
|
489
|
+
|
|
490
|
+
List all validity periods.
|
|
491
|
+
|
|
492
|
+
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
493
|
+
:type variable_definition_id: str
|
|
494
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
495
|
+
number provided, it will be total request
|
|
496
|
+
timeout. It can also be a pair (tuple) of
|
|
497
|
+
(connection, read) timeouts.
|
|
498
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
499
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
500
|
+
request; this effectively ignores the
|
|
501
|
+
authentication in the spec for a single request.
|
|
502
|
+
:type _request_auth: dict, optional
|
|
503
|
+
:param _content_type: force content-type for the request.
|
|
504
|
+
:type _content_type: str, Optional
|
|
505
|
+
:param _headers: set to override the headers for a single
|
|
506
|
+
request; this effectively ignores the headers
|
|
507
|
+
in the spec for a single request.
|
|
508
|
+
:type _headers: dict, optional
|
|
509
|
+
:param _host_index: set to override the host_index for a single
|
|
510
|
+
request; this effectively ignores the host_index
|
|
511
|
+
in the spec for a single request.
|
|
512
|
+
:type _host_index: int, optional
|
|
513
|
+
:return: Returns the result object.
|
|
514
|
+
"""
|
|
515
|
+
_param = self._list_validity_periods_serialize(
|
|
516
|
+
variable_definition_id=variable_definition_id,
|
|
517
|
+
_request_auth=_request_auth,
|
|
518
|
+
_content_type=_content_type,
|
|
519
|
+
_headers=_headers,
|
|
520
|
+
_host_index=_host_index,
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
_response_types_map: dict[str, str | None] = {
|
|
524
|
+
"200": "List[CompleteResponse]",
|
|
525
|
+
"404": "Problem",
|
|
526
|
+
}
|
|
527
|
+
response_data = self.api_client.call_api(
|
|
528
|
+
*_param, _request_timeout=_request_timeout
|
|
529
|
+
)
|
|
530
|
+
return response_data.response
|
|
531
|
+
|
|
532
|
+
def _list_validity_periods_serialize(
|
|
533
|
+
self,
|
|
534
|
+
variable_definition_id,
|
|
535
|
+
_request_auth,
|
|
536
|
+
_content_type,
|
|
537
|
+
_headers,
|
|
538
|
+
_host_index,
|
|
539
|
+
) -> RequestSerialized:
|
|
540
|
+
_host = None
|
|
541
|
+
|
|
542
|
+
_collection_formats: dict[str, str] = {}
|
|
543
|
+
|
|
544
|
+
_path_params: dict[str, str] = {}
|
|
545
|
+
_query_params: list[tuple[str, str]] = []
|
|
546
|
+
_header_params: dict[str, str | None] = _headers or {}
|
|
547
|
+
_form_params: list[tuple[str, str]] = []
|
|
548
|
+
_files: dict[
|
|
549
|
+
str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]
|
|
550
|
+
] = {}
|
|
551
|
+
_body_params: bytes | None = None
|
|
552
|
+
|
|
553
|
+
# process the path parameters
|
|
554
|
+
if variable_definition_id is not None:
|
|
555
|
+
_path_params["variable-definition-id"] = variable_definition_id
|
|
556
|
+
# process the query parameters
|
|
557
|
+
# process the header parameters
|
|
558
|
+
# process the form parameters
|
|
559
|
+
# process the body parameter
|
|
560
|
+
|
|
561
|
+
# set the HTTP header `Accept`
|
|
562
|
+
if "Accept" not in _header_params:
|
|
563
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
564
|
+
["application/json", "application/problem+json"]
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
# authentication setting
|
|
568
|
+
_auth_settings: list[str] = ["keycloak_token"]
|
|
569
|
+
|
|
570
|
+
return self.api_client.param_serialize(
|
|
571
|
+
method="GET",
|
|
572
|
+
resource_path="/variable-definitions/{variable-definition-id}/validity-periods",
|
|
573
|
+
path_params=_path_params,
|
|
574
|
+
query_params=_query_params,
|
|
575
|
+
header_params=_header_params,
|
|
576
|
+
body=_body_params,
|
|
577
|
+
post_params=_form_params,
|
|
578
|
+
files=_files,
|
|
579
|
+
auth_settings=_auth_settings,
|
|
580
|
+
collection_formats=_collection_formats,
|
|
581
|
+
_host=_host,
|
|
582
|
+
_request_auth=_request_auth,
|
|
583
|
+
)
|