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 bymeta.statuscode.Query/OcsFormat— the query string appended to an OCS path, including theformat=jsonselector.OcsClient— executes an OCS call through anyTransportand 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
metablock of an OCS envelope: the verdict plus pagination hints. - Ocs
- The
ocsobject of an OCS response:Metaplus 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.