Metadata-Version: 2.4
Name: dapla-suv-tools
Version: 0.1.92
Summary: A collection of tools for integrating with the SUV-platform in Dapla.
License-File: LICENSE
Author: Anders Hagen
Author-email: nhk@ssb.no
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: dapla-auth-client (>=1.2.5,<2.0.0)
Requires-Dist: pyjwt (==2.13.0)
Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
Requires-Dist: pytz (>=2025.2,<2026.0)
Requires-Dist: requests (>=2.33.0,<3.0.0)
Requires-Dist: ssb-altinn3-util (>=0.0.87,<0.0.88)
Requires-Dist: starlette (>=1.0.1,<2.0.0)
Project-URL: Changelog, https://github.com/statisticsnorway/dapla-suv-tools/releases
Project-URL: documentation, https://manual.dapla.ssb.no/statistikkere/altinn-dapla-suv-tools.html
Project-URL: homepage, https://github.com/statisticsnorway/dapla-suv-tools
Project-URL: repository, https://github.com/statisticsnorway/dapla-suv-tools
Description-Content-Type: text/markdown

# Dapla Suv Tools
A collection of tools for integrating with the SUV-platform

### Install `dapla-suv-tools` from PyPI

```python
pip install dapla-suv-tools
```

### Initialize a client using `SuvClient`

```python
from dapla_suv_tools.suv_client import SuvClient

client = SuvClient()
```

### Setup pagination using `PaginationInfo`

```python
from dapla_suv_tools.pagination import PaginationInfo

p_info = PaginationInfo(page=1, size=5)
```

### Example 1: fetch skjema by id 

```python
from dapla_suv_tools.suv_client import SuvClient

client = SuvClient()

x = client.get_skjema_by_id(skjema_id=116)

print(x)
```

### Example 2: fetch skjema's with PaginationInfo

```python
from dapla_suv_tools.suv_client import SuvClient
from dapla_suv_tools.pagination import PaginationInfo

client = SuvClient()
p_info = PaginationInfo(page=1, size=5)

y = client.get_skjema_by_ra_nummer(
    ra_nummer="RA-5566", max_results=0, latest_only=False, pagination_info=p_info
)

print(y)
```

### Function `get_skjema_by_id`

Gets a 'skjema' based on it's skjema_id.

```python
output = client.get_skjema_by_id(skjema_id=1)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema's id

**Returns:**
- `Any`: a json object containing skjema data.

### Function `get_skjema_by_ra_nummer`

Attempts to get all skjema with the supplied RA-number.

```python
output = client.get_skjema_by_ra_nummer(ra_nummer="123456789", versjon=1, max_results=0, latest_only=False, pagination_info=None)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `versjon` (int | None, optional): Limit the version of the skjema. Defaults to `None`.
- `max_results` (int, optional): Maximum number of results int the result set.  A value of 0 will get ALL results. Defaults to `0`.
- `latest_only` (bool, optional): Only return the newest entry. Default is False.
- `pagination_info` (PaginationInfo | None, optional): An object holding pagination metadata Defaults to `None`.

**Returns:**
- `dict`: A list of skjema json objects matching the RA-number

### Function `create_skjema`

Creates a new version of metadata for the given skjema, based upon the supplied metadata.

```python
output = client.create_skjema(ra_nummer="RA-1234", versjon=1, undersokelse_nr="123456789", gyldig_fra=date(2024, 1, 1), navn_nb="example", navn_nn="example", infoside="123456789")
print(output)
```

**Parameters:**

- `ra_nummer` (str, required).
- `versjon` (int, required).
- `undersokelse_nr` (str, required).
- `gyldig_fra` (date, required).
- `datamodell` (str | None, optional). Defaults to `None`.
- `beskrivelse` (str | None, optional). Defaults to `None`.
- `navn_nb` (str, required).
- `navn_nn` (str, required).
- `navn_en` (str | None, optional). Defaults to `None`.
- `infoside` (str, required).
- `eier` (str | None, optional). Defaults to `None`.
- `kun_sky` (bool, optional). Defaults to `False`.
- `gyldig_til` (date | None, optional). Defaults to `None`.

**Returns:**
- `Any`

### Function `delete_skjema`

Attempts to delete the skjema with the supplied id.

```python
output = client.delete_skjema(skjema_id=1)
print(output)
```

**Parameters:**

- `skjema_id` (int, required).

