document

package
v1.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package document exposes the website-only document text-body endpoints. The OAuth API can neither read nor update a document's text body — see the parent package doc for legal caveats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps a *web.Client with the document text endpoints.

func NewClient

func NewClient(w *web.Client) *Client

NewClient returns a document Client backed by the given web Client.

func (*Client) GetText

func (c *Client) GetText(ctx context.Context, guid string) (string, error)

GetText fetches the text body of a document. guid is the document's globally unique identifier (e.g. "6000000222741066971"), not the "document-NNN" short id — resolve it via the OAuth API if needed.

func (*Client) SaveText

func (c *Client) SaveText(ctx context.Context, guid, body string) error

SaveText replaces the text body of a document. The call is idempotent — POSTing the existing text is a no-op. On a 422 from the server (typically a stale authenticity_token) the client invalidates the cached CSRF, refetches, and retries once.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL