dapla-toolbelt-metadata 0.2.1__py3-none-any.whl → 0.9.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dapla-toolbelt-metadata might be problematic. Click here for more details.
- dapla_metadata/__init__.py +11 -1
- dapla_metadata/_shared/__init__.py +1 -0
- dapla_metadata/_shared/config.py +109 -0
- dapla_metadata/_shared/enums.py +27 -0
- dapla_metadata/_shared/py.typed +0 -0
- dapla_metadata/dapla/__init__.py +4 -0
- dapla_metadata/dapla/user_info.py +138 -0
- dapla_metadata/datasets/__init__.py +1 -1
- dapla_metadata/datasets/_merge.py +333 -0
- dapla_metadata/datasets/code_list.py +5 -6
- dapla_metadata/datasets/compatibility/__init__.py +10 -0
- dapla_metadata/datasets/compatibility/_handlers.py +363 -0
- dapla_metadata/datasets/compatibility/_utils.py +259 -0
- dapla_metadata/datasets/compatibility/model_backwards_compatibility.py +135 -0
- dapla_metadata/datasets/core.py +136 -182
- dapla_metadata/datasets/dapla_dataset_path_info.py +145 -19
- dapla_metadata/datasets/dataset_parser.py +41 -28
- dapla_metadata/datasets/model_validation.py +29 -20
- dapla_metadata/datasets/statistic_subject_mapping.py +5 -1
- dapla_metadata/datasets/utility/constants.py +22 -15
- dapla_metadata/datasets/utility/enums.py +8 -20
- dapla_metadata/datasets/utility/urn.py +234 -0
- dapla_metadata/datasets/utility/utils.py +183 -111
- dapla_metadata/standards/__init__.py +4 -0
- dapla_metadata/standards/name_validator.py +250 -0
- dapla_metadata/standards/standard_validators.py +98 -0
- dapla_metadata/standards/utils/__init__.py +1 -0
- dapla_metadata/standards/utils/constants.py +49 -0
- dapla_metadata/variable_definitions/__init__.py +11 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/FILES +20 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator/VERSION +1 -0
- dapla_metadata/variable_definitions/_generated/.openapi-generator-ignore +6 -0
- dapla_metadata/variable_definitions/_generated/README.md +148 -0
- dapla_metadata/variable_definitions/_generated/__init__.py +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/__init__.py +47 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/__init__.py +8 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/data_migration_api.py +766 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/draft_variable_definitions_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/patches_api.py +888 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/validity_periods_api.py +583 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api/variable_definitions_api.py +613 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_client.py +779 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/api_response.py +27 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/configuration.py +474 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/CompleteResponse.md +51 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Contact.md +30 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DataMigrationApi.md +90 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Draft.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md +259 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/LanguageStringType.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Owner.md +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/Patch.md +43 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PatchesApi.md +249 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/PublicApi.md +218 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/SupportedLanguages.md +15 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/UpdateDraft.md +44 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriod.md +42 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/ValidityPeriodsApi.md +236 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableDefinitionsApi.md +304 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/docs/VariableStatus.md +17 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/exceptions.py +193 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/__init__.py +31 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/complete_response.py +260 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/contact.py +94 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/draft.py +228 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/get_vardok_vardef_mapping_by_id200_response.py +158 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/language_string_type.py +101 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/owner.py +87 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/patch.py +244 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/problem.py +118 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/update_draft.py +274 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/validity_period.py +225 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_id_response.py +81 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/vardok_vardef_id_pair_response.py +84 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/models/variable_status.py +33 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/py.typed +0 -0
- dapla_metadata/variable_definitions/_generated/vardef_client/rest.py +249 -0
- dapla_metadata/variable_definitions/_utils/__init__.py +1 -0
- dapla_metadata/variable_definitions/_utils/_client.py +32 -0
- dapla_metadata/variable_definitions/_utils/config.py +54 -0
- dapla_metadata/variable_definitions/_utils/constants.py +80 -0
- dapla_metadata/variable_definitions/_utils/files.py +309 -0
- dapla_metadata/variable_definitions/_utils/template_files.py +99 -0
- dapla_metadata/variable_definitions/_utils/variable_definition_files.py +143 -0
- dapla_metadata/variable_definitions/exceptions.py +255 -0
- dapla_metadata/variable_definitions/vardef.py +372 -0
- dapla_metadata/variable_definitions/vardok_id.py +48 -0
- dapla_metadata/variable_definitions/vardok_vardef_id_pair.py +47 -0
- dapla_metadata/variable_definitions/variable_definition.py +422 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/METADATA +34 -36
- dapla_toolbelt_metadata-0.9.11.dist-info/RECORD +97 -0
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info}/WHEEL +1 -1
- dapla_metadata/datasets/config.py +0 -80
- dapla_metadata/datasets/model_backwards_compatibility.py +0 -520
- dapla_metadata/datasets/user_info.py +0 -88
- dapla_toolbelt_metadata-0.2.1.dist-info/RECORD +0 -22
- {dapla_toolbelt_metadata-0.2.1.dist-info → dapla_toolbelt_metadata-0.9.11.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Draft
|
|
2
|
+
|
|
3
|
+
Create 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. |
|
|
10
|
+
**short_name** | **str** | Recommended short name. Must be unique within an organization. |
|
|
11
|
+
**definition** | [**LanguageStringType**](LanguageStringType.md) | Definition of the variable. |
|
|
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. |
|
|
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. |
|
|
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 |
|
|
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.draft import Draft
|
|
27
|
+
|
|
28
|
+
# TODO update the JSON string below
|
|
29
|
+
json = "{}"
|
|
30
|
+
# create an instance of Draft from a JSON string
|
|
31
|
+
draft_instance = Draft.from_json(json)
|
|
32
|
+
# print the JSON string representation of the object
|
|
33
|
+
print(Draft.to_json())
|
|
34
|
+
|
|
35
|
+
# convert the object into a dict
|
|
36
|
+
draft_dict = draft_instance.to_dict()
|
|
37
|
+
# create an instance of Draft from a dict
|
|
38
|
+
draft_from_dict = Draft.from_dict(draft_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
|
+
|
dapla_metadata/variable_definitions/_generated/vardef_client/docs/DraftVariableDefinitionsApi.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# vardef_client.DraftVariableDefinitionsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://metadata.intern.test.ssb.no*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**create_variable_definition**](DraftVariableDefinitionsApi.md#create_variable_definition) | **POST** /variable-definitions | Create a variable definition.
|
|
8
|
+
[**delete_variable_definition_by_id**](DraftVariableDefinitionsApi.md#delete_variable_definition_by_id) | **DELETE** /variable-definitions/{variable-definition-id} | Delete a variable definition.
|
|
9
|
+
[**update_variable_definition_by_id**](DraftVariableDefinitionsApi.md#update_variable_definition_by_id) | **PATCH** /variable-definitions/{variable-definition-id} | Update a variable definition.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# **create_variable_definition**
|
|
13
|
+
> create_variable_definition(active_group, draft)
|
|
14
|
+
|
|
15
|
+
Create a variable definition.
|
|
16
|
+
|
|
17
|
+
Create a variable definition. New variable definitions are automatically assigned status DRAFT and must include all required fields. Attempts to specify id or variable_status in a request will receive 400 BAD REQUEST responses.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
* Bearer (JWT) Authentication (Keycloak token):
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import vardef_client
|
|
25
|
+
from vardef_client.models.draft import Draft
|
|
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.DraftVariableDefinitionsApi(api_client)
|
|
49
|
+
active_group = 'dapla-felles-developers' # str | The group which the user currently represents.
|
|
50
|
+
draft = vardef_client.Draft() # Draft |
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
# Create a variable definition.
|
|
54
|
+
api_instance.create_variable_definition(active_group, draft)
|
|
55
|
+
except Exception as e:
|
|
56
|
+
print("Exception when calling DraftVariableDefinitionsApi->create_variable_definition: %s\n" % e)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Parameters
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
Name | Type | Description | Notes
|
|
65
|
+
------------- | ------------- | ------------- | -------------
|
|
66
|
+
**active_group** | **str**| The group which the user currently represents. |
|
|
67
|
+
**draft** | [**Draft**](Draft.md)| |
|
|
68
|
+
|
|
69
|
+
### Return type
|
|
70
|
+
|
|
71
|
+
void (empty response body)
|
|
72
|
+
|
|
73
|
+
### Authorization
|
|
74
|
+
|
|
75
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
76
|
+
|
|
77
|
+
### HTTP request headers
|
|
78
|
+
|
|
79
|
+
- **Content-Type**: application/json
|
|
80
|
+
- **Accept**: application/json
|
|
81
|
+
|
|
82
|
+
### HTTP response details
|
|
83
|
+
|
|
84
|
+
| Status code | Description | Response headers |
|
|
85
|
+
|-------------|-------------|------------------|
|
|
86
|
+
**201** | Successfully created. | - |
|
|
87
|
+
**400** | Malformed data, missing data or attempt to specify disallowed fields. | - |
|
|
88
|
+
**409** | Short name is already in use by another variable definition. | - |
|
|
89
|
+
|
|
90
|
+
[[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)
|
|
91
|
+
|
|
92
|
+
# **delete_variable_definition_by_id**
|
|
93
|
+
> object delete_variable_definition_by_id(variable_definition_id, active_group)
|
|
94
|
+
|
|
95
|
+
Delete a variable definition.
|
|
96
|
+
|
|
97
|
+
Delete a variable definition.
|
|
98
|
+
|
|
99
|
+
### Example
|
|
100
|
+
|
|
101
|
+
* Bearer (JWT) Authentication (Keycloak token):
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
import vardef_client
|
|
105
|
+
from vardef_client.rest import ApiException
|
|
106
|
+
from pprint import pprint
|
|
107
|
+
|
|
108
|
+
# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
|
|
109
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
110
|
+
configuration = vardef_client.Configuration(
|
|
111
|
+
host = "https://metadata.intern.test.ssb.no"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# The client must configure the authentication and authorization parameters
|
|
115
|
+
# in accordance with the API server security policy.
|
|
116
|
+
# Examples for each auth method are provided below, use the example that
|
|
117
|
+
# satisfies your auth use case.
|
|
118
|
+
|
|
119
|
+
# Configure Bearer authorization (JWT): Keycloak token
|
|
120
|
+
configuration = vardef_client.Configuration(
|
|
121
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
# Enter a context with an instance of the API client
|
|
125
|
+
with vardef_client.ApiClient(configuration) as api_client:
|
|
126
|
+
# Create an instance of the API class
|
|
127
|
+
api_instance = vardef_client.DraftVariableDefinitionsApi(api_client)
|
|
128
|
+
variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
|
|
129
|
+
active_group = 'dapla-felles-developers' # str | The group which the user currently represents.
|
|
130
|
+
|
|
131
|
+
try:
|
|
132
|
+
# Delete a variable definition.
|
|
133
|
+
api_response = api_instance.delete_variable_definition_by_id(variable_definition_id, active_group)
|
|
134
|
+
print("The response of DraftVariableDefinitionsApi->delete_variable_definition_by_id:\n")
|
|
135
|
+
pprint(api_response)
|
|
136
|
+
except Exception as e:
|
|
137
|
+
print("Exception when calling DraftVariableDefinitionsApi->delete_variable_definition_by_id: %s\n" % e)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Parameters
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
Name | Type | Description | Notes
|
|
146
|
+
------------- | ------------- | ------------- | -------------
|
|
147
|
+
**variable_definition_id** | **str**| Unique identifier for the variable definition. |
|
|
148
|
+
**active_group** | **str**| The group which the user currently represents. |
|
|
149
|
+
|
|
150
|
+
### Return type
|
|
151
|
+
|
|
152
|
+
**object**
|
|
153
|
+
|
|
154
|
+
### Authorization
|
|
155
|
+
|
|
156
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
157
|
+
|
|
158
|
+
### HTTP request headers
|
|
159
|
+
|
|
160
|
+
- **Content-Type**: Not defined
|
|
161
|
+
- **Accept**: application/json
|
|
162
|
+
|
|
163
|
+
### HTTP response details
|
|
164
|
+
|
|
165
|
+
| Status code | Description | Response headers |
|
|
166
|
+
|-------------|-------------|------------------|
|
|
167
|
+
**204** | Successfully deleted | - |
|
|
168
|
+
**404** | No such variable definition found | - |
|
|
169
|
+
**405** | Attempt to delete a variable definition with status unlike DRAFT. | - |
|
|
170
|
+
|
|
171
|
+
[[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)
|
|
172
|
+
|
|
173
|
+
# **update_variable_definition_by_id**
|
|
174
|
+
> CompleteResponse update_variable_definition_by_id(variable_definition_id, active_group, update_draft)
|
|
175
|
+
|
|
176
|
+
Update a variable definition.
|
|
177
|
+
|
|
178
|
+
Update a variable definition. Only the fields which need updating should be supplied.
|
|
179
|
+
|
|
180
|
+
### Example
|
|
181
|
+
|
|
182
|
+
* Bearer (JWT) Authentication (Keycloak token):
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
import vardef_client
|
|
186
|
+
from vardef_client.models.complete_response import CompleteResponse
|
|
187
|
+
from vardef_client.models.update_draft import UpdateDraft
|
|
188
|
+
from vardef_client.rest import ApiException
|
|
189
|
+
from pprint import pprint
|
|
190
|
+
|
|
191
|
+
# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
|
|
192
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
193
|
+
configuration = vardef_client.Configuration(
|
|
194
|
+
host = "https://metadata.intern.test.ssb.no"
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
# The client must configure the authentication and authorization parameters
|
|
198
|
+
# in accordance with the API server security policy.
|
|
199
|
+
# Examples for each auth method are provided below, use the example that
|
|
200
|
+
# satisfies your auth use case.
|
|
201
|
+
|
|
202
|
+
# Configure Bearer authorization (JWT): Keycloak token
|
|
203
|
+
configuration = vardef_client.Configuration(
|
|
204
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
# Enter a context with an instance of the API client
|
|
208
|
+
with vardef_client.ApiClient(configuration) as api_client:
|
|
209
|
+
# Create an instance of the API class
|
|
210
|
+
api_instance = vardef_client.DraftVariableDefinitionsApi(api_client)
|
|
211
|
+
variable_definition_id = 'variable_definition_id_example' # str |
|
|
212
|
+
active_group = 'dapla-felles-developers' # str | The group which the user currently represents.
|
|
213
|
+
update_draft = vardef_client.UpdateDraft() # UpdateDraft |
|
|
214
|
+
|
|
215
|
+
try:
|
|
216
|
+
# Update a variable definition.
|
|
217
|
+
api_response = api_instance.update_variable_definition_by_id(variable_definition_id, active_group, update_draft)
|
|
218
|
+
print("The response of DraftVariableDefinitionsApi->update_variable_definition_by_id:\n")
|
|
219
|
+
pprint(api_response)
|
|
220
|
+
except Exception as e:
|
|
221
|
+
print("Exception when calling DraftVariableDefinitionsApi->update_variable_definition_by_id: %s\n" % e)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
### Parameters
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
Name | Type | Description | Notes
|
|
230
|
+
------------- | ------------- | ------------- | -------------
|
|
231
|
+
**variable_definition_id** | **str**| |
|
|
232
|
+
**active_group** | **str**| The group which the user currently represents. |
|
|
233
|
+
**update_draft** | [**UpdateDraft**](UpdateDraft.md)| |
|
|
234
|
+
|
|
235
|
+
### Return type
|
|
236
|
+
|
|
237
|
+
[**CompleteResponse**](CompleteResponse.md)
|
|
238
|
+
|
|
239
|
+
### Authorization
|
|
240
|
+
|
|
241
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
242
|
+
|
|
243
|
+
### HTTP request headers
|
|
244
|
+
|
|
245
|
+
- **Content-Type**: application/json
|
|
246
|
+
- **Accept**: application/json
|
|
247
|
+
|
|
248
|
+
### HTTP response details
|
|
249
|
+
|
|
250
|
+
| Status code | Description | Response headers |
|
|
251
|
+
|-------------|-------------|------------------|
|
|
252
|
+
**200** | Successfully updated | - |
|
|
253
|
+
**400** | Bad request. Examples of these are: - Reference to a Klass classification which doesn't exist. - Owner information missing. - Malformed email addresses. | - |
|
|
254
|
+
**404** | No such variable definition found | - |
|
|
255
|
+
**405** | Attempt to patch a variable definition with status unlike DRAFT. | - |
|
|
256
|
+
**409** | Short name is already in use by another variable definition. | - |
|
|
257
|
+
|
|
258
|
+
[[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)
|
|
259
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# LanguageStringType
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**nb** | **str** | | [optional]
|
|
9
|
+
**nn** | **str** | | [optional]
|
|
10
|
+
**en** | **str** | | [optional]
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from vardef_client.models.language_string_type import LanguageStringType
|
|
16
|
+
|
|
17
|
+
# TODO update the JSON string below
|
|
18
|
+
json = "{}"
|
|
19
|
+
# create an instance of LanguageStringType from a JSON string
|
|
20
|
+
language_string_type_instance = LanguageStringType.from_json(json)
|
|
21
|
+
# print the JSON string representation of the object
|
|
22
|
+
print(LanguageStringType.to_json())
|
|
23
|
+
|
|
24
|
+
# convert the object into a dict
|
|
25
|
+
language_string_type_dict = language_string_type_instance.to_dict()
|
|
26
|
+
# create an instance of LanguageStringType from a dict
|
|
27
|
+
language_string_type_from_dict = LanguageStringType.from_dict(language_string_type_dict)
|
|
28
|
+
```
|
|
29
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Owner
|
|
2
|
+
|
|
3
|
+
Owner
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**team** | **str** | |
|
|
10
|
+
**groups** | **List[str]** | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from vardef_client.models.owner import Owner
|
|
16
|
+
|
|
17
|
+
# TODO update the JSON string below
|
|
18
|
+
json = "{}"
|
|
19
|
+
# create an instance of Owner from a JSON string
|
|
20
|
+
owner_instance = Owner.from_json(json)
|
|
21
|
+
# print the JSON string representation of the object
|
|
22
|
+
print(Owner.to_json())
|
|
23
|
+
|
|
24
|
+
# convert the object into a dict
|
|
25
|
+
owner_dict = owner_instance.to_dict()
|
|
26
|
+
# create an instance of Owner from a dict
|
|
27
|
+
owner_from_dict = Owner.from_dict(owner_dict)
|
|
28
|
+
```
|
|
29
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Patch
|
|
2
|
+
|
|
3
|
+
Create a new Patch version 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. | [optional]
|
|
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_until** | **date** | The variable definition is valid until this date inclusive | [optional]
|
|
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
|
+
**owner** | [**Owner**](Owner.md) | Owner of the definition, i.e. responsible Dapla team (statistics team) and information about access management groups. | [optional]
|
|
22
|
+
**contact** | [**Contact**](Contact.md) | Contact details | [optional]
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from vardef_client.models.patch import Patch
|
|
28
|
+
|
|
29
|
+
# TODO update the JSON string below
|
|
30
|
+
json = "{}"
|
|
31
|
+
# create an instance of Patch from a JSON string
|
|
32
|
+
patch_instance = Patch.from_json(json)
|
|
33
|
+
# print the JSON string representation of the object
|
|
34
|
+
print(Patch.to_json())
|
|
35
|
+
|
|
36
|
+
# convert the object into a dict
|
|
37
|
+
patch_dict = patch_instance.to_dict()
|
|
38
|
+
# create an instance of Patch from a dict
|
|
39
|
+
patch_from_dict = Patch.from_dict(patch_dict)
|
|
40
|
+
```
|
|
41
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# vardef_client.PatchesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://metadata.intern.test.ssb.no*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**create_patch**](PatchesApi.md#create_patch) | **POST** /variable-definitions/{variable-definition-id}/patches | Create a new patch for a variable definition.
|
|
8
|
+
[**get_all_patches**](PatchesApi.md#get_all_patches) | **GET** /variable-definitions/{variable-definition-id}/patches | List all patches for the given variable definition.
|
|
9
|
+
[**get_one_patch**](PatchesApi.md#get_one_patch) | **GET** /variable-definitions/{variable-definition-id}/patches/{patch-id} | Get one concrete patch for the given variable definition.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# **create_patch**
|
|
13
|
+
> create_patch(variable_definition_id, active_group, patch, valid_from=valid_from)
|
|
14
|
+
|
|
15
|
+
Create a new patch for a variable definition.
|
|
16
|
+
|
|
17
|
+
Create a new patch 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.patch import Patch
|
|
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.PatchesApi(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
|
+
patch = vardef_client.Patch() # Patch |
|
|
52
|
+
valid_from = '1970-01-01' # date | Valid from date for the specific validity period to be patched. (optional)
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
# Create a new patch for a variable definition.
|
|
56
|
+
api_instance.create_patch(variable_definition_id, active_group, patch, valid_from=valid_from)
|
|
57
|
+
except Exception as e:
|
|
58
|
+
print("Exception when calling PatchesApi->create_patch: %s\n" % e)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Name | Type | Description | Notes
|
|
67
|
+
------------- | ------------- | ------------- | -------------
|
|
68
|
+
**variable_definition_id** | **str**| Unique identifier for the variable definition. |
|
|
69
|
+
**active_group** | **str**| The group which the user currently represents. |
|
|
70
|
+
**patch** | [**Patch**](Patch.md)| |
|
|
71
|
+
**valid_from** | **date**| Valid from date for the specific validity period to be patched. | [optional]
|
|
72
|
+
|
|
73
|
+
### Return type
|
|
74
|
+
|
|
75
|
+
void (empty response body)
|
|
76
|
+
|
|
77
|
+
### Authorization
|
|
78
|
+
|
|
79
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
80
|
+
|
|
81
|
+
### HTTP request headers
|
|
82
|
+
|
|
83
|
+
- **Content-Type**: application/json
|
|
84
|
+
- **Accept**: application/json
|
|
85
|
+
|
|
86
|
+
### HTTP response details
|
|
87
|
+
|
|
88
|
+
| Status code | Description | Response headers |
|
|
89
|
+
|-------------|-------------|------------------|
|
|
90
|
+
**201** | Successfully created. | - |
|
|
91
|
+
**400** | Bad request. | - |
|
|
92
|
+
**405** | Method only allowed for published variables. | - |
|
|
93
|
+
|
|
94
|
+
[[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)
|
|
95
|
+
|
|
96
|
+
# **get_all_patches**
|
|
97
|
+
> get_all_patches(variable_definition_id)
|
|
98
|
+
|
|
99
|
+
List all patches for the given variable definition.
|
|
100
|
+
|
|
101
|
+
List all patches for the given variable definition. The full object is returned for comparison purposes.
|
|
102
|
+
|
|
103
|
+
### Example
|
|
104
|
+
|
|
105
|
+
* Bearer (JWT) Authentication (Keycloak token):
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
import vardef_client
|
|
109
|
+
from vardef_client.rest import ApiException
|
|
110
|
+
from pprint import pprint
|
|
111
|
+
|
|
112
|
+
# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
|
|
113
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
114
|
+
configuration = vardef_client.Configuration(
|
|
115
|
+
host = "https://metadata.intern.test.ssb.no"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# The client must configure the authentication and authorization parameters
|
|
119
|
+
# in accordance with the API server security policy.
|
|
120
|
+
# Examples for each auth method are provided below, use the example that
|
|
121
|
+
# satisfies your auth use case.
|
|
122
|
+
|
|
123
|
+
# Configure Bearer authorization (JWT): Keycloak token
|
|
124
|
+
configuration = vardef_client.Configuration(
|
|
125
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Enter a context with an instance of the API client
|
|
129
|
+
with vardef_client.ApiClient(configuration) as api_client:
|
|
130
|
+
# Create an instance of the API class
|
|
131
|
+
api_instance = vardef_client.PatchesApi(api_client)
|
|
132
|
+
variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
|
|
133
|
+
|
|
134
|
+
try:
|
|
135
|
+
# List all patches for the given variable definition.
|
|
136
|
+
api_instance.get_all_patches(variable_definition_id)
|
|
137
|
+
except Exception as e:
|
|
138
|
+
print("Exception when calling PatchesApi->get_all_patches: %s\n" % e)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Parameters
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
Name | Type | Description | Notes
|
|
147
|
+
------------- | ------------- | ------------- | -------------
|
|
148
|
+
**variable_definition_id** | **str**| Unique identifier for the variable definition. |
|
|
149
|
+
|
|
150
|
+
### Return type
|
|
151
|
+
|
|
152
|
+
void (empty response body)
|
|
153
|
+
|
|
154
|
+
### Authorization
|
|
155
|
+
|
|
156
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
157
|
+
|
|
158
|
+
### HTTP request headers
|
|
159
|
+
|
|
160
|
+
- **Content-Type**: Not defined
|
|
161
|
+
- **Accept**: application/json
|
|
162
|
+
|
|
163
|
+
### HTTP response details
|
|
164
|
+
|
|
165
|
+
| Status code | Description | Response headers |
|
|
166
|
+
|-------------|-------------|------------------|
|
|
167
|
+
**404** | No such variable definition found | - |
|
|
168
|
+
**200** | Ok | - |
|
|
169
|
+
|
|
170
|
+
[[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)
|
|
171
|
+
|
|
172
|
+
# **get_one_patch**
|
|
173
|
+
> get_one_patch(variable_definition_id, patch_id)
|
|
174
|
+
|
|
175
|
+
Get one concrete patch for the given variable definition.
|
|
176
|
+
|
|
177
|
+
Get one concrete patch for the given variable definition. The full object is returned for comparison purposes.
|
|
178
|
+
|
|
179
|
+
### Example
|
|
180
|
+
|
|
181
|
+
* Bearer (JWT) Authentication (Keycloak token):
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
import vardef_client
|
|
185
|
+
from vardef_client.rest import ApiException
|
|
186
|
+
from pprint import pprint
|
|
187
|
+
|
|
188
|
+
# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
|
|
189
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
190
|
+
configuration = vardef_client.Configuration(
|
|
191
|
+
host = "https://metadata.intern.test.ssb.no"
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
# The client must configure the authentication and authorization parameters
|
|
195
|
+
# in accordance with the API server security policy.
|
|
196
|
+
# Examples for each auth method are provided below, use the example that
|
|
197
|
+
# satisfies your auth use case.
|
|
198
|
+
|
|
199
|
+
# Configure Bearer authorization (JWT): Keycloak token
|
|
200
|
+
configuration = vardef_client.Configuration(
|
|
201
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
# Enter a context with an instance of the API client
|
|
205
|
+
with vardef_client.ApiClient(configuration) as api_client:
|
|
206
|
+
# Create an instance of the API class
|
|
207
|
+
api_instance = vardef_client.PatchesApi(api_client)
|
|
208
|
+
variable_definition_id = 'wypvb3wd' # str | Unique identifier for the variable definition.
|
|
209
|
+
patch_id = 1 # int | ID of the patch to retrieve
|
|
210
|
+
|
|
211
|
+
try:
|
|
212
|
+
# Get one concrete patch for the given variable definition.
|
|
213
|
+
api_instance.get_one_patch(variable_definition_id, patch_id)
|
|
214
|
+
except Exception as e:
|
|
215
|
+
print("Exception when calling PatchesApi->get_one_patch: %s\n" % e)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### Parameters
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
Name | Type | Description | Notes
|
|
224
|
+
------------- | ------------- | ------------- | -------------
|
|
225
|
+
**variable_definition_id** | **str**| Unique identifier for the variable definition. |
|
|
226
|
+
**patch_id** | **int**| ID of the patch to retrieve |
|
|
227
|
+
|
|
228
|
+
### Return type
|
|
229
|
+
|
|
230
|
+
void (empty response body)
|
|
231
|
+
|
|
232
|
+
### Authorization
|
|
233
|
+
|
|
234
|
+
[Keycloak token](../README.md#Keycloak token)
|
|
235
|
+
|
|
236
|
+
### HTTP request headers
|
|
237
|
+
|
|
238
|
+
- **Content-Type**: Not defined
|
|
239
|
+
- **Accept**: application/json
|
|
240
|
+
|
|
241
|
+
### HTTP response details
|
|
242
|
+
|
|
243
|
+
| Status code | Description | Response headers |
|
|
244
|
+
|-------------|-------------|------------------|
|
|
245
|
+
**200** | Ok | - |
|
|
246
|
+
**404** | No such variable definition found | - |
|
|
247
|
+
|
|
248
|
+
[[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)
|
|
249
|
+
|