Content resource

Generated reference for ovok_sdk: content resource.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.23+d339d81

ContentResource

class ContentResource

Project content items, by type, language and key. Reached through ovok.content.

Every request throws an OvokException subclass when it fails.

Constructors

ContentResource.new

ContentResource(HttpClient _http)

Built by Ovok; use ovok.content instead.

ParameterTypeKindDefault
_httpHttpClientpositional

Methods

ContentResource.search

Future<JsonMap> search(
  String type,
  String language, [
  QueryParams params = const {},
])

Searches the type items in language.

Calls GET cms/{type}/{language} with params.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
paramsQueryParamsoptional positionalconst {}

Returns Future<Map<String, dynamic>>.

ContentResource.retrieve

Future<JsonMap> retrieve(
  String type,
  String language,
  String key,
)

Retrieves one item. Calls GET cms/{type}/{language}/{key}.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
keyStringpositional

Returns Future<Map<String, dynamic>>.

ContentResource.create

Future<JsonMap> create(
  String type,
  String language,
  JsonMap body,
)

Creates an item. Calls POST cms/{type}/{language}.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
bodyJsonMappositional

Returns Future<Map<String, dynamic>>.

ContentResource.update

Future<JsonMap> update(
  String type,
  String language,
  String key,
  JsonMap body,
)

Replaces one item. Calls PUT cms/{type}/{language}/{key}.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
keyStringpositional
bodyJsonMappositional

Returns Future<Map<String, dynamic>>.

ContentResource.delete

Future<void> delete(
  String type,
  String language,
  String key,
)

Deletes one item. Calls DELETE cms/{type}/{language}/{key}.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
keyStringpositional

Returns Future<void>.

ContentResource.map

Future<JsonMap> map(
  String type,
  String language, [
  QueryParams params = const {},
])

Pairs each default-language item with its language translation.

Calls GET cms/{type}/map/{language} with params.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
paramsQueryParamsoptional positionalconst {}

Returns Future<Map<String, dynamic>>.

ContentResource.copyFromParent

Future<JsonMap> copyFromParent(
  String type,
  String language,
  String key,
)

Copies one item from the parent project.

Calls POST cms/{type}/{language}/{key}/copy-from-parent-project.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional
keyStringpositional

Returns Future<Map<String, dynamic>>.

ContentResource.copyAllFromParent

Future<JsonMap> copyAllFromParent(String type, String language)

Copies every type item in language from the parent project.

Calls POST cms/{type}/{language}/copy-from-parent-project.

ParameterTypeKindDefault
typeStringpositional
languageStringpositional

Returns Future<Map<String, dynamic>>.

Last updated on

On this page