**Returns:**
- `Any`: A json object containing the operation result.

### Function `update_skjema_by_ra_number`

Updates a skjema based on the supplied RA-number, versjon and undersokelse_nr. The RA-number, versjon and undersokelse_nr are required, all other parameters are optional. If a parameter is not provided, the existing value will be used.

```python
output = client.update_skjema_by_ra_number(
    ra_nummer="RA-1234",
    versjon=1,
    undersokelse_nr="1234",
    gyldig_fra="2024-01-01",
    datamodell="test",
    beskrivelse="test",
    navn_nb="test",
    navn_nn="test",
    navn_en="test",
    infoside="test",
    eier="test",
    kun_sky=False,
    gyldig_til="2023-01-01"
)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `versjon` (int, required): The version of the skjema.
- `undersokelse_nr` (str, required): The investigation number of the skjema.
- `datamodell` (str | None, optional): The data model of the skjema. Defaults to `None`.
- `beskrivelse` (str | None, optional): The description of the skjema. Defaults to `None`.
- `navn_nb` (str | None, optional): The name of the skjema in Norwegian Bokmål. Defaults to `None`.
- `navn_nn` (str | None, optional): The name of the skjema in Norwegian Nynorsk. Defaults to `None`.
- `navn_en` (str | None, optional): The name of the skjema in English. Defaults to `None`.
- `infoside` (str | None, optional): URL for the information page of the skjema. Defaults to `None`.
- `eier` (str | None, optional): The owner of the skjema. Defaults to `None`.
- `kun_sky` (bool, optional): Whether the skjema is only in the cloud. Defaults to `False`.
- `gyldig_fra` (date | None, optional): The valid from date of the skjema. Defaults to `None`.
- `gyldig_til` (date | None, optional): The valid to date of the skjema. Defaults to `None`.

**Returns:**
- `dict`: A list of skjema json objects matching the RA-number

### Function `update_skjema_by_id`

Updates an existing skjema with the specified skjemea_id. The skjema_id is required, all other parameters are optional. If a parameter is not provided, the existing value will be used.

```python
output = client.update_skjema_by_id(
    skjema_id=1, gyldig_fra=date(2024, 8, 24), datamodell="test", kun_sky=False, gyldig_til=date(2025, 1, 31)
)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The id of the skjema to update.
- `datamodell` (str | None, optional): The data model of the skjema. Defaults to `None`.
- `beskrivelse` (str | None, optional): The description of the skjema. Defaults to `None`.
- `navn_nb` (str | None, optional): The name of the skjema in Norwegian Bokmål. Defaults to `None`.
- `navn_nn` (str | None, optional): The name of the skjema in Norwegian Nynorsk. Defaults to `None`.
- `navn_en` (str | None, optional): The name of the skjema in English. Defaults to `None`.
- `infoside` (str | None, optional): URL for the information page of the skjema. Defaults to `None`.
- `eier` (str | None, optional): The owner of the skjema. Defaults to `None`.
- `kun_sky` (bool | None, optional): Whether the skjema is only in the cloud. Defaults to `None`.
- `gyldig_fra` (date | None, optional): The valid from date of the skjema. Defaults to `None`.
- `gyldig_til` (date | None, optional): The valid to date of the skjema. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated skjema information, or an error message if the update fails.

### Function `get_all_skjema`

Attempts to get all skjema's.

```python
output = client.get_all_skjema()
print(output)
```

**Parameters:**

- `max_results` (int, optional): Maximum number of results int the result set.  A value of 0 will get ALL results. Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional): An object holding pagination metadata Defaults to `None`.

**Returns:**
- `dict`: A list of all skjema json objects

### Function `get_periode_by_id`

Retrieves a period by its ID.

