API referenceresources
ovok_sdk.resources.content
Project-managed CMS content by content type and language.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.25+2ba84b0
Project-managed CMS content by content type and language.
ContentResource
ContentResource(http: HttpClient)Create, read, update and copy the project's CMS content entries.
Every entry is addressed by its content type, language and key.
Created by Ovok; access it as ovok.content.
search()
search(content_type: str, language: str, params: QueryParams | None = None) -> ResourceSearch the entries of a content type in one language.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type, such as "faq". | |
language | str | The language code, such as "en". | |
params | QueryParams | None | None | Optional query parameters passed to the API. |
Returns
Resource: The search result.
retrieve()
retrieve(content_type: str, language: str, key: str) -> ResourceRead one entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
key | str | The entry key. |
Returns
Resource: The entry.
create()
create(content_type: str, language: str, body: Resource) -> ResourceCreate an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
body | Resource | The entry as the API takes it. |
Returns
Resource: The created entry.
update()
update(content_type: str, language: str, key: str, body: Resource) -> ResourceReplace an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
key | str | The entry key. | |
body | Resource | The new entry. |
Returns
Resource: The updated entry.
delete()
delete(content_type: str, language: str, key: str) -> NoneDelete an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
key | str | The entry key. |
map()
map(content_type: str, language: str, params: QueryParams | None = None) -> ResourceRead a content type's entries in one language as a key-to-entry map.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
params | QueryParams | None | None | Optional query parameters passed to the API. |
Returns
Resource: The map of entries by key.
copy_from_parent()
copy_from_parent(content_type: str, language: str, key: str) -> ResourceCopy one entry from the parent project into this project.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. | |
key | str | The entry key. |
Returns
Resource: The copied entry.
copy_all_from_parent()
copy_all_from_parent(content_type: str, language: str) -> ResourceCopy every entry of a content type and language from the parent project.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type | str | The content type. | |
language | str | The language code. |
Returns
Resource: The API's copy result.
Last updated on