# ovok_sdk.resources.cms

Canonical page: https://docs.ovok.com/python-sdk/reference/resources/cms

Published CMS content for the configured tenant: documents, legal pages and translations.

## CmsDelivery [#cmsdelivery]

```python
CmsDelivery(http: HttpClient, tenant_code: str)
```

Reads public CMS collections, adding the configured tenant to every request.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `http` | `HttpClient` |  | The client's HTTP client. |
| `tenant_code` | `str` |  | The tenant whose published content is read. |

### list_page() [#list_page]

```python
list_page(collection: str, params: Mapping[str, Any]) -> Any
```

Read one page of a collection.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug, such as `"release-notes"`. |
| `params` | `Mapping[str, Any]` |  | Optional `locale`, `page`, `limit` and `sort`. |

**Returns**

- `Any`: The Payload CMS page: `{docs, totalDocs, nextPage, ...}`.

### retrieve() [#retrieve]

```python
retrieve(collection: str, slug: str, params: Mapping[str, Any]) -> Any
```

Read one document of a collection by its slug.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `slug` | `str` |  | The document slug. |
| `params` | `Mapping[str, Any]` |  | Optional `locale`. |

**Returns**

- `Any`: The document.

**Raises**

- `OvokValidationError`: `slug` is empty.

## CmsDocumentsResource [#cmsdocumentsresource]

```python
CmsDocumentsResource(delivery: CmsDelivery)
```

Documents of any published CMS collection; access it as `ovok.cms.documents`.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `delivery` | `CmsDelivery` |  | The tenant-scoped CMS reader. |

### list() [#list]

```python
list(collection: str, params: Mapping[str, Any] | None = None) -> Page[Any]
```

List a collection's documents.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `params` | `Mapping[str, Any] \| None` | `None` | Optional `locale`, `page` (1-based first page), `limit` and `sort`. |

**Returns**

- `Page[Any]`: A page of documents that loads later pages on demand.

### retrieve() [#retrieve-1]

```python
retrieve(collection: str, slug: str, params: Mapping[str, Any] | None = None) -> Any
```

Read one document by its slug.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `slug` | `str` |  | The document slug. |
| `params` | `Mapping[str, Any] \| None` | `None` | Optional `locale`. |

**Returns**

- `Any`: The document.

**Raises**

- `OvokValidationError`: `slug` is empty.

## ReleaseNotesResource [#releasenotesresource]

```python
ReleaseNotesResource(documents: CmsDocumentsResource)
```

Published release notes; access it as `ovok.cms.release_notes`.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `documents` | `CmsDocumentsResource` |  | The CMS documents resource. |

### list() [#list-1]

```python
list(params: Mapping[str, Any] | None = None) -> Page[Any]
```

List release notes, newest first unless `params` sets `sort`.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `params` | `Mapping[str, Any] \| None` | `None` | Optional `locale`, `page`, `limit` and `sort`. |

**Returns**

- `Page[Any]`: A page of release notes.

## CmsResource [#cmsresource]

```python
CmsResource(http: HttpClient, tenant_code: str)
```

Published CMS content for the configured tenant.

Created by `Ovok`; access it as `ovok.cms`.

### legal_page() [#legal_page]

```python
legal_page(slug: str, params: Mapping[str, Any] | None = None) -> Any
```

Read a legal page, such as the terms or privacy policy, by its slug.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `slug` | `str` |  | The legal page slug. |
| `params` | `Mapping[str, Any] \| None` | `None` | Optional `locale`. |

**Returns**

- `Any`: The legal page document.

**Raises**

- `OvokValidationError`: `slug` is empty.

### translations() [#translations]

```python
translations(locale: str | None = None) -> dict[str, Any]
```

Read every translation string as a nested dictionary.

Keys are the document slug followed by the dotted key's parts. The first value
wins on duplicates; reading stops after 20 pages of 50 documents.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `locale` | `str \| None` | `None` | A language tag such as `"de-CH"`; unsupported languages fall back to `"en"`. |

**Returns**

- `dict[str, Any]`: The translation tree, such as `{"common": {"buttons": {"save": "Save"}}}`.

**Examples**

```python
>>> strings = ovok.cms.translations("de")
>>> strings["common"]["buttons"]["save"]
```