```python
output = client.get_periode_by_id(periode_id=123)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The ID of the period to retrieve.

**Returns:**
- `OperationResult`: An object containing the period information if found, or an error message if the retrieval fails.

### Function `get_perioder_by_skjema_id`

Retrieves periods associated with a specific schema ID.

```python
output = client.get_perioder_by_skjema_id(
    skjema_id=456, periode_type="KVRT", periode_aar=2023
)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema_id of the schema for which to retrieve periods.
- `periode_type` (str | None, optional): The type of the period to filter by. If None, periods of any type will be retrieved. Defaults to `None`.
- `periode_nr` (int | None, optional): The number of the period to filter by. If None, periods of any number will be retrieved. Defaults to `None`.
- `periode_aar` (int | None, optional): The year of the period to filter by. If None, periods of any year will be retrieved. Defaults to `None`.
- `delreg_nr` (int | None, optional): The delreg_nr of the period to filter by. If None, periods of any delreg_nr will be retrieved. Defaults to `None`.
- `enhet_type` (int | None, optional): The enhet_type of the period to filter by. If None, periods of any enhet_type will be retrieved. Defaults to `None`.
- `max_results` (int, optional): Maximum number of results in the result set. A value of 0 will get ALL results. Defaults to 0
- `latest_only` (bool, optional): A boolean flag to trigger a special condition. A True value will retrieve the latest periode added. Defaults to False.
- `pagination_info` (PaginationInfo | None, optional): An object holding pagination metadata. Defaults to None.

**Returns:**
- `OperationResult`: An object containing a list of periods associated with the schema ID, or an error message if the retrieval fails.

### Function `create_periode`

Creates a new period with the specified details.

```python
output = client.create_periode(skjema_id=1)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema_id associated with the new period.
- `periode_type` (str | None, optional): Periode type of the new periode. Defaults to `None`.
- `periode_nr` (int | None, optional): Periode number of the new periode. Defaults to `None`.
- `periode_aar` (int | None, optional): Year of the new periode. Defaults to `None`.
- `periode_dato` (date | None, optional): Date for the period. Defaults to `None`.
- `delreg_nr` (int | None, optional): delreg_nr. Defaults to `None`.
- `enhet_type` (str | None, optional): enhet_type. Defaults to `None`.
- `vis_oppgavebyrde` (bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.
- `vis_brukeropplevelse` (bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.
- `har_skjemadata` (bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.
- `journalnummer` (str | None, optional): journalnummer. Defaults to None.

**Returns:**
- `OperationResult`: An object containing the ID of the created period, or an error message if the creation fails.

### Function `delete_periode`

Deletes the period with the specified periode_id.

```python
output = client.delete_periode(periode_id=1)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The ID of the period to delete.

**Returns:**
- `OperationResult`: An object containing the result of the deletion operation, or an error message if the deletion fails.

### Function `update_periode_by_id`

Updates an existing period with the specified periode_id.

```python
output = client.update_periode_by_id(periode_id=1)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The ID of the period to update.
- `periode_dato` (date | None, optional): Date for the period. If None, the existing date will be used. Defaults to `None`.
- `delreg_nr` (int | None, optional): delreg_nr. If None, the existing number will be used. Defaults to `None`.
- `enhet_type` (str | None, optional): enhet_type. If None, the existing type will be used. Defaults to `None`.
- `vis_oppgavebyrde` (bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.
- `vis_brukeropplevelse` (bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.
- `har_skjemadata` (bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.
- `journalnummer` (str | None, optional): Journal number. If None, the existing number will be used. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated period information, or an error message if the update fails.

### Function `update_periode_by_skjema_id`

Updates an existing period with the specified skjema_id.

```python
output = client.update_periode_by_skjema_id(skjema_id=1, periode_type="example", periode_aar=1, periode_nr=1)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema_id of the period to update.
- `periode_type` (str, required): Periode type of the period to update.
- `periode_aar` (int, required): Year of the period to update.
- `periode_nr` (int, required): Periode number of the period to update.
- `periode_dato` (date | None, optional): Date for the period. If None, the existing date will be used. Defaults to `None`.
- `delreg_nr` (int | None, optional): delreg_nr. If None, the existing number will be used. Defaults to `None`.
- `enhet_type` (str | None, optional): Unit type. If None, the existing type will be used. Defaults to `None`.
- `vis_oppgavebyrde` (bool | None, optional): A boolean flag to indicate visibility of "oppgavebyrde". Defaults to None.
- `vis_brukeropplevelse` (bool | None, optional): A boolean flag to indicate visibility of "brukeropplevelse". Defaults to None.
- `har_skjemadata` (bool | None, optional): A boolean flag to indicate the presence of schema data. Defaults to None.
- `journalnummer` (str | None, optional): Journal number. If None, the existing number will be used. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated period information, or an error message if the update fails.

### Function `create_new_periodes`

Creates new periodes using a given exisiting period.

