dapla-toolbelt-metadata 0.4.2__py3-none-any.whl → 0.5.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.
- dapla_metadata/__init__.py +7 -0
- dapla_metadata/dapla/__init__.py +1 -0
- dapla_metadata/{_shared → dapla}/user_info.py +55 -8
- dapla_metadata/datasets/code_list.py +1 -1
- dapla_metadata/datasets/core.py +1 -1
- dapla_metadata/datasets/dataset_parser.py +1 -1
- dapla_metadata/datasets/model_backwards_compatibility.py +6 -6
- dapla_metadata/datasets/model_validation.py +2 -2
- dapla_metadata/datasets/utility/constants.py +1 -0
- dapla_metadata/datasets/utility/enums.py +1 -1
- dapla_metadata/datasets/utility/utils.py +7 -11
- dapla_metadata/variable_definitions/__init__.py +5 -3
- dapla_metadata/variable_definitions/{generated → _generated}/.openapi-generator/FILES +0 -5
- dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/__init__.py +0 -5
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/__init__.py +0 -1
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/data_migration_api.py +2 -2
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/draft_variable_definitions_api.py +14 -14
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/patches_api.py +15 -15
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/validity_periods_api.py +8 -281
- dapla_metadata/variable_definitions/{generated/vardef_client/api/public_api.py → _generated/vardef_client/api/variable_definitions_api.py} +73 -358
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/__init__.py +2 -6
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/complete_response.py +8 -32
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/contact.py +2 -2
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/draft.py +8 -23
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/language_string_type.py +7 -6
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/owner.py +2 -2
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/patch.py +16 -61
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/problem.py +2 -2
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/update_draft.py +22 -55
- dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/validity_period.py +14 -48
- dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
- dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
- dapla_metadata/variable_definitions/{_client.py → _utils/_client.py} +5 -3
- dapla_metadata/variable_definitions/{config.py → _utils/config.py} +25 -1
- dapla_metadata/variable_definitions/_utils/constants.py +41 -0
- dapla_metadata/variable_definitions/_utils/descriptions.py +86 -0
- dapla_metadata/variable_definitions/_utils/files.py +273 -0
- dapla_metadata/variable_definitions/_utils/template_files.py +112 -0
- dapla_metadata/variable_definitions/_utils/variable_definition_files.py +93 -0
- dapla_metadata/variable_definitions/exceptions.py +141 -11
- dapla_metadata/variable_definitions/resources/vardef_model_descriptions_nb.yaml +63 -0
- dapla_metadata/variable_definitions/vardef.py +131 -10
- dapla_metadata/variable_definitions/variable_definition.py +241 -43
- {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.5.0.dist-info}/METADATA +5 -7
- dapla_toolbelt_metadata-0.5.0.dist-info/RECORD +84 -0
- {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.5.0.dist-info}/WHEEL +1 -1
- dapla_metadata/variable_definitions/generated/.openapi-generator/VERSION +0 -1
- dapla_metadata/variable_definitions/generated/vardef_client/api/variable_definitions_api.py +0 -1205
- dapla_metadata/variable_definitions/generated/vardef_client/models/klass_reference.py +0 -99
- dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_contact.py +0 -92
- dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_variable_definition.py +0 -235
- dapla_metadata/variable_definitions/generated/vardef_client/models/supported_languages.py +0 -33
- dapla_metadata/variable_definitions/generated/vardef_client/models/variable_status.py +0 -33
- dapla_toolbelt_metadata-0.4.2.dist-info/RECORD +0 -81
- /dapla_metadata/variable_definitions/{generated → _generated}/.openapi-generator-ignore +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/README.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/__init__.py +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api_client.py +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api_response.py +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/configuration.py +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/CompleteResponse.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Contact.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/DataMigrationApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Draft.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/DraftVariableDefinitionsApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/LanguageStringType.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Owner.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Patch.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/PatchesApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/PublicApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/SupportedLanguages.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/UpdateDraft.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/ValidityPeriod.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/ValidityPeriodsApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/VariableDefinitionsApi.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/VariableStatus.md +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/exceptions.py +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/py.typed +0 -0
- /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/rest.py +0 -0
- {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.5.0.dist-info}/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"""Variable Definitions
|
|
1
|
+
"""Internal Variable Definitions Administration API
|
|
2
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`.
|
|
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
4
|
|
|
5
5
|
The version of the OpenAPI document: 0.1
|
|
6
6
|
Contact: metadata@ssb.no
|
|
@@ -22,8 +22,6 @@ from ..api_client import ApiClient
|
|
|
22
22
|
from ..api_client import RequestSerialized
|
|
23
23
|
from ..api_response import ApiResponse
|
|
24
24
|
from ..models.complete_response import CompleteResponse
|
|
25
|
-
from ..models.rendered_variable_definition import RenderedVariableDefinition
|
|
26
|
-
from ..models.supported_languages import SupportedLanguages
|
|
27
25
|
from ..models.validity_period import ValidityPeriod
|
|
28
26
|
from ..rest import RESTResponseType
|
|
29
27
|
|
|
@@ -51,7 +49,7 @@ class ValidityPeriodsApi:
|
|
|
51
49
|
StrictStr,
|
|
52
50
|
Field(description="The group which the user currently represents."),
|
|
53
51
|
],
|
|
54
|
-
validity_period: ValidityPeriod,
|
|
52
|
+
validity_period: ValidityPeriod | None = None,
|
|
55
53
|
_request_timeout: None
|
|
56
54
|
| Annotated[StrictFloat, Field(gt=0)]
|
|
57
55
|
| tuple[
|
|
@@ -70,7 +68,7 @@ class ValidityPeriodsApi:
|
|
|
70
68
|
:type variable_definition_id: str
|
|
71
69
|
:param active_group: The group which the user currently represents. (required)
|
|
72
70
|
:type active_group: str
|
|
73
|
-
:param validity_period:
|
|
71
|
+
:param validity_period:
|
|
74
72
|
:type validity_period: ValidityPeriod
|
|
75
73
|
:param _request_timeout: timeout setting for this request. If one
|
|
76
74
|
number provided, it will be total request
|
|
@@ -130,7 +128,7 @@ class ValidityPeriodsApi:
|
|
|
130
128
|
StrictStr,
|
|
131
129
|
Field(description="The group which the user currently represents."),
|
|
132
130
|
],
|
|
133
|
-
validity_period: ValidityPeriod,
|
|
131
|
+
validity_period: ValidityPeriod | None = None,
|
|
134
132
|
_request_timeout: None
|
|
135
133
|
| Annotated[StrictFloat, Field(gt=0)]
|
|
136
134
|
| tuple[
|
|
@@ -149,7 +147,7 @@ class ValidityPeriodsApi:
|
|
|
149
147
|
:type variable_definition_id: str
|
|
150
148
|
:param active_group: The group which the user currently represents. (required)
|
|
151
149
|
:type active_group: str
|
|
152
|
-
:param validity_period:
|
|
150
|
+
:param validity_period:
|
|
153
151
|
:type validity_period: ValidityPeriod
|
|
154
152
|
:param _request_timeout: timeout setting for this request. If one
|
|
155
153
|
number provided, it will be total request
|
|
@@ -209,7 +207,7 @@ class ValidityPeriodsApi:
|
|
|
209
207
|
StrictStr,
|
|
210
208
|
Field(description="The group which the user currently represents."),
|
|
211
209
|
],
|
|
212
|
-
validity_period: ValidityPeriod,
|
|
210
|
+
validity_period: ValidityPeriod | None = None,
|
|
213
211
|
_request_timeout: None
|
|
214
212
|
| Annotated[StrictFloat, Field(gt=0)]
|
|
215
213
|
| tuple[
|
|
@@ -228,7 +226,7 @@ class ValidityPeriodsApi:
|
|
|
228
226
|
:type variable_definition_id: str
|
|
229
227
|
:param active_group: The group which the user currently represents. (required)
|
|
230
228
|
:type active_group: str
|
|
231
|
-
:param validity_period:
|
|
229
|
+
:param validity_period:
|
|
232
230
|
:type validity_period: ValidityPeriod
|
|
233
231
|
:param _request_timeout: timeout setting for this request. If one
|
|
234
232
|
number provided, it will be total request
|
|
@@ -351,277 +349,6 @@ class ValidityPeriodsApi:
|
|
|
351
349
|
_request_auth=_request_auth,
|
|
352
350
|
)
|
|
353
351
|
|
|
354
|
-
@validate_call
|
|
355
|
-
def list_public_validity_periods(
|
|
356
|
-
self,
|
|
357
|
-
variable_definition_id: Annotated[
|
|
358
|
-
StrictStr,
|
|
359
|
-
Field(description="Unique identifier for the variable definition."),
|
|
360
|
-
],
|
|
361
|
-
accept_language: Annotated[
|
|
362
|
-
SupportedLanguages,
|
|
363
|
-
Field(description="Render the variable definition in the given language."),
|
|
364
|
-
],
|
|
365
|
-
_request_timeout: None
|
|
366
|
-
| Annotated[StrictFloat, Field(gt=0)]
|
|
367
|
-
| tuple[
|
|
368
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
369
|
-
] = None,
|
|
370
|
-
_request_auth: dict[StrictStr, Any] | None = None,
|
|
371
|
-
_content_type: StrictStr | None = None,
|
|
372
|
-
_headers: dict[StrictStr, Any] | None = None,
|
|
373
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
374
|
-
) -> list[RenderedVariableDefinition]:
|
|
375
|
-
"""List all validity periods.
|
|
376
|
-
|
|
377
|
-
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
|
|
378
|
-
|
|
379
|
-
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
380
|
-
:type variable_definition_id: str
|
|
381
|
-
:param accept_language: Render the variable definition in the given language. (required)
|
|
382
|
-
:type accept_language: SupportedLanguages
|
|
383
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
384
|
-
number provided, it will be total request
|
|
385
|
-
timeout. It can also be a pair (tuple) of
|
|
386
|
-
(connection, read) timeouts.
|
|
387
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
388
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
389
|
-
request; this effectively ignores the
|
|
390
|
-
authentication in the spec for a single request.
|
|
391
|
-
:type _request_auth: dict, optional
|
|
392
|
-
:param _content_type: force content-type for the request.
|
|
393
|
-
:type _content_type: str, Optional
|
|
394
|
-
:param _headers: set to override the headers for a single
|
|
395
|
-
request; this effectively ignores the headers
|
|
396
|
-
in the spec for a single request.
|
|
397
|
-
:type _headers: dict, optional
|
|
398
|
-
:param _host_index: set to override the host_index for a single
|
|
399
|
-
request; this effectively ignores the host_index
|
|
400
|
-
in the spec for a single request.
|
|
401
|
-
:type _host_index: int, optional
|
|
402
|
-
:return: Returns the result object.
|
|
403
|
-
"""
|
|
404
|
-
_param = self._list_public_validity_periods_serialize(
|
|
405
|
-
variable_definition_id=variable_definition_id,
|
|
406
|
-
accept_language=accept_language,
|
|
407
|
-
_request_auth=_request_auth,
|
|
408
|
-
_content_type=_content_type,
|
|
409
|
-
_headers=_headers,
|
|
410
|
-
_host_index=_host_index,
|
|
411
|
-
)
|
|
412
|
-
|
|
413
|
-
_response_types_map: dict[str, str | None] = {
|
|
414
|
-
"200": "List[RenderedVariableDefinition]",
|
|
415
|
-
}
|
|
416
|
-
response_data = self.api_client.call_api(
|
|
417
|
-
*_param,
|
|
418
|
-
_request_timeout=_request_timeout,
|
|
419
|
-
)
|
|
420
|
-
response_data.read()
|
|
421
|
-
return self.api_client.response_deserialize(
|
|
422
|
-
response_data=response_data,
|
|
423
|
-
response_types_map=_response_types_map,
|
|
424
|
-
).data
|
|
425
|
-
|
|
426
|
-
@validate_call
|
|
427
|
-
def list_public_validity_periods_with_http_info(
|
|
428
|
-
self,
|
|
429
|
-
variable_definition_id: Annotated[
|
|
430
|
-
StrictStr,
|
|
431
|
-
Field(description="Unique identifier for the variable definition."),
|
|
432
|
-
],
|
|
433
|
-
accept_language: Annotated[
|
|
434
|
-
SupportedLanguages,
|
|
435
|
-
Field(description="Render the variable definition in the given language."),
|
|
436
|
-
],
|
|
437
|
-
_request_timeout: None
|
|
438
|
-
| Annotated[StrictFloat, Field(gt=0)]
|
|
439
|
-
| tuple[
|
|
440
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
441
|
-
] = None,
|
|
442
|
-
_request_auth: dict[StrictStr, Any] | None = None,
|
|
443
|
-
_content_type: StrictStr | None = None,
|
|
444
|
-
_headers: dict[StrictStr, Any] | None = None,
|
|
445
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
446
|
-
) -> ApiResponse[list[RenderedVariableDefinition]]:
|
|
447
|
-
"""List all validity periods.
|
|
448
|
-
|
|
449
|
-
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
|
|
450
|
-
|
|
451
|
-
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
452
|
-
:type variable_definition_id: str
|
|
453
|
-
:param accept_language: Render the variable definition in the given language. (required)
|
|
454
|
-
:type accept_language: SupportedLanguages
|
|
455
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
456
|
-
number provided, it will be total request
|
|
457
|
-
timeout. It can also be a pair (tuple) of
|
|
458
|
-
(connection, read) timeouts.
|
|
459
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
460
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
461
|
-
request; this effectively ignores the
|
|
462
|
-
authentication in the spec for a single request.
|
|
463
|
-
:type _request_auth: dict, optional
|
|
464
|
-
:param _content_type: force content-type for the request.
|
|
465
|
-
:type _content_type: str, Optional
|
|
466
|
-
:param _headers: set to override the headers for a single
|
|
467
|
-
request; this effectively ignores the headers
|
|
468
|
-
in the spec for a single request.
|
|
469
|
-
:type _headers: dict, optional
|
|
470
|
-
:param _host_index: set to override the host_index for a single
|
|
471
|
-
request; this effectively ignores the host_index
|
|
472
|
-
in the spec for a single request.
|
|
473
|
-
:type _host_index: int, optional
|
|
474
|
-
:return: Returns the result object.
|
|
475
|
-
"""
|
|
476
|
-
_param = self._list_public_validity_periods_serialize(
|
|
477
|
-
variable_definition_id=variable_definition_id,
|
|
478
|
-
accept_language=accept_language,
|
|
479
|
-
_request_auth=_request_auth,
|
|
480
|
-
_content_type=_content_type,
|
|
481
|
-
_headers=_headers,
|
|
482
|
-
_host_index=_host_index,
|
|
483
|
-
)
|
|
484
|
-
|
|
485
|
-
_response_types_map: dict[str, str | None] = {
|
|
486
|
-
"200": "List[RenderedVariableDefinition]",
|
|
487
|
-
}
|
|
488
|
-
response_data = self.api_client.call_api(
|
|
489
|
-
*_param,
|
|
490
|
-
_request_timeout=_request_timeout,
|
|
491
|
-
)
|
|
492
|
-
response_data.read()
|
|
493
|
-
return self.api_client.response_deserialize(
|
|
494
|
-
response_data=response_data,
|
|
495
|
-
response_types_map=_response_types_map,
|
|
496
|
-
)
|
|
497
|
-
|
|
498
|
-
@validate_call
|
|
499
|
-
def list_public_validity_periods_without_preload_content(
|
|
500
|
-
self,
|
|
501
|
-
variable_definition_id: Annotated[
|
|
502
|
-
StrictStr,
|
|
503
|
-
Field(description="Unique identifier for the variable definition."),
|
|
504
|
-
],
|
|
505
|
-
accept_language: Annotated[
|
|
506
|
-
SupportedLanguages,
|
|
507
|
-
Field(description="Render the variable definition in the given language."),
|
|
508
|
-
],
|
|
509
|
-
_request_timeout: None
|
|
510
|
-
| Annotated[StrictFloat, Field(gt=0)]
|
|
511
|
-
| tuple[
|
|
512
|
-
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
|
513
|
-
] = None,
|
|
514
|
-
_request_auth: dict[StrictStr, Any] | None = None,
|
|
515
|
-
_content_type: StrictStr | None = None,
|
|
516
|
-
_headers: dict[StrictStr, Any] | None = None,
|
|
517
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
518
|
-
) -> RESTResponseType:
|
|
519
|
-
"""List all validity periods.
|
|
520
|
-
|
|
521
|
-
List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
|
|
522
|
-
|
|
523
|
-
:param variable_definition_id: Unique identifier for the variable definition. (required)
|
|
524
|
-
:type variable_definition_id: str
|
|
525
|
-
:param accept_language: Render the variable definition in the given language. (required)
|
|
526
|
-
:type accept_language: SupportedLanguages
|
|
527
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
528
|
-
number provided, it will be total request
|
|
529
|
-
timeout. It can also be a pair (tuple) of
|
|
530
|
-
(connection, read) timeouts.
|
|
531
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
532
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
533
|
-
request; this effectively ignores the
|
|
534
|
-
authentication in the spec for a single request.
|
|
535
|
-
:type _request_auth: dict, optional
|
|
536
|
-
:param _content_type: force content-type for the request.
|
|
537
|
-
:type _content_type: str, Optional
|
|
538
|
-
:param _headers: set to override the headers for a single
|
|
539
|
-
request; this effectively ignores the headers
|
|
540
|
-
in the spec for a single request.
|
|
541
|
-
:type _headers: dict, optional
|
|
542
|
-
:param _host_index: set to override the host_index for a single
|
|
543
|
-
request; this effectively ignores the host_index
|
|
544
|
-
in the spec for a single request.
|
|
545
|
-
:type _host_index: int, optional
|
|
546
|
-
:return: Returns the result object.
|
|
547
|
-
"""
|
|
548
|
-
_param = self._list_public_validity_periods_serialize(
|
|
549
|
-
variable_definition_id=variable_definition_id,
|
|
550
|
-
accept_language=accept_language,
|
|
551
|
-
_request_auth=_request_auth,
|
|
552
|
-
_content_type=_content_type,
|
|
553
|
-
_headers=_headers,
|
|
554
|
-
_host_index=_host_index,
|
|
555
|
-
)
|
|
556
|
-
|
|
557
|
-
_response_types_map: dict[str, str | None] = {
|
|
558
|
-
"200": "List[RenderedVariableDefinition]",
|
|
559
|
-
}
|
|
560
|
-
response_data = self.api_client.call_api(
|
|
561
|
-
*_param,
|
|
562
|
-
_request_timeout=_request_timeout,
|
|
563
|
-
)
|
|
564
|
-
return response_data.response
|
|
565
|
-
|
|
566
|
-
def _list_public_validity_periods_serialize(
|
|
567
|
-
self,
|
|
568
|
-
variable_definition_id,
|
|
569
|
-
accept_language,
|
|
570
|
-
_request_auth,
|
|
571
|
-
_content_type,
|
|
572
|
-
_headers,
|
|
573
|
-
_host_index,
|
|
574
|
-
) -> RequestSerialized:
|
|
575
|
-
_host = None
|
|
576
|
-
|
|
577
|
-
_collection_formats: dict[str, str] = {}
|
|
578
|
-
|
|
579
|
-
_path_params: dict[str, str] = {}
|
|
580
|
-
_query_params: list[tuple[str, str]] = []
|
|
581
|
-
_header_params: dict[str, str | None] = _headers or {}
|
|
582
|
-
_form_params: list[tuple[str, str]] = []
|
|
583
|
-
_files: dict[
|
|
584
|
-
str,
|
|
585
|
-
str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]],
|
|
586
|
-
] = {}
|
|
587
|
-
_body_params: bytes | None = None
|
|
588
|
-
|
|
589
|
-
# process the path parameters
|
|
590
|
-
if variable_definition_id is not None:
|
|
591
|
-
_path_params["variable-definition-id"] = variable_definition_id
|
|
592
|
-
# process the query parameters
|
|
593
|
-
# process the header parameters
|
|
594
|
-
if accept_language is not None:
|
|
595
|
-
_header_params["Accept-Language"] = accept_language
|
|
596
|
-
# process the form parameters
|
|
597
|
-
# process the body parameter
|
|
598
|
-
|
|
599
|
-
# set the HTTP header `Accept`
|
|
600
|
-
if "Accept" not in _header_params:
|
|
601
|
-
_header_params["Accept"] = self.api_client.select_header_accept(
|
|
602
|
-
[
|
|
603
|
-
"application/json",
|
|
604
|
-
],
|
|
605
|
-
)
|
|
606
|
-
|
|
607
|
-
# authentication setting
|
|
608
|
-
_auth_settings: list[str] = []
|
|
609
|
-
|
|
610
|
-
return self.api_client.param_serialize(
|
|
611
|
-
method="GET",
|
|
612
|
-
resource_path="/public/variable-definitions/{variable-definition-id}/validity-periods",
|
|
613
|
-
path_params=_path_params,
|
|
614
|
-
query_params=_query_params,
|
|
615
|
-
header_params=_header_params,
|
|
616
|
-
body=_body_params,
|
|
617
|
-
post_params=_form_params,
|
|
618
|
-
files=_files,
|
|
619
|
-
auth_settings=_auth_settings,
|
|
620
|
-
collection_formats=_collection_formats,
|
|
621
|
-
_host=_host,
|
|
622
|
-
_request_auth=_request_auth,
|
|
623
|
-
)
|
|
624
|
-
|
|
625
352
|
@validate_call
|
|
626
353
|
def list_validity_periods(
|
|
627
354
|
self,
|