dapla-toolbelt-metadata 0.4.2__py3-none-any.whl → 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (87) hide show
  1. dapla_metadata/__init__.py +9 -0
  2. dapla_metadata/dapla/__init__.py +4 -0
  3. dapla_metadata/{_shared → dapla}/user_info.py +66 -20
  4. dapla_metadata/datasets/code_list.py +1 -1
  5. dapla_metadata/datasets/core.py +1 -1
  6. dapla_metadata/datasets/dapla_dataset_path_info.py +128 -14
  7. dapla_metadata/datasets/dataset_parser.py +21 -15
  8. dapla_metadata/datasets/model_backwards_compatibility.py +6 -6
  9. dapla_metadata/datasets/model_validation.py +2 -2
  10. dapla_metadata/datasets/utility/constants.py +1 -0
  11. dapla_metadata/datasets/utility/enums.py +1 -1
  12. dapla_metadata/datasets/utility/utils.py +8 -12
  13. dapla_metadata/standards/__init__.py +4 -0
  14. dapla_metadata/standards/name_validator.py +250 -0
  15. dapla_metadata/standards/standard_validators.py +98 -0
  16. dapla_metadata/standards/utils/__init__.py +1 -0
  17. dapla_metadata/standards/utils/constants.py +49 -0
  18. dapla_metadata/variable_definitions/__init__.py +5 -3
  19. dapla_metadata/variable_definitions/{generated → _generated}/.openapi-generator/FILES +0 -5
  20. dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
  21. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/__init__.py +0 -5
  22. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/__init__.py +0 -1
  23. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/data_migration_api.py +2 -2
  24. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/draft_variable_definitions_api.py +14 -14
  25. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/patches_api.py +15 -15
  26. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api/validity_periods_api.py +8 -281
  27. dapla_metadata/variable_definitions/{generated/vardef_client/api/public_api.py → _generated/vardef_client/api/variable_definitions_api.py} +73 -358
  28. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/__init__.py +2 -6
  29. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/complete_response.py +8 -32
  30. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/contact.py +2 -2
  31. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/draft.py +8 -23
  32. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/language_string_type.py +7 -6
  33. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/owner.py +2 -2
  34. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/patch.py +16 -61
  35. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/problem.py +2 -2
  36. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/update_draft.py +22 -55
  37. dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/models/validity_period.py +14 -48
  38. dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
  39. dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
  40. dapla_metadata/variable_definitions/{_client.py → _utils/_client.py} +5 -3
  41. dapla_metadata/variable_definitions/{config.py → _utils/config.py} +25 -1
  42. dapla_metadata/variable_definitions/_utils/constants.py +41 -0
  43. dapla_metadata/variable_definitions/_utils/descriptions.py +89 -0
  44. dapla_metadata/variable_definitions/_utils/files.py +273 -0
  45. dapla_metadata/variable_definitions/_utils/template_files.py +112 -0
  46. dapla_metadata/variable_definitions/_utils/variable_definition_files.py +93 -0
  47. dapla_metadata/variable_definitions/exceptions.py +141 -11
  48. dapla_metadata/variable_definitions/resources/vardef_model_descriptions_nb.yaml +63 -0
  49. dapla_metadata/variable_definitions/vardef.py +131 -10
  50. dapla_metadata/variable_definitions/variable_definition.py +251 -43
  51. {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.6.0.dist-info}/METADATA +8 -10
  52. dapla_toolbelt_metadata-0.6.0.dist-info/RECORD +89 -0
  53. {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.6.0.dist-info}/WHEEL +1 -1
  54. dapla_metadata/variable_definitions/generated/.openapi-generator/VERSION +0 -1
  55. dapla_metadata/variable_definitions/generated/vardef_client/api/variable_definitions_api.py +0 -1205
  56. dapla_metadata/variable_definitions/generated/vardef_client/models/klass_reference.py +0 -99
  57. dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_contact.py +0 -92
  58. dapla_metadata/variable_definitions/generated/vardef_client/models/rendered_variable_definition.py +0 -235
  59. dapla_metadata/variable_definitions/generated/vardef_client/models/supported_languages.py +0 -33
  60. dapla_metadata/variable_definitions/generated/vardef_client/models/variable_status.py +0 -33
  61. dapla_toolbelt_metadata-0.4.2.dist-info/RECORD +0 -81
  62. /dapla_metadata/variable_definitions/{generated → _generated}/.openapi-generator-ignore +0 -0
  63. /dapla_metadata/variable_definitions/{generated → _generated}/README.md +0 -0
  64. /dapla_metadata/variable_definitions/{generated → _generated}/__init__.py +0 -0
  65. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api_client.py +0 -0
  66. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/api_response.py +0 -0
  67. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/configuration.py +0 -0
  68. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/CompleteResponse.md +0 -0
  69. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Contact.md +0 -0
  70. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/DataMigrationApi.md +0 -0
  71. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Draft.md +0 -0
  72. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/DraftVariableDefinitionsApi.md +0 -0
  73. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/LanguageStringType.md +0 -0
  74. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Owner.md +0 -0
  75. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/Patch.md +0 -0
  76. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/PatchesApi.md +0 -0
  77. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/PublicApi.md +0 -0
  78. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/SupportedLanguages.md +0 -0
  79. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/UpdateDraft.md +0 -0
  80. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/ValidityPeriod.md +0 -0
  81. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/ValidityPeriodsApi.md +0 -0
  82. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/VariableDefinitionsApi.md +0 -0
  83. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/docs/VariableStatus.md +0 -0
  84. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/exceptions.py +0 -0
  85. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/py.typed +0 -0
  86. /dapla_metadata/variable_definitions/{generated → _generated}/vardef_client/rest.py +0 -0
  87. {dapla_toolbelt_metadata-0.4.2.dist-info → dapla_toolbelt_metadata-0.6.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`. #### 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.
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
@@ -50,13 +50,13 @@ class PatchesApi:
50
50
  StrictStr,
51
51
  Field(description="The group which the user currently represents."),
52
52
  ],
53
- patch: Patch,
54
53
  valid_from: Annotated[
55
54
  date | None,
56
55
  Field(
57
56
  description="Valid from date for the specific validity period to be patched."
58
57
  ),
59
58
  ] = None,
59
+ patch: Patch | None = None,
60
60
  _request_timeout: None
61
61
  | Annotated[StrictFloat, Field(gt=0)]
62
62
  | tuple[
@@ -75,10 +75,10 @@ class PatchesApi:
75
75
  :type variable_definition_id: str
76
76
  :param active_group: The group which the user currently represents. (required)
77
77
  :type active_group: str
78
- :param patch: (required)
79
- :type patch: Patch
80
78
  :param valid_from: Valid from date for the specific validity period to be patched.
81
79
  :type valid_from: date
80
+ :param patch:
81
+ :type patch: Patch
82
82
  :param _request_timeout: timeout setting for this request. If one
83
83
  number provided, it will be total request
84
84
  timeout. It can also be a pair (tuple) of
@@ -103,8 +103,8 @@ class PatchesApi:
103
103
  _param = self._create_patch_serialize(
104
104
  variable_definition_id=variable_definition_id,
105
105
  active_group=active_group,
106
- patch=patch,
107
106
  valid_from=valid_from,
107
+ patch=patch,
108
108
  _request_auth=_request_auth,
109
109
  _content_type=_content_type,
110
110
  _headers=_headers,
@@ -138,13 +138,13 @@ class PatchesApi:
138
138
  StrictStr,
139
139
  Field(description="The group which the user currently represents."),
140
140
  ],
141
- patch: Patch,
142
141
  valid_from: Annotated[
143
142
  date | None,
144
143
  Field(
145
144
  description="Valid from date for the specific validity period to be patched."
146
145
  ),
147
146
  ] = None,
147
+ patch: Patch | None = None,
148
148
  _request_timeout: None
149
149
  | Annotated[StrictFloat, Field(gt=0)]
150
150
  | tuple[
@@ -163,10 +163,10 @@ class PatchesApi:
163
163
  :type variable_definition_id: str
164
164
  :param active_group: The group which the user currently represents. (required)
165
165
  :type active_group: str
166
- :param patch: (required)
167
- :type patch: Patch
168
166
  :param valid_from: Valid from date for the specific validity period to be patched.
169
167
  :type valid_from: date
168
+ :param patch:
169
+ :type patch: Patch
170
170
  :param _request_timeout: timeout setting for this request. If one
171
171
  number provided, it will be total request
172
172
  timeout. It can also be a pair (tuple) of
@@ -191,8 +191,8 @@ class PatchesApi:
191
191
  _param = self._create_patch_serialize(
192
192
  variable_definition_id=variable_definition_id,
193
193
  active_group=active_group,
194
- patch=patch,
195
194
  valid_from=valid_from,
195
+ patch=patch,
196
196
  _request_auth=_request_auth,
197
197
  _content_type=_content_type,
198
198
  _headers=_headers,
@@ -226,13 +226,13 @@ class PatchesApi:
226
226
  StrictStr,
227
227
  Field(description="The group which the user currently represents."),
228
228
  ],
229
- patch: Patch,
230
229
  valid_from: Annotated[
231
230
  date | None,
232
231
  Field(
233
232
  description="Valid from date for the specific validity period to be patched."
234
233
  ),
235
234
  ] = None,
235
+ patch: Patch | None = None,
236
236
  _request_timeout: None
237
237
  | Annotated[StrictFloat, Field(gt=0)]
238
238
  | tuple[
@@ -251,10 +251,10 @@ class PatchesApi:
251
251
  :type variable_definition_id: str
252
252
  :param active_group: The group which the user currently represents. (required)
253
253
  :type active_group: str
254
- :param patch: (required)
255
- :type patch: Patch
256
254
  :param valid_from: Valid from date for the specific validity period to be patched.
257
255
  :type valid_from: date
256
+ :param patch:
257
+ :type patch: Patch
258
258
  :param _request_timeout: timeout setting for this request. If one
259
259
  number provided, it will be total request
260
260
  timeout. It can also be a pair (tuple) of
@@ -279,8 +279,8 @@ class PatchesApi:
279
279
  _param = self._create_patch_serialize(
280
280
  variable_definition_id=variable_definition_id,
281
281
  active_group=active_group,
282
- patch=patch,
283
282
  valid_from=valid_from,
283
+ patch=patch,
284
284
  _request_auth=_request_auth,
285
285
  _content_type=_content_type,
286
286
  _headers=_headers,
@@ -303,8 +303,8 @@ class PatchesApi:
303
303
  self,
304
304
  variable_definition_id,
305
305
  active_group,
306
- patch,
307
306
  valid_from,
307
+ patch,
308
308
  _request_auth,
309
309
  _content_type,
310
310
  _headers,
@@ -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`. #### 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.
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: (required)
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: (required)
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: (required)
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,