```python
output = client.create_new_periodes(periode_id=80, num_new_periodes=3)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The periode_id associated with the new periods.
- `num_new_periodes` (int, required): Number of new periodes to be created

**Returns:**
- `OperationResult`: An object containing the ID of the created periodes, or an error message if the creation fails.

### Function `get_pulje_by_id`

Retrieves a pulje by its ID.

```python
output = client.get_pulje_by_id(pulje_id=123)
print(output)
```

**Parameters:**

- `pulje_id` (int, required): The ID of the pulje to retrieve.

**Returns:**
- `OperationResult`: An object containing the pulje information if found, or an error message if the retrieval fails.

### Function `get_pulje_by_periode_id`

Retrieves a pulje by its periode_id.

```python
output = client.get_pulje_by_periode_id(periode_id=123)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The periode_id of the pulje to retrieve.

**Returns:**
- `OperationResult`: A list of objects containing the pulje information for every pulje under the given pulje_id if found, or an error message if the retrieval fails.

### Function `create_pulje`

Creates a new pulje with the specified details.

```python
output = client.create_pulje(periode_id=1, altinn_tilgjengelig=datetime(2024, 1, 1, 12, 0))
print(output)
```

**Parameters:**

- `periode_id` (int, required): The periode_id associated with the new pulje.
- `pulje_nr` (int | None, optional): pulje_nr of the new pulje. Has to be unique under the same periode_id if is going to be set. Defaults to `None`.
- `altinn_tilgjengelig` (datetime, required): Date and time for altinn_tilgjengelig.
- `altinn_svarfrist` (date | None, optional): Date for altinn_svarfrist. Defaults to `None`.
- `tvangsmulkt_svarfrist` (date | None, optional): Date for tvangsmulkt_svarfrist. Defaults to `None`.
- `send_si` (date | None, optional): Date for send_si. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the ID of the created pulje, or an error message if the creation fails.

### Function `update_pulje_by_id`

Updates an existing pulje with the specified pulje_id.

```python
output = client.update_pulje_by_id(
    pulje_id=456, send_si=date(2023,10,12)
)
print(output)
```

**Parameters:**

- `pulje_id` (int, required): The ID of the period to update.
- `altinn_tilgjengelig` (datetime | None, optional): Date and time for altinn_tilgjengelig. Defaults to `None`.
- `altinn_svarfrist` (date | None, optional): Date for altinn_svarfrist. Defaults to `None`.
- `tvangsmulkt_svarfrist` (date | None, optional): Date for tvangsmulkt_svarfrist. Defaults to `None`.
- `send_si` (date | None, optional): Date for send_si. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated pulje information, or an error message if the update fails.

### Function `update_pulje_by_periode_id`

Updates an existing pulje with the specified periode_id and pulje.

```python
output = client.update_pulje_by_periode_id(
    periode_id=456, pulje_nr=2, tvangsmulkt_svarfrist=date(2024,11,13)
)
print(output)
```

**Parameters:**

- `periode_id` (int, required): The ID of the pulje to update.
- `pulje_nr` (int, required): The pulje_nr of the period to update.
- `altinn_tilgjengelig` (datetime | None, optional): Date and time for altinn_tilgjengelig. Defaults to `None`.
- `altinn_svarfrist` (date | None, optional): Date for altinn_svarfrist. Defaults to `None`.
- `tvangsmulkt_svarfrist` (date | None, optional): Date for tvangsmulkt_svarfrist. Defaults to `None`.
- `send_si` (date | None, optional): Date for send_si. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated pulje information, or an error message if the update fails.

### Function `delete_pulje`

Deletes the pulje with the specified pulje_id.

```python
output = client.delete_pulje(
    pulje_id=123
)
print(output)
```

**Parameters:**

- `pulje_id` (int, required): The pulje_id of the pulje to delete.

**Returns:**
- `OperationResult`: An object containing the result of the deletion operation, or an error message if the deletion fails.

### Function `get_utsending_by_id`

Retrieves an utsending by its ID.

```python
output = client.get_utsending_by_id(utsending_id=123)
print(output)
```

**Parameters:**

- `utsending_id` (int, required): The ID of the utsending to retrieve.

**Returns:**
- `OperationResult`: An object containing the utsending information if found, or an error message if the retrieval fails.

### Function `get_utsending_by_pulje_id`

Retrieves a pulje by its pulje_id.

```python
output = client.get_utsending_by_pulje_id(pulje_id=123)
print(output)
```

**Parameters:**

- `pulje_id` (int, required): The pulje_id of the utsending to retrieve.

