dapla-toolbelt-metadata 0.2.1__py3-none-any.whl → 0.9.11__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (97) hide show
  1. dapla_metadata/__init__.py +11 -1
  2. dapla_metadata/_shared/__init__.py +1 -0
  3. dapla_metadata/_shared/config.py +109 -0
  4. dapla_metadata/_shared/enums.py +27 -0
  5. dapla_metadata/_shared/py.typed +0 -0
  6. dapla_metadata/dapla/__init__.py +4 -0
  7. dapla_metadata/dapla/user_info.py +138 -0
  8. dapla_metadata/datasets/__init__.py +1 -1
  9. dapla_metadata/datasets/_merge.py +333 -0
  10. dapla_metadata/datasets/code_list.py +5 -6
  11. dapla_metadata/datasets/compatibility/__init__.py +10 -0
  12. dapla_metadata/datasets/compatibility/_handlers.py +363 -0
  13. dapla_metadata/datasets/compatibility/_utils.py +259 -0
  14. dapla_metadata/datasets/compatibility/model_backwards_compatibility.py +135 -0
  15. dapla_metadata/datasets/core.py +136 -182
  16. dapla_metadata/datasets/dapla_dataset_path_info.py +145 -19
  17. dapla_metadata/datasets/dataset_parser.py +41 -28
  18. dapla_metadata/datasets/model_validation.py +29 -20
  19. dapla_metadata/datasets/statistic_subject_mapping.py +5 -1
  20. dapla_metadata/datasets/utility/constants.py +22 -15
  21. dapla_metadata/datasets/utility/enums.py +8 -20
  22. dapla_metadata/datasets/utility/urn.py +234 -0
  23. dapla_metadata/datasets/utility/utils.py +183 -111
  24. dapla_metadata/standards/__init__.py +4 -0
  25. dapla_metadata/standards/name_validator.py +250 -0
  26. dapla_metadata/standards/standard_validators.py +98 -0
  27. dapla_metadata/standards/utils/__init__.py +1 -0
  28. dapla_metadata/standards/utils/constants.py +49 -0
  29. dapla_metadata/variable_definitions/__init__.py +11 -0
  30. dapla_metadata/variable_definitions/_generated/.openapi-generator/FILES +20 -0
  31. dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
  32. dapla_metadata/variable_definitions/_generated/.openapi-generator-ignore +6 -0
  33. dapla_metadata/variable_definitions/_generated/README.md +148 -0
  34. dapla_metadata/variable_definitions/_generated/__init__.py +0 -0
  35. dapla_metadata/variable_definitions/_generated/vardef_client/__init__.py +47 -0
  36. dapla_metadata/variable_definitions/_generated/vardef_client/api/__init__.py +8 -0
  37. dapla_metadata/variable_definitions/_generated/vardef_client/api/data_migration_api.py +766 -0
  38. dapla_metadata/variable_definitions/_generated/vardef_client/api/draft_variable_definitions_api.py +888 -0
  39. dapla_metadata/variable_definitions/_generated/vardef_client/api/patches_api.py +888 -0
  40. dapla_metadata/variable_definitions/_generated/vardef_client/api/validity_periods_api.py +583 -0
  41. dapla_metadata/variable_definitions/_generated/vardef_client/api/variable_definitions_api.py +613 -0
  42. dapla_metadata/variable_definitions/_generated/vardef_client/api_client.py +779 -0
  43. dapla_metadata/variable_definitions/_generated/vardef_client/api_response.py +27 -0
  44. dapla_metadata/variable_definitions/_generated/vardef_client/configuration.py +474 -0
  45. dapla_metadata/variable_definitions/_generated/vardef_client/docs/CompleteResponse.md +51 -0
  46. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Contact.md +30 -0
  47. dapla_metadata/variable_definitions/_generated/vardef_client/docs/DataMigrationApi.md +90 -0
  48. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Draft.md +42 -0
  49. dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
  50. dapla_metadata/variable_definitions/_generated/vardef_client/docs/LanguageStringType.md +31 -0
  51. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Owner.md +31 -0
  52. dapla_metadata/variable_definitions/_generated/vardef_client/docs/Patch.md +43 -0
  53. dapla_metadata/variable_definitions/_generated/vardef_client/docs/PatchesApi.md +249 -0
  54. dapla_metadata/variable_definitions/_generated/vardef_client/docs/PublicApi.md +218 -0
  55. dapla_metadata/variable_definitions/_generated/vardef_client/docs/SupportedLanguages.md +15 -0
  56. dapla_metadata/variable_definitions/_generated/vardef_client/docs/UpdateDraft.md +44 -0
  57. dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriod.md +42 -0
  58. dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
  59. dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
  60. dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableStatus.md +17 -0
  61. dapla_metadata/variable_definitions/_generated/vardef_client/exceptions.py +193 -0
  62. dapla_metadata/variable_definitions/_generated/vardef_client/models/__init__.py +31 -0
  63. dapla_metadata/variable_definitions/_generated/vardef_client/models/complete_response.py +260 -0
  64. dapla_metadata/variable_definitions/_generated/vardef_client/models/contact.py +94 -0
  65. dapla_metadata/variable_definitions/_generated/vardef_client/models/draft.py +228 -0
  66. dapla_metadata/variable_definitions/_generated/vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py +158 -0
  67. dapla_metadata/variable_definitions/_generated/vardef_client/models/language_string_type.py +101 -0
  68. dapla_metadata/variable_definitions/_generated/vardef_client/models/owner.py +87 -0
  69. dapla_metadata/variable_definitions/_generated/vardef_client/models/patch.py +244 -0
  70. dapla_metadata/variable_definitions/_generated/vardef_client/models/problem.py +118 -0
  71. dapla_metadata/variable_definitions/_generated/vardef_client/models/update_draft.py +274 -0
  72. dapla_metadata/variable_definitions/_generated/vardef_client/models/validity_period.py +225 -0
  73. dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_id_response.py +81 -0
  74. dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_vardef_id_pair_response.py +84 -0
  75. dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
  76. dapla_metadata/variable_definitions/_generated/vardef_client/py.typed +0 -0
  77. dapla_metadata/variable_definitions/_generated/vardef_client/rest.py +249 -0
  78. dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
  79. dapla_metadata/variable_definitions/_utils/_client.py +32 -0
  80. dapla_metadata/variable_definitions/_utils/config.py +54 -0
  81. dapla_metadata/variable_definitions/_utils/constants.py +80 -0
  82. dapla_metadata/variable_definitions/_utils/files.py +309 -0
  83. dapla_metadata/variable_definitions/_utils/template_files.py +99 -0
  84. dapla_metadata/variable_definitions/_utils/variable_definition_files.py +143 -0
  85. dapla_metadata/variable_definitions/exceptions.py +255 -0
  86. dapla_metadata/variable_definitions/vardef.py +372 -0
  87. dapla_metadata/variable_definitions/vardok_id.py +48 -0
  88. dapla_metadata/variable_definitions/vardok_vardef_id_pair.py +47 -0
  89. dapla_metadata/variable_definitions/variable_definition.py +422 -0
  90. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/METADATA +34 -36
  91. dapla_toolbelt_metadata-0.9.11.dist-info/RECORD +97 -0
  92. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/WHEEL +1 -1
  93. dapla_metadata/datasets/config.py +0 -80
  94. dapla_metadata/datasets/model_backwards_compatibility.py +0 -520
  95. dapla_metadata/datasets/user_info.py +0 -88
  96. dapla_toolbelt_metadata-0.2.1.dist-info/RECORD +0 -22
  97. {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,218 @@
1
+ # vardef_client.PublicApi
2
+
3
+ All URIs are relative to *https://metadata.intern.test.ssb.no*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_public_variable_definition_by_id**](PublicApi.md#get_public_variable_definition_by_id) | **GET** /public/variable-definitions/{variable-definition-id} | Get one variable definition.
8
+ [**list_public_validity_periods**](PublicApi.md#list_public_validity_periods) | **GET** /public/variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
9
+ [**list_public_variable_definitions**](PublicApi.md#list_public_variable_definitions) | **GET** /public/variable-definitions | List all variable definitions.
10
+
11
+
12
+ # **get_public_variable_definition_by_id**
13
+ > get_public_variable_definition_by_id(variable_definition_id, accept_language, date_of_validity=date_of_validity)
14
+
15
+ Get one variable definition.
16
+
17
+ Get one variable definition. This is rendered in the given language, with the default being Norwegian Bokmål.
18
+
19
+ ### Example
20
+
21
+
22
+ ```python
23
+ import vardef_client
24
+ from vardef_client.models.supported_languages import SupportedLanguages
25
+ from vardef_client.rest import ApiException
26
+ from pprint import pprint
27
+
28
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
29
+ # See configuration.py for a list of all supported configuration parameters.
30
+ configuration = vardef_client.Configuration(
31
+ host = "https://metadata.intern.test.ssb.no"
32
+ )
33
+
34
+
35
+ # Enter a context with an instance of the API client
36
+ with vardef_client.ApiClient(configuration) as api_client:
37
+ # Create an instance of the API class
38
+ api_instance = vardef_client.PublicApi(api_client)
39
+ variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
40
+ accept_language = vardef_client.SupportedLanguages() # SupportedLanguages | Render the variable definition in the given language.
41
+ date_of_validity = '' # date | List only variable definitions which are valid on this date. (optional)
42
+
43
+ try:
44
+ # Get one variable definition.
45
+ api_instance.get_public_variable_definition_by_id(variable_definition_id, accept_language, date_of_validity=date_of_validity)
46
+ except Exception as e:
47
+ print("Exception when calling PublicApi->get_public_variable_definition_by_id: %s\n" % e)
48
+ ```
49
+
50
+
51
+
52
+ ### Parameters
53
+
54
+
55
+ Name | Type | Description | Notes
56
+ ------------- | ------------- | ------------- | -------------
57
+ **variable_definition_id** | **str**| Unique identifier for the variable definition. |
58
+ **accept_language** | [**SupportedLanguages**](.md)| Render the variable definition in the given language. |
59
+ **date_of_validity** | **date**| List only variable definitions which are valid on this date. | [optional]
60
+
61
+ ### Return type
62
+
63
+ void (empty response body)
64
+
65
+ ### Authorization
66
+
67
+ No authorization required
68
+
69
+ ### HTTP request headers
70
+
71
+ - **Content-Type**: Not defined
72
+ - **Accept**: application/json
73
+
74
+ ### HTTP response details
75
+
76
+ | Status code | Description | Response headers |
77
+ |-------------|-------------|------------------|
78
+ **200** | Ok | - |
79
+ **404** | No such variable definition found | - |
80
+
81
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
82
+
83
+ # **list_public_validity_periods**
84
+ > list_public_validity_periods(variable_definition_id, accept_language)
85
+
86
+ List all validity periods.
87
+
88
+ List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
89
+
90
+ ### Example
91
+
92
+
93
+ ```python
94
+ import vardef_client
95
+ from vardef_client.models.supported_languages import SupportedLanguages
96
+ from vardef_client.rest import ApiException
97
+ from pprint import pprint
98
+
99
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
100
+ # See configuration.py for a list of all supported configuration parameters.
101
+ configuration = vardef_client.Configuration(
102
+ host = "https://metadata.intern.test.ssb.no"
103
+ )
104
+
105
+
106
+ # Enter a context with an instance of the API client
107
+ with vardef_client.ApiClient(configuration) as api_client:
108
+ # Create an instance of the API class
109
+ api_instance = vardef_client.PublicApi(api_client)
110
+ variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
111
+ accept_language = vardef_client.SupportedLanguages() # SupportedLanguages | Render the variable definition in the given language.
112
+
113
+ try:
114
+ # List all validity periods.
115
+ api_instance.list_public_validity_periods(variable_definition_id, accept_language)
116
+ except Exception as e:
117
+ print("Exception when calling PublicApi->list_public_validity_periods: %s\n" % e)
118
+ ```
119
+
120
+
121
+
122
+ ### Parameters
123
+
124
+
125
+ Name | Type | Description | Notes
126
+ ------------- | ------------- | ------------- | -------------
127
+ **variable_definition_id** | **str**| Unique identifier for the variable definition. |
128
+ **accept_language** | [**SupportedLanguages**](.md)| Render the variable definition in the given language. |
129
+
130
+ ### Return type
131
+
132
+ void (empty response body)
133
+
134
+ ### Authorization
135
+
136
+ No authorization required
137
+
138
+ ### HTTP request headers
139
+
140
+ - **Content-Type**: Not defined
141
+ - **Accept**: application/json
142
+
143
+ ### HTTP response details
144
+
145
+ | Status code | Description | Response headers |
146
+ |-------------|-------------|------------------|
147
+ **200** | Ok | - |
148
+
149
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
150
+
151
+ # **list_public_variable_definitions**
152
+ > list_public_variable_definitions(accept_language, date_of_validity=date_of_validity)
153
+
154
+ List all variable definitions.
155
+
156
+ List all variable definitions. These are rendered in the given language, with the default being Norwegian Bokmål.
157
+
158
+ ### Example
159
+
160
+
161
+ ```python
162
+ import vardef_client
163
+ from vardef_client.models.supported_languages import SupportedLanguages
164
+ from vardef_client.rest import ApiException
165
+ from pprint import pprint
166
+
167
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
168
+ # See configuration.py for a list of all supported configuration parameters.
169
+ configuration = vardef_client.Configuration(
170
+ host = "https://metadata.intern.test.ssb.no"
171
+ )
172
+
173
+
174
+ # Enter a context with an instance of the API client
175
+ with vardef_client.ApiClient(configuration) as api_client:
176
+ # Create an instance of the API class
177
+ api_instance = vardef_client.PublicApi(api_client)
178
+ accept_language = vardef_client.SupportedLanguages() # SupportedLanguages | Render the variable definition in the given language.
179
+ date_of_validity = '' # str | List only variable definitions which are valid on this date. (optional)
180
+
181
+ try:
182
+ # List all variable definitions.
183
+ api_instance.list_public_variable_definitions(accept_language, date_of_validity=date_of_validity)
184
+ except Exception as e:
185
+ print("Exception when calling PublicApi->list_public_variable_definitions: %s\n" % e)
186
+ ```
187
+
188
+
189
+
190
+ ### Parameters
191
+
192
+
193
+ Name | Type | Description | Notes
194
+ ------------- | ------------- | ------------- | -------------
195
+ **accept_language** | [**SupportedLanguages**](.md)| Render the variable definition in the given language. |
196
+ **date_of_validity** | **str**| List only variable definitions which are valid on this date. | [optional]
197
+
198
+ ### Return type
199
+
200
+ void (empty response body)
201
+
202
+ ### Authorization
203
+
204
+ No authorization required
205
+
206
+ ### HTTP request headers
207
+
208
+ - **Content-Type**: Not defined
209
+ - **Accept**: application/json
210
+
211
+ ### HTTP response details
212
+
213
+ | Status code | Description | Response headers |
214
+ |-------------|-------------|------------------|
215
+ **200** | OK response | - |
216
+
217
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
218
+
@@ -0,0 +1,15 @@
1
+ # SupportedLanguages
2
+
3
+ Languages the application supports.
4
+
5
+ ## Enum
6
+
7
+ * `NB` (value: `'nb'`)
8
+
9
+ * `NN` (value: `'nn'`)
10
+
11
+ * `EN` (value: `'en'`)
12
+
13
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14
+
15
+
@@ -0,0 +1,44 @@
1
+ # UpdateDraft
2
+
3
+ Update variable definition Data structure with all fields optional for updating a Draft Variable Definition.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **name** | [**LanguageStringType**](LanguageStringType.md) | Name of the variable. Must be unique for a given Unit Type and Owner combination. | [optional]
10
+ **short_name** | **str** | Recommended short name. Must be unique within an organization. | [optional]
11
+ **definition** | [**LanguageStringType**](LanguageStringType.md) | Definition of the variable. | [optional]
12
+ **classification_reference** | **str** | ID of a classification or code list from Klass. The given classification defines all possible values for the defined variable. | [optional]
13
+ **unit_types** | **List[str]** | A list of one or more unit types, e.g. person, vehicle, household. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/702. | [optional]
14
+ **subject_fields** | **List[str]** | A list of subject fields that the variable is used in. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/618. | [optional]
15
+ **contains_special_categories_of_personal_data** | **bool** | True if variable instances contain particularly sensitive information. Applies even if the information or identifiers are pseudonymized. Information within the following categories are regarded as particularly sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs, Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual orientation | [optional]
16
+ **variable_status** | [**VariableStatus**](VariableStatus.md) | Status of the life cycle of the variable | [optional]
17
+ **measurement_type** | **str** | Type of measurement for the variable, e.g. length, volume, currency. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/303 | [optional]
18
+ **valid_from** | **date** | The variable definition is valid from this date inclusive | [optional]
19
+ **external_reference_uri** | **str** | A link (URI) to an external definition/documentation | [optional]
20
+ **comment** | [**LanguageStringType**](LanguageStringType.md) | Optional comment to explain the definition or communicate potential changes. | [optional]
21
+ **related_variable_definition_uris** | **List[str]** | Link(s) to related definitions of variables - a list of one or more definitions. For example for a variable after-tax income it could be relevant to link to definitions of income from work, property income etc. | [optional]
22
+ **owner** | [**Owner**](Owner.md) | Owner of the definition, i.e. responsible Dapla team (statistics team) and information about access management groups. | [optional]
23
+ **contact** | [**Contact**](Contact.md) | Contact details | [optional]
24
+
25
+ ## Example
26
+
27
+ ```python
28
+ from vardef_client.models.update_draft import UpdateDraft
29
+
30
+ # TODO update the JSON string below
31
+ json = "{}"
32
+ # create an instance of UpdateDraft from a JSON string
33
+ update_draft_instance = UpdateDraft.from_json(json)
34
+ # print the JSON string representation of the object
35
+ print(UpdateDraft.to_json())
36
+
37
+ # convert the object into a dict
38
+ update_draft_dict = update_draft_instance.to_dict()
39
+ # create an instance of UpdateDraft from a dict
40
+ update_draft_from_dict = UpdateDraft.from_dict(update_draft_dict)
41
+ ```
42
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
43
+
44
+
@@ -0,0 +1,42 @@
1
+ # ValidityPeriod
2
+
3
+ Create a new Validity Period on a Published Variable Definition.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **name** | [**LanguageStringType**](LanguageStringType.md) | Name of the variable. Must be unique for a given Unit Type and Owner combination. | [optional]
10
+ **definition** | [**LanguageStringType**](LanguageStringType.md) | Definition of the variable. |
11
+ **classification_reference** | **str** | ID of a classification or code list from Klass. The given classification defines all possible values for the defined variable. | [optional]
12
+ **unit_types** | **List[str]** | A list of one or more unit types, e.g. person, vehicle, household. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/702. | [optional]
13
+ **subject_fields** | **List[str]** | A list of subject fields that the variable is used in. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/618. | [optional]
14
+ **contains_special_categories_of_personal_data** | **bool** | True if variable instances contain particularly sensitive information. Applies even if the information or identifiers are pseudonymized. Information within the following categories are regarded as particularly sensitive: Ethnicity, Political alignment, Religion, Philosophical beliefs, Union membership, Genetics, Biometrics, Health, Sexual relations, Sexual orientation | [optional]
15
+ **variable_status** | [**VariableStatus**](VariableStatus.md) | Status of the life cycle of the variable | [optional] [readonly]
16
+ **measurement_type** | **str** | Type of measurement for the variable, e.g. length, volume, currency. Must be defined as codes from https://www.ssb.no/klass/klassifikasjoner/303 | [optional]
17
+ **valid_from** | **date** | The variable definition is valid from this date inclusive |
18
+ **external_reference_uri** | **str** | A link (URI) to an external definition/documentation | [optional]
19
+ **comment** | [**LanguageStringType**](LanguageStringType.md) | Optional comment to explain the definition or communicate potential changes. | [optional]
20
+ **related_variable_definition_uris** | **List[str]** | Link(s) to related definitions of variables - a list of one or more definitions. For example for a variable after-tax income it could be relevant to link to definitions of income from work, property income etc. | [optional]
21
+ **contact** | [**Contact**](Contact.md) | Contact details | [optional]
22
+
23
+ ## Example
24
+
25
+ ```python
26
+ from vardef_client.models.validity_period import ValidityPeriod
27
+
28
+ # TODO update the JSON string below
29
+ json = "{}"
30
+ # create an instance of ValidityPeriod from a JSON string
31
+ validity_period_instance = ValidityPeriod.from_json(json)
32
+ # print the JSON string representation of the object
33
+ print(ValidityPeriod.to_json())
34
+
35
+ # convert the object into a dict
36
+ validity_period_dict = validity_period_instance.to_dict()
37
+ # create an instance of ValidityPeriod from a dict
38
+ validity_period_from_dict = ValidityPeriod.from_dict(validity_period_dict)
39
+ ```
40
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
41
+
42
+
@@ -0,0 +1,236 @@
1
+ # vardef_client.ValidityPeriodsApi
2
+
3
+ All URIs are relative to *https://metadata.intern.test.ssb.no*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_validity_period**](ValidityPeriodsApi.md#create_validity_period) | **POST** /variable-definitions/{variable-definition-id}/validity-periods | Create a new validity period for a variable definition.
8
+ [**list_public_validity_periods_0**](ValidityPeriodsApi.md#list_public_validity_periods_0) | **GET** /public/variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
9
+ [**list_validity_periods**](ValidityPeriodsApi.md#list_validity_periods) | **GET** /variable-definitions/{variable-definition-id}/validity-periods | List all validity periods.
10
+
11
+
12
+ # **create_validity_period**
13
+ > create_validity_period(variable_definition_id, active_group, validity_period)
14
+
15
+ Create a new validity period for a variable definition.
16
+
17
+ Create a new validity period for a variable definition.
18
+
19
+ ### Example
20
+
21
+ * Bearer (JWT) Authentication (Keycloak token):
22
+
23
+ ```python
24
+ import vardef_client
25
+ from vardef_client.models.validity_period import ValidityPeriod
26
+ from vardef_client.rest import ApiException
27
+ from pprint import pprint
28
+
29
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
30
+ # See configuration.py for a list of all supported configuration parameters.
31
+ configuration = vardef_client.Configuration(
32
+ host = "https://metadata.intern.test.ssb.no"
33
+ )
34
+
35
+ # The client must configure the authentication and authorization parameters
36
+ # in accordance with the API server security policy.
37
+ # Examples for each auth method are provided below, use the example that
38
+ # satisfies your auth use case.
39
+
40
+ # Configure Bearer authorization (JWT): Keycloak token
41
+ configuration = vardef_client.Configuration(
42
+ access_token = os.environ["BEARER_TOKEN"]
43
+ )
44
+
45
+ # Enter a context with an instance of the API client
46
+ with vardef_client.ApiClient(configuration) as api_client:
47
+ # Create an instance of the API class
48
+ api_instance = vardef_client.ValidityPeriodsApi(api_client)
49
+ variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
50
+ active_group = 'dapla-felles-developers' # str | The group which the user currently represents.
51
+ validity_period = vardef_client.ValidityPeriod() # ValidityPeriod |
52
+
53
+ try:
54
+ # Create a new validity period for a variable definition.
55
+ api_instance.create_validity_period(variable_definition_id, active_group, validity_period)
56
+ except Exception as e:
57
+ print("Exception when calling ValidityPeriodsApi->create_validity_period: %s\n" % e)
58
+ ```
59
+
60
+
61
+
62
+ ### Parameters
63
+
64
+
65
+ Name | Type | Description | Notes
66
+ ------------- | ------------- | ------------- | -------------
67
+ **variable_definition_id** | **str**| Unique identifier for the variable definition. |
68
+ **active_group** | **str**| The group which the user currently represents. |
69
+ **validity_period** | [**ValidityPeriod**](ValidityPeriod.md)| |
70
+
71
+ ### Return type
72
+
73
+ void (empty response body)
74
+
75
+ ### Authorization
76
+
77
+ [Keycloak token](../README.md#Keycloak token)
78
+
79
+ ### HTTP request headers
80
+
81
+ - **Content-Type**: application/json
82
+ - **Accept**: application/json
83
+
84
+ ### HTTP response details
85
+
86
+ | Status code | Description | Response headers |
87
+ |-------------|-------------|------------------|
88
+ **201** | Successfully created. | - |
89
+ **400** | The request is missing or has errors in required fields. | - |
90
+ **405** | Method only allowed for published variables. | - |
91
+
92
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
93
+
94
+ # **list_public_validity_periods_0**
95
+ > list_public_validity_periods_0(variable_definition_id, accept_language)
96
+
97
+ List all validity periods.
98
+
99
+ List all validity periods. These are rendered in the given language, with the default being Norwegian Bokmål.
100
+
101
+ ### Example
102
+
103
+
104
+ ```python
105
+ import vardef_client
106
+ from vardef_client.models.supported_languages import SupportedLanguages
107
+ from vardef_client.rest import ApiException
108
+ from pprint import pprint
109
+
110
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
111
+ # See configuration.py for a list of all supported configuration parameters.
112
+ configuration = vardef_client.Configuration(
113
+ host = "https://metadata.intern.test.ssb.no"
114
+ )
115
+
116
+
117
+ # Enter a context with an instance of the API client
118
+ with vardef_client.ApiClient(configuration) as api_client:
119
+ # Create an instance of the API class
120
+ api_instance = vardef_client.ValidityPeriodsApi(api_client)
121
+ variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
122
+ accept_language = vardef_client.SupportedLanguages() # SupportedLanguages | Render the variable definition in the given language.
123
+
124
+ try:
125
+ # List all validity periods.
126
+ api_instance.list_public_validity_periods_0(variable_definition_id, accept_language)
127
+ except Exception as e:
128
+ print("Exception when calling ValidityPeriodsApi->list_public_validity_periods_0: %s\n" % e)
129
+ ```
130
+
131
+
132
+
133
+ ### Parameters
134
+
135
+
136
+ Name | Type | Description | Notes
137
+ ------------- | ------------- | ------------- | -------------
138
+ **variable_definition_id** | **str**| Unique identifier for the variable definition. |
139
+ **accept_language** | [**SupportedLanguages**](.md)| Render the variable definition in the given language. |
140
+
141
+ ### Return type
142
+
143
+ void (empty response body)
144
+
145
+ ### Authorization
146
+
147
+ No authorization required
148
+
149
+ ### HTTP request headers
150
+
151
+ - **Content-Type**: Not defined
152
+ - **Accept**: application/json
153
+
154
+ ### HTTP response details
155
+
156
+ | Status code | Description | Response headers |
157
+ |-------------|-------------|------------------|
158
+ **200** | Ok | - |
159
+
160
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
161
+
162
+ # **list_validity_periods**
163
+ > list_validity_periods(variable_definition_id)
164
+
165
+ List all validity periods.
166
+
167
+ List all validity periods.
168
+
169
+ ### Example
170
+
171
+ * Bearer (JWT) Authentication (Keycloak token):
172
+
173
+ ```python
174
+ import vardef_client
175
+ from vardef_client.rest import ApiException
176
+ from pprint import pprint
177
+
178
+ # Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
179
+ # See configuration.py for a list of all supported configuration parameters.
180
+ configuration = vardef_client.Configuration(
181
+ host = "https://metadata.intern.test.ssb.no"
182
+ )
183
+
184
+ # The client must configure the authentication and authorization parameters
185
+ # in accordance with the API server security policy.
186
+ # Examples for each auth method are provided below, use the example that
187
+ # satisfies your auth use case.
188
+
189
+ # Configure Bearer authorization (JWT): Keycloak token
190
+ configuration = vardef_client.Configuration(
191
+ access_token = os.environ["BEARER_TOKEN"]
192
+ )
193
+
194
+ # Enter a context with an instance of the API client
195
+ with vardef_client.ApiClient(configuration) as api_client:
196
+ # Create an instance of the API class
197
+ api_instance = vardef_client.ValidityPeriodsApi(api_client)
198
+ variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
199
+
200
+ try:
201
+ # List all validity periods.
202
+ api_instance.list_validity_periods(variable_definition_id)
203
+ except Exception as e:
204
+ print("Exception when calling ValidityPeriodsApi->list_validity_periods: %s\n" % e)
205
+ ```
206
+
207
+
208
+
209
+ ### Parameters
210
+
211
+
212
+ Name | Type | Description | Notes
213
+ ------------- | ------------- | ------------- | -------------
214
+ **variable_definition_id** | **str**| Unique identifier for the variable definition. |
215
+
216
+ ### Return type
217
+
218
+ void (empty response body)
219
+
220
+ ### Authorization
221
+
222
+ [Keycloak token](../README.md#Keycloak token)
223
+
224
+ ### HTTP request headers
225
+
226
+ - **Content-Type**: Not defined
227
+ - **Accept**: application/json
228
+
229
+ ### HTTP response details
230
+
231
+ | Status code | Description | Response headers |
232
+ |-------------|-------------|------------------|
233
+ **200** | Ok | - |
234
+
235
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
236
+