Skip to main content

Crate nextcloud_ocs

Crate nextcloud_ocs 

Source
Expand description

OCS API envelope and client for the Nextcloud SDK.

Nextcloud’s OCS endpoints answer with an envelope that wraps the payload in a status block, so decoding an OCS response is two steps: unwrap the envelope, then read the data field.

  • OcsEnvelope / Ocs / Meta — the wire shape of that envelope, tolerant of the field types Nextcloud actually sends.
  • OcsStatus — the verdict carried by meta.statuscode.
  • Query / OcsFormat — the query string appended to an OCS path, including the format=json selector.
  • OcsClient — executes an OCS call through any Transport and returns the decoded payload.

OCS requires two request headers that are easy to forget: every call must send OCS-APIRequest: true, and JSON answers require Accept: application/json. OcsClient sets both.

Structs§

Meta
The meta block of an OCS envelope: the verdict plus pagination hints.
Ocs
The ocs object of an OCS response: Meta plus the endpoint payload.
OcsClient
Executes OCS calls and unwraps their envelope.
OcsEnvelope
Top level of every JSON OCS response: {"ocs": {...}}.
Query
Ordered query parameters for an OCS call.

Enums§

OcsFormat
Serialisation format to request from an OCS endpoint.
OcsStatus
Verdict an OCS envelope’s meta block carries.