**Returns:**
- `OperationResult`: A list of objects containing the utsending information for every utsending under the given pulje_id if found, or an error message if the retrieval fails.

### Function `update_utsending_by_id`

Updates an existing utsending with the specified utsending_id.

```python
output = client.update_utsending_by_id(
    utsending_id=456,utsendingstype_navn="instansiering", trigger="Manuell", altinn_uts_tidspunkt=datetime(2023,10,12)
)
print(output)
```

**Parameters:**

- `utsending_id` (int, required): The ID of the utsending to update.
- `utsendingstype_navn` (str | None, optional): utsendingstype_navn for utsending to update Defaults to `None`.
- `trigger` (str | None, optional). Defaults to `None`.
- `test` (bool | None, optional). Defaults to `None`.
- `altinn_uts_tidspunkt` (datetime | None, optional). Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the updated utsending information, or an error message if the update fails.

### Function `create_utsending`

Creates a new utsending with the specified details.

```python
output = client.create_utsending(
    pulje_id=456, test=True
)
print(output)
```

**Parameters:**

- `pulje_id` (int, required): The pulje_id associated with the new utsending.
- `utsendingstype_navn` (str | None, optional): utsendingstype_navn for utsending to create Defaults to `None`.
- `trigger` (str | None, optional). Defaults to `'Manuell'`.
- `test` (bool | None, optional). Defaults to `False`.
- `altinn_uts_tidspunkt` (datetime | None, optional). Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing the ID of the created utsending, or an error message if the creation fails.

### Function `delete_utsending`

Deletes the utsending with the specified utsending_id.

```python
output = client.delete_utsending(
    utsending_id=123
)
print(output)
```

**Parameters:**

- `utsending_id` (int, required): The utsending_id of the utsending to delete.

**Returns:**
- `OperationResult`: An object containing the result of the deletion operation, or an error message if the deletion fails.

### Function `get_correspondence_by_id`

Retrieves a correspondence by its id.

```python
output = client.get_correspondence_by_id(id="019e212d-e74a-7f6e-9d41-ac22eab81970")
print(output)
```

**Parameters:**

- `id` (str, required): The guid of the correspondence to retrieve.

**Returns:**
- `OperationResult`: Object containing the correspondence information for the given id if found, or an error message if the retrieval fails.

### Function `get_altinn_dialog_by_id`

Retrieves an Altinn dialog by its dialog_id.

```python
output = client.get_altinn_dialog_by_id(dialog_id="...")
print(output)
```

**Parameters:**

- `dialog_id` (str, required): The dialog_id of the Altinn dialog to retrieve.

**Returns:**
- `OperationResult`: Object containing the Altinn dialog information for the given dialog_id if found, or an error message if the retrieval fails.

### Function `get_instance`

Gets an 'instance' based on it's owner id and guid.

```python
output = client.get_instance(instance_id="123456789")
print(output)
```

**Parameters:**

- `instance_id` (str, required): The combined instance's owner id and guid separated by a '/' (e.g. '123451213/12345678-1234-1234-1234-123456789012').

**Returns:**
- `Any`: a json object containing instance data.

### Function `resend_instances`

Resend 'instances' based on it's batch_ref, ra_number, period or reportee_id. If no filters are provided, all failed instances will be resent.

```python
output = client.resend_instances(filters="example")
print(output)
```

**Parameters:**

- `filters` (str, required): The filters to apply to the instances. Sample filters: {"batch_ref": "123", "ra_number": "123", "period": "2021-01", "reportee_id": "123"}

**Returns:**
- `Any`: a json object containing instance data.

### Function `resend_receipts`

Resend receipts for instances in error bucket.

```python
output = client.resend_receipts()
print(output)
```

**Parameters:**

None

**Returns:**
- `Any`: a json object containing instance data.

### Function `get_prefill_meta_by_skjema_id`

Gets prefill meta for a 'skjema' based on it's skjema_id.

```python
output = client.get_prefill_meta_by_skjema_id(
    skjema_id=123
)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema_id associated with the new period.

**Returns:**
- `OperationResult`: A list of json objects containing the skjema's prefill meta data

### Function `get_prefill_meta_by_skjema_def`

Gets prefill meta for a 'skjema' based on it's skjema_def.

```python
output = client.get_prefill_meta_by_skjema_def(
    ra_nummer="RA-0666A3",
    versjon= 1,
    undersokelse_nr=1060
)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): The RA number associated with the skjema.
- `versjon` (int, required): The version number of the skjema.
- `undersokelse_nr` (str, required): The survey number linked to the skjema.

