API referenceovok_sdk.resources

ovok_sdk.resources.cms_authoring

CMS authoring: the tenant's collections, read and written by a CMS editor.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.34+53a6a64

CMS authoring: the tenant's collections, read and written by a CMS editor.

CmsAuthoringResource

CmsAuthoringResource(http: HttpClient)

Draft and published documents of the signed-in editor's tenant; access it as ovok.cms.authoring.

Parameters

NameTypeDefaultDescription
httpHttpClientThe client's HTTP client.

list()

list(
    collection: str,
    params: Mapping[str, Any] | None = None,
    *,
    options: RequestOptions | None = None,
) -> Page[Any]

List a collection's documents.

Parameters

NameTypeDefaultDescription
collectionstrThe collection slug.
paramsMapping[str, Any] | NoneNoneOptional where ({field: {operator: value}}), page (1-based first page), limit, sort, depth and locale.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

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

Examples

>>> ovok.cms.authoring.list("faqs", {"where": {"status": {"equals": "draft"}}})

retrieve()

retrieve(
    collection: str,
    document_id: int | str,
    *,
    options: RequestOptions | None = None,
) -> Any

Read one document by its ID.

Parameters

NameTypeDefaultDescription
collectionstrThe collection slug.
document_idint | strThe document ID.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The document.

create()

create(
    collection: str,
    document: Mapping[str, Any],
    *,
    options: RequestOptions | None = None,
) -> Any

Create a document.

Parameters

NameTypeDefaultDescription
collectionstrThe collection slug.
documentMapping[str, Any]The document's fields.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The created document.

update()

update(
    collection: str,
    document_id: int | str,
    fields: Mapping[str, Any],
    *,
    options: RequestOptions | None = None,
) -> Any

Change some fields of a document.

Parameters

NameTypeDefaultDescription
collectionstrThe collection slug.
document_idint | strThe document ID.
fieldsMapping[str, Any]The fields to change.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The document after the change.

delete()

delete(
    collection: str,
    document_id: int | str,
    *,
    options: RequestOptions | None = None,
) -> None

Delete a document.

Parameters

NameTypeDefaultDescription
collectionstrThe collection slug.
document_idint | strThe document ID.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Last updated on

On this page