**Returns:**
- `OperationResult`: A json objects containing the skjema's prefill meta data

### Function `save_prefill_meta`

Creates prefill meta for given skjema_id

```python
output = client.save_prefill_meta(
    skjema_id=123, min= 1, maks = 300, obligatorisk = True
)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The ID of the skjema associated with the prefill meta.
- `navn` (str, required): The name of the prefill meta.
- `obligatorisk` (bool | None, optional): Whether or not it is Required Defaults to `False`.
- `sti` (str | None, optional): The path associated with the prefill meta. Defaults to `None`.
- `tittel` (str | None, optional): The title of the prefill meta. Defaults to `None`.
- `type` (str | None, optional): The type of the prefill meta (e.g., "ORDINAR"). Defaults to `'ORDINAR'`.
- `min` (int | None, optional): The minimum value allowed for the prefill meta. Defaults to `None`.
- `maks` (int | None, optional): The maximum value allowed for the prefill meta. Defaults to `None`.
- `dublett_sjekk` (bool | None, optional). Defaults to `False`.
- `stat_navn` (str | None, optional): The statistical name associated with the prefill meta. Defaults to `None`.
- `kommentar` (str | None, optional): Any comments about the prefill meta. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing id of the new created prefill meta

### Function `get_prefill_meta_by_prefill_meta_id`

Gets prefill meta based on it's prefill_meta_id.

```python
output = client.get_prefill_meta_by_prefill_meta_id(
    prefill_meta_id=123
)
print(output)
```

**Parameters:**

- `prefill_meta_id` (int, required): The prefill_meta_id associated with the prefill meta.

**Returns:**
- `OperationResult`: an object containing prefill meta data

### Function `update_prefill_meta_by_prefill_meta_id`

Updates prefill meta based on it's prefill_meta_id.

```python
output = client.update_prefill_meta_by_prefill_meta_id(
    prefill_meta_id=123, min= 1, maks = 300, obligatorisk = True
)
print(output)
```

**Parameters:**

- `prefill_meta_id` (int, required): The prefill_meta_id associated with the prefill meta.
- `obligatorisk` (bool | None, optional): Whether or not it is Required Defaults to `False`.
- `skjema_id` (int | None, optional): The ID of the skjema associated with the prefill meta. Defaults to `None`.
- `navn` (str | None, optional): The name of the prefill meta. Defaults to `None`.
- `sti` (str | None, optional): The path associated with the prefill meta. Defaults to `None`.
- `tittel` (str | None, optional): The title of the prefill meta. Defaults to `None`.
- `type` (str | None, optional): The type of the prefill meta (e.g., "ORDINAR"). Defaults to `None`.
- `min` (int | None, optional): The minimum value allowed for the prefill meta. Defaults to `None`.
- `maks` (int | None, optional): The maximum value allowed for the prefill meta. Defaults to `None`.
- `dublett_sjekk` (bool | None, optional). Defaults to `None`.
- `stat_navn` (str | None, optional): The statistical name associated with the prefill meta. Defaults to `None`.
- `kommentar` (str | None, optional): Any comments about the prefill meta. Defaults to `None`.

**Returns:**
- `OperationResult`: An object containing updated prefill meta

### Function `delete_skjema_prefill_meta_by_id`

Deletes the prefill meta with the specified prefill_meta_id.

```python
output = client.delete_skjema_prefill_meta_by_id(
    prefill_meta_id=123
)
print(output)
```

**Parameters:**

- `prefill_meta_id` (int, required): The prefill_meta_id of the prefill meta to delete.

**Returns:**
- `OperationResult`: An object containing the result of the deletion operation, or an error message if the deletion fails.

### Function `delete_skjema_prefill_meta_by_skjema_id`

Deletes all prefill meta within the specified skjema_id.

```python
output = client.delete_skjema_prefill_meta_by_skjema_id(skjema_id=1)
print(output)
```

**Parameters:**

- `skjema_id` (int, required): The skjema_id of the prefill meta to delete.

**Returns:**
- `OperationResult`: An object containing the result of the deletion operation, or an error message if the deletion fails.

### Function `get_prefill_meta_datamodel_as_csv`

Gets datamodel for a 'skjema' as CSV based on it's ra_nummer and version.

```python
output = client.get_prefill_meta_datamodel_as_csv(ra_nummer="RA-1234", version=1)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): The RA number associated with the skjema.
- `version` (int, required): The version number of the skjema.

**Returns:**
- `OperationResult`: A string (csv_data) containing the skjema's prefill meta data in CSV format

### Function `get_prefill_info_for_skjema`

Fetches prefill information for a given combination of skjema-identifiers and periode-identifiers.

```python
output = client.get_prefill_info_for_skjema(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Ra-number of the skjema
- `versjon` (int, required): Version indicator of the skjema
- `periode_aar` (int, required): The year of the period
- `periode_type` (str, required): The type of period
- `periode_nr` (int | None, required): The number of the period.  Not required for annual surveys.
- `include_prefill` (bool | None, optional): Whether to include prefill data in the response Defaults to `False`.

**Returns:**
- `Any`

### Function `get_prefill_for_enhet`

Fetches prefill for a given unit for a combination of skjema-identifiers and periode-identifiers.

```python
output = client.get_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example")
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Ra-number of the skjema
- `versjon` (int, required): Version indicator of the skjema
- `periode_aar` (int, required): The year of the period
- `periode_type` (str, required): The type of period
- `periode_nr` (int | None, required): The number of the period.  Not required for annual surveys.
- `enhetsident` (str, required): An identifier for the unit
- `enhetstype` (str, required): Type indicator for the unit

**Returns:**
- `Any`

### Function `save_prefill_for_enhet`

Saves prefill for a given unit for a combination of skjema-identifiers and periode-identifiers. This will overwrite any registered prefill for the unit for the given survey!!  This action is not reversible, and can not be undone!!

```python
output = client.save_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example", prefill={})
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Ra-number of the skjema
- `versjon` (int, required): Version indicator of the skjema
- `periode_aar` (int, required): The year of the period
- `periode_type` (str, required): The type of period
- `periode_nr` (int | None, required): The number of the period.  Not required for annual surveys.
- `enhetsident` (str, required): An identifier for the unit
- `enhetstype` (str, required): Type indicator for the unit
- `prefill` (dict[str, Any], required): A dictionary (json-object) containing the prefill information for the unit.
- `undersokelsesnummer` (str | None, optional): Undersøkelsesnummer. Required if the same skjema and version is used for multiple surveys. Defaults to `None`.

**Returns:**
- `Any`

### Function `delete_prefill_for_skjema`

Deletes all prefill information for a given combination of skjema-identifiers and periode-identifiers. This operation is not reversible, and can not be undone!!

```python
output = client.delete_prefill_for_skjema(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1)
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Ra-number of the skjema
- `versjon` (int, required): Version indicator of the skjema
- `periode_aar` (int, required): The year of the period
- `periode_type` (str, required): The type of period
- `periode_nr` (int | None, required): The number of the period.  Not required for annual surveys.

**Returns:**
- `Any`

### Function `delete_prefill_for_enhet`

Deletes prefill for a given unit for a combination of skjema-identifiers and periode-identifiers. This operation is not reversible, and can not be undone!!

```python
output = client.delete_prefill_for_enhet(ra_nummer="RA-1234", versjon=1, periode_aar=1, periode_type="example", periode_nr=1, enhetsident="123456789", enhetstype="example")
print(output)
```

**Parameters:**

- `ra_nummer` (str, required): Ra-number of the skjema
- `versjon` (int, required): Version indicator of the skjema
- `periode_aar` (int, required): The year of the period
- `periode_type` (str, required): The type of period
- `periode_nr` (int | None, required): The number of the period.  Not required for annual surveys.
- `enhetsident` (str, required): An identifier for the unit
- `enhetstype` (str, required): Type indicator for the unit

**Returns:**
- `Any`

### Function `validate_skjemadata`

Validates skjemadata for a given unit for a combination of skjema-identifiers.

```python
output = client.validate_skjemadata(skjemadata={}, ra_nummer="RA-1234", versjon=1)
print(output)
```

**Parameters:**

- `skjemadata` (dict[str, Any] | str, required): skjemadata
- `ra_nummer` (str, required): Ra-number
- `versjon` (int, required): Version
- `undersokelsesnummer` (str | None, optional): Undersøkelsesnummer. Required if the same skjema and version is used for multiple surveys. Defaults to `None`.

**Returns:**
- `Any`

### Function `get_utvalg_from_sfu`

Get selection from SFU.

```python
output = client.get_utvalg_from_sfu(delreg_nr="123456789", ra_nummer="123456789", pulje="123456789")
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `pulje` (str | None, optional): Limit the selection by pulje. Default is None, which means ALL puljes will be included. If specified, only the selection for the given pulje will be returned. It's possible to specify one or more puljes by separating them with commas, e.g. pulje="1,2,3". The value "0" can be used to fetch a selection that has not been assigned to a pulje.
- `status` (str | None, optional): Limit the selection by status. Possible values are "besvart", "ikke-besvart", "alle". Defaults to `'alle'`.
- `max_results` (int, optional): Specifies the maximum number of results in the returned result.  If 0 or omitted, all results matching the query will be returned.  Will be ignored if used together with paginiation_info Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional): Sets the parameters used for paginating the query results.  Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query.  NOTE:  This might take some time for large result sets so be patient if retrieving thousands of records! Defaults to `None`.

**Returns:**
- `dict`: A list of json objects matching the selection

### Function `get_enhet_from_sfu`

Get unit from SFU.

```python
output = client.get_enhet_from_sfu(delreg_nr="123456789", orgnr="123456789")
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `orgnr` (str, required): The organization number of the unit.

**Returns:**
- `dict`: An object matching the organization number

### Function `get_vareliste`

Get vareliste.

```python
output = client.get_vareliste(delreg_nr=1, ra_nummer="RA-1234")
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `ident_nr` (str | None, optional): The ident number of the entity. Defaults to `None`.
- `enhets_type` (str | None, optional): The type of unit. Defaults to `None`.
- `katalog_id` (int | None, optional): The catalog ID. Defaults to `None`.
- `aktiv` (str | None, optional): Aktiv status. Defaults to `None`.
- `felt_ids` (list[str] | None, optional): List of field ids to include in the response. Defaults to `None`.
- `max_results` (int, optional): Specifies the maximum number of results in the returned result.  If 0 or omitted, all results matching the query will be returned.  Will be ignored if used together with paginiation_info Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional): Sets the parameters used for paginating the query results.  Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query.  NOTE:  This might take some time for large result sets so be patient if retrieving thousands of records! Defaults to `None`.

**Returns:**
- `dict`: A dict object matching the vareliste

### Function `get_delreg_from_sfu`

Get delreg from SFU.

```python
output = client.get_delreg_from_sfu(delreg_nr=1)
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `enhets_type` (str | None, optional): Limit selection by the type of unit. Possible values are "BEDR" (bedrift), "FRTK" (foretak). Defaults to `None`.
- `max_results` (int, optional): Specifies the maximum number of results in the returned result.  If 0 or omitted, all results matching the query will be returned.  Will be ignored if used together with paginiation_info Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional): Sets the parameters used for paginating the query results.  Will take precedence over max_results if both are set. If omitted, will return the full set, or up to max_results, of the query.  NOTE:  This might take some time for large result sets so be patient if retrieving thousands of records! Defaults to `None`.

**Returns:**
- `dict`: A list of json objects matching the selection

### Function `initialize_prefill_isee`

Initialize prefill in ISEE.

```python
output = client.initialize_prefill_isee(delreg_nr=123456789, ra_nummer="RA-1234")
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `max_results` (int, optional). Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional). Defaults to `None`.

**Returns:**
- `dict`: A string matching the ISEE initialization result

### Function `fetch_prefill_isee`

Get prefill from isee.

```python
output = client.fetch_prefill_isee(delreg_nr=1, ra_nummer="RA-1234")
print(output)
```

**Parameters:**

- `delreg_nr` (int, required): The delreg number of the selection.
- `ra_nummer` (str, required): Skjema's RA-number, e.g. 'RA-1234'.
- `max_age_minutes` (int | None, optional): The maximum age of the prefill data in minutes. Default is 1440 (24 hours). If the existing prefill data is older than this, it will be refreshed before being returned.
- `ident_nr` (str | None, optional): The ident number. Defaults to `None`.
- `enhets_type` (str | None, optional): The type of unit. Defaults to `None`.
- `felt_ids` (list[str] | None, optional). Defaults to `None`.
- `max_results` (int, optional). Defaults to `0`.
- `pagination_info` (PaginationInfo | None, optional). Defaults to `None`.

**Returns:**
- `dict`: A dict object matching the prefill isee

