Documentation ¶
Overview ¶
Package client implements the REST API exposed by Paperless-ngx. Paperless-ngx is a document management system transforming physical documents into a searchable online archive.
Authentication ¶
Multiple authentication schemes are supported:
- UsernamePasswordAuth: HTTP basic authentication.
- TokenAuth: Paperless-ngx API authentication tokens.
- GCPServiceAccountKeyAuth: OpenID Connect (OIDC) using a Google Cloud Platform service account.
Pagination ¶
APIs returning lists of items support pagination (e.g. Client.ListDocuments). The ListOptions struct embedded in the API-specific options supports specifying the page to request. Pagination tokens are available via the Response struct.
Example (Filter) ¶
cl := New(Options{ /* … */ }) var opt ListStoragePathsOptions opt.Ordering.Field = "name" opt.Name.ContainsIgnoringCase = String("sales") opt.Path.StartsWithIgnoringCase = String("2019/") for { got, resp, err := cl.ListStoragePaths(context.Background(), opt) if err != nil { log.Fatalf("Listing storage paths failed: %v", err) } for _, i := range got { log.Printf("%s (%d documents)", i.Name, i.DocumentCount) } if resp.NextPage == nil { break } opt.Page = resp.NextPage }
Output:
Example (Pagination) ¶
cl := New(Options{ /* … */ }) var opt ListDocumentsOptions var all []Document for { documents, resp, err := cl.ListDocuments(context.Background(), opt) if err != nil { log.Fatalf("Listing documents failed: %v", err) } all = append(all, documents...) if resp.NextPage == nil { break } opt.Page = resp.NextPage } log.Printf("Received %d documents in total.", len(all))
Output:
Index ¶
- func Bool(v bool) *bool
- func DefaultWaitForTaskCondition(task *Task) error
- func Int(v int) *int
- func Int64(v int64) *int64
- func String(v string) *string
- func Time(v time.Time) *time.Time
- type AuthMechanism
- type CharFilterSpec
- type Client
- func (c *Client) CreateCorrespondent(ctx context.Context, data *CorrespondentFields) (*Correspondent, *Response, error)
- func (c *Client) CreateCustomField(ctx context.Context, data *CustomFieldFields) (*CustomField, *Response, error)
- func (c *Client) CreateDocumentType(ctx context.Context, data *DocumentTypeFields) (*DocumentType, *Response, error)
- func (c *Client) CreateStoragePath(ctx context.Context, data *StoragePathFields) (*StoragePath, *Response, error)
- func (c *Client) CreateTag(ctx context.Context, data *TagFields) (*Tag, *Response, error)
- func (c *Client) DeleteCorrespondent(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DeleteCustomField(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DeleteDocument(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DeleteDocumentType(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DeleteStoragePath(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DeleteTag(ctx context.Context, id int64) (*Response, error)
- func (c *Client) DownloadDocumentArchived(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
- func (c *Client) DownloadDocumentOriginal(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
- func (c *Client) DownloadDocumentThumbnail(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
- func (c *Client) GetCorrespondent(ctx context.Context, id int64) (*Correspondent, *Response, error)
- func (c *Client) GetCurrentUser(ctx context.Context) (*User, *Response, error)
- func (c *Client) GetCustomField(ctx context.Context, id int64) (*CustomField, *Response, error)
- func (c *Client) GetDocument(ctx context.Context, id int64) (*Document, *Response, error)
- func (c *Client) GetDocumentMetadata(ctx context.Context, id int64) (*DocumentMetadata, *Response, error)
- func (c *Client) GetDocumentType(ctx context.Context, id int64) (*DocumentType, *Response, error)
- func (c *Client) GetGroup(ctx context.Context, id int64) (*Group, *Response, error)
- func (c *Client) GetLog(ctx context.Context, name string) ([]LogEntry, *Response, error)
- func (c *Client) GetStoragePath(ctx context.Context, id int64) (*StoragePath, *Response, error)
- func (c *Client) GetTag(ctx context.Context, id int64) (*Tag, *Response, error)
- func (c *Client) GetTask(ctx context.Context, taskID string) (*Task, *Response, error)
- func (c *Client) GetUser(ctx context.Context, id int64) (*User, *Response, error)
- func (c *Client) ListAllCorrespondents(ctx context.Context, opts ListCorrespondentsOptions, ...) error
- func (c *Client) ListAllCustomFields(ctx context.Context, opts ListCustomFieldsOptions, ...) error
- func (c *Client) ListAllDocumentTypes(ctx context.Context, opts ListDocumentTypesOptions, ...) error
- func (c *Client) ListAllDocuments(ctx context.Context, opts ListDocumentsOptions, ...) error
- func (c *Client) ListAllGroups(ctx context.Context, opts ListGroupsOptions, ...) error
- func (c *Client) ListAllStoragePaths(ctx context.Context, opts ListStoragePathsOptions, ...) error
- func (c *Client) ListAllTags(ctx context.Context, opts ListTagsOptions, ...) error
- func (c *Client) ListAllUsers(ctx context.Context, opts ListUsersOptions, ...) error
- func (c *Client) ListCorrespondents(ctx context.Context, opts ListCorrespondentsOptions) ([]Correspondent, *Response, error)
- func (c *Client) ListCustomFields(ctx context.Context, opts ListCustomFieldsOptions) ([]CustomField, *Response, error)
- func (c *Client) ListDocumentTypes(ctx context.Context, opts ListDocumentTypesOptions) ([]DocumentType, *Response, error)
- func (c *Client) ListDocuments(ctx context.Context, opts ListDocumentsOptions) ([]Document, *Response, error)
- func (c *Client) ListGroups(ctx context.Context, opts ListGroupsOptions) ([]Group, *Response, error)
- func (c *Client) ListLogs(ctx context.Context) ([]string, *Response, error)
- func (c *Client) ListStoragePaths(ctx context.Context, opts ListStoragePathsOptions) ([]StoragePath, *Response, error)
- func (c *Client) ListTags(ctx context.Context, opts ListTagsOptions) ([]Tag, *Response, error)
- func (c *Client) ListTasks(ctx context.Context) ([]Task, *Response, error)
- func (c *Client) ListUsers(ctx context.Context, opts ListUsersOptions) ([]User, *Response, error)
- func (c *Client) PatchCorrespondent(ctx context.Context, id int64, data *CorrespondentFields) (*Correspondent, *Response, error)
- func (c *Client) PatchCustomField(ctx context.Context, id int64, data *CustomFieldFields) (*CustomField, *Response, error)
- func (c *Client) PatchDocument(ctx context.Context, id int64, data *DocumentFields) (*Document, *Response, error)
- func (c *Client) PatchDocumentType(ctx context.Context, id int64, data *DocumentTypeFields) (*DocumentType, *Response, error)
- func (c *Client) PatchStoragePath(ctx context.Context, id int64, data *StoragePathFields) (*StoragePath, *Response, error)
- func (c *Client) PatchTag(ctx context.Context, id int64, data *TagFields) (*Tag, *Response, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) UpdateCorrespondent(ctx context.Context, id int64, data *Correspondent) (*Correspondent, *Response, error)
- func (c *Client) UpdateCustomField(ctx context.Context, id int64, data *CustomField) (*CustomField, *Response, error)
- func (c *Client) UpdateDocument(ctx context.Context, id int64, data *Document) (*Document, *Response, error)
- func (c *Client) UpdateDocumentType(ctx context.Context, id int64, data *DocumentType) (*DocumentType, *Response, error)
- func (c *Client) UpdateStoragePath(ctx context.Context, id int64, data *StoragePath) (*StoragePath, *Response, error)
- func (c *Client) UpdateTag(ctx context.Context, id int64, data *Tag) (*Tag, *Response, error)
- func (c *Client) UploadDocument(ctx context.Context, r io.Reader, opts DocumentUploadOptions) (*DocumentUpload, *Response, error)
- func (c *Client) WaitForTask(ctx context.Context, taskID string, opts WaitForTaskOptions) (*Task, error)
- type Color
- type Correspondent
- type CorrespondentFields
- func (f CorrespondentFields) AsMap() map[string]any
- func (f CorrespondentFields) MarshalJSON() ([]byte, error)
- func (f *CorrespondentFields) SetIsInsensitive(isInsensitive bool) *CorrespondentFields
- func (f *CorrespondentFields) SetMatch(match string) *CorrespondentFields
- func (f *CorrespondentFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *CorrespondentFields
- func (f *CorrespondentFields) SetName(name string) *CorrespondentFields
- func (f *CorrespondentFields) SetOwner(owner *int64) *CorrespondentFields
- func (f *CorrespondentFields) SetSetPermissions(setPermissions *ObjectPermissions) *CorrespondentFields
- type CustomField
- type CustomFieldFields
- func (f CustomFieldFields) AsMap() map[string]any
- func (f CustomFieldFields) MarshalJSON() ([]byte, error)
- func (f *CustomFieldFields) SetDataType(dataType string) *CustomFieldFields
- func (f *CustomFieldFields) SetName(name string) *CustomFieldFields
- func (f *CustomFieldFields) SetOwner(owner *int64) *CustomFieldFields
- func (f *CustomFieldFields) SetSetPermissions(setPermissions *ObjectPermissions) *CustomFieldFields
- type CustomFieldInstance
- type DateTimeFilterSpec
- type Document
- type DocumentFields
- func (f DocumentFields) AsMap() map[string]any
- func (f DocumentFields) MarshalJSON() ([]byte, error)
- func (f *DocumentFields) SetArchiveSerialNumber(archiveSerialNumber *int64) *DocumentFields
- func (f *DocumentFields) SetContent(content string) *DocumentFields
- func (f *DocumentFields) SetCorrespondent(correspondent *int64) *DocumentFields
- func (f *DocumentFields) SetCreated(created time.Time) *DocumentFields
- func (f *DocumentFields) SetCustomFields(customFields []CustomFieldInstance) *DocumentFields
- func (f *DocumentFields) SetDocumentType(documentType *int64) *DocumentFields
- func (f *DocumentFields) SetOwner(owner *int64) *DocumentFields
- func (f *DocumentFields) SetSetPermissions(setPermissions *ObjectPermissions) *DocumentFields
- func (f *DocumentFields) SetStoragePath(storagePath *int64) *DocumentFields
- func (f *DocumentFields) SetTags(tags []int64) *DocumentFields
- func (f *DocumentFields) SetTitle(title string) *DocumentFields
- type DocumentMetadata
- type DocumentType
- type DocumentTypeFields
- func (f DocumentTypeFields) AsMap() map[string]any
- func (f DocumentTypeFields) MarshalJSON() ([]byte, error)
- func (f *DocumentTypeFields) SetIsInsensitive(isInsensitive bool) *DocumentTypeFields
- func (f *DocumentTypeFields) SetMatch(match string) *DocumentTypeFields
- func (f *DocumentTypeFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *DocumentTypeFields
- func (f *DocumentTypeFields) SetName(name string) *DocumentTypeFields
- func (f *DocumentTypeFields) SetOwner(owner *int64) *DocumentTypeFields
- func (f *DocumentTypeFields) SetSetPermissions(setPermissions *ObjectPermissions) *DocumentTypeFields
- type DocumentUpload
- type DocumentUploadOptions
- type DocumentVersionMetadata
- type DownloadResult
- type Flags
- type ForeignKeyFilterSpec
- type GCPServiceAccountKeyAuth
- type Group
- type GroupFields
- type IntFilterSpec
- type ListCorrespondentsOptions
- type ListCustomFieldsOptions
- type ListDocumentTypesOptions
- type ListDocumentsOptions
- type ListGroupsOptions
- type ListOptions
- type ListStoragePathsOptions
- type ListTagsOptions
- type ListUsersOptions
- type LogEntry
- type Logger
- type MatchingAlgorithm
- type ObjectPermissionPrincipals
- type ObjectPermissions
- type Options
- type OrderingSpec
- type PageToken
- type RequestError
- type Response
- type StoragePath
- type StoragePathFields
- func (f StoragePathFields) AsMap() map[string]any
- func (f StoragePathFields) MarshalJSON() ([]byte, error)
- func (f *StoragePathFields) SetIsInsensitive(isInsensitive bool) *StoragePathFields
- func (f *StoragePathFields) SetMatch(match string) *StoragePathFields
- func (f *StoragePathFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *StoragePathFields
- func (f *StoragePathFields) SetName(name string) *StoragePathFields
- func (f *StoragePathFields) SetOwner(owner *int64) *StoragePathFields
- func (f *StoragePathFields) SetSetPermissions(setPermissions *ObjectPermissions) *StoragePathFields
- type Tag
- type TagFields
- func (f TagFields) AsMap() map[string]any
- func (f TagFields) MarshalJSON() ([]byte, error)
- func (f *TagFields) SetColor(color Color) *TagFields
- func (f *TagFields) SetIsInboxTag(isInboxTag bool) *TagFields
- func (f *TagFields) SetIsInsensitive(isInsensitive bool) *TagFields
- func (f *TagFields) SetMatch(match string) *TagFields
- func (f *TagFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *TagFields
- func (f *TagFields) SetName(name string) *TagFields
- func (f *TagFields) SetOwner(owner *int64) *TagFields
- func (f *TagFields) SetSetPermissions(setPermissions *ObjectPermissions) *TagFields
- func (f *TagFields) SetTextColor(textColor Color) *TagFields
- type Task
- type TaskError
- type TaskStatus
- type TokenAuth
- type User
- type UserFields
- func (f UserFields) AsMap() map[string]any
- func (f UserFields) MarshalJSON() ([]byte, error)
- func (f *UserFields) SetEmail(email string) *UserFields
- func (f *UserFields) SetFirstName(firstName string) *UserFields
- func (f *UserFields) SetIsActive(isActive bool) *UserFields
- func (f *UserFields) SetIsStaff(isStaff bool) *UserFields
- func (f *UserFields) SetIsSuperuser(isSuperuser bool) *UserFields
- func (f *UserFields) SetLastName(lastName string) *UserFields
- func (f *UserFields) SetUsername(username string) *UserFields
- type UsernamePasswordAuth
- type WaitForTaskConditionFunc
- type WaitForTaskOptions
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultWaitForTaskCondition ¶
DefaultWaitForTaskCondition waits for a terminal status (success, failure or revoked).
Types ¶
type AuthMechanism ¶
type AuthMechanism interface {
// contains filtered or unexported methods
}
type CharFilterSpec ¶
type CharFilterSpec struct { EqualsIgnoringCase *string StartsWithIgnoringCase *string EndsWithIgnoringCase *string ContainsIgnoringCase *string }
CharFilterSpec contains filters available on character/string fields. All comparison are case-insensitive.
func (CharFilterSpec) EncodeValues ¶
func (s CharFilterSpec) EncodeValues(key string, v *url.Values) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateCorrespondent ¶
func (c *Client) CreateCorrespondent(ctx context.Context, data *CorrespondentFields) (*Correspondent, *Response, error)
func (*Client) CreateCustomField ¶ added in v0.0.5
func (c *Client) CreateCustomField(ctx context.Context, data *CustomFieldFields) (*CustomField, *Response, error)
func (*Client) CreateDocumentType ¶
func (c *Client) CreateDocumentType(ctx context.Context, data *DocumentTypeFields) (*DocumentType, *Response, error)
func (*Client) CreateStoragePath ¶
func (c *Client) CreateStoragePath(ctx context.Context, data *StoragePathFields) (*StoragePath, *Response, error)
func (*Client) DeleteCorrespondent ¶
func (*Client) DeleteCustomField ¶ added in v0.0.5
func (*Client) DeleteDocument ¶
func (*Client) DeleteDocumentType ¶
func (*Client) DeleteStoragePath ¶
func (*Client) DownloadDocumentArchived ¶
func (c *Client) DownloadDocumentArchived(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
DownloadDocumentArchived retrieves an archived PDF/A file generated from the originally consumed file. The archived version may not be available and the API may return the original. [DownloadDocumentOriginal] for additional details.
func (*Client) DownloadDocumentOriginal ¶
func (c *Client) DownloadDocumentOriginal(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
DownloadDocumentOriginal retrieves the document in the format originally consumed by Paperless. The file format can be determined using [DownloadResult.ContentType].
The content of the document is written to the given writer. To verify that the document is complete (the HTTP request may have been terminated early) the size and/or checksum can be verified with [GetDocumentMetadata].
func (*Client) DownloadDocumentThumbnail ¶
func (c *Client) DownloadDocumentThumbnail(ctx context.Context, w io.Writer, id int64) (*DownloadResult, *Response, error)
DownloadDocumentThumbnail retrieves a preview image of the document. See [DownloadDocumentOriginal] for additional details.
func (*Client) GetCorrespondent ¶
func (*Client) GetCurrentUser ¶ added in v0.0.6
GetCurrentUser looks up the authenticated user.
func (*Client) GetCustomField ¶ added in v0.0.5
func (*Client) GetDocument ¶
func (*Client) GetDocumentMetadata ¶
func (*Client) GetDocumentType ¶
func (*Client) GetStoragePath ¶
func (*Client) ListAllCorrespondents ¶ added in v0.0.3
func (c *Client) ListAllCorrespondents(ctx context.Context, opts ListCorrespondentsOptions, handler func(context.Context, Correspondent) error) error
ListAllCorrespondents iterates over all correspondents matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllCustomFields ¶ added in v0.0.5
func (c *Client) ListAllCustomFields(ctx context.Context, opts ListCustomFieldsOptions, handler func(context.Context, CustomField) error) error
ListAllCustomFields iterates over all custom fields matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllDocumentTypes ¶ added in v0.0.3
func (c *Client) ListAllDocumentTypes(ctx context.Context, opts ListDocumentTypesOptions, handler func(context.Context, DocumentType) error) error
ListAllDocumentTypes iterates over all document types matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllDocuments ¶ added in v0.0.3
func (c *Client) ListAllDocuments(ctx context.Context, opts ListDocumentsOptions, handler func(context.Context, Document) error) error
ListAllDocuments iterates over all documents matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllGroups ¶ added in v0.0.6
func (c *Client) ListAllGroups(ctx context.Context, opts ListGroupsOptions, handler func(context.Context, Group) error) error
ListAllGroups iterates over all groups matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllStoragePaths ¶ added in v0.0.3
func (c *Client) ListAllStoragePaths(ctx context.Context, opts ListStoragePathsOptions, handler func(context.Context, StoragePath) error) error
ListAllStoragePaths iterates over all storage paths matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllTags ¶ added in v0.0.3
func (c *Client) ListAllTags(ctx context.Context, opts ListTagsOptions, handler func(context.Context, Tag) error) error
ListAllTags iterates over all tags matching the filters specified in opts, invoking handler for each.
func (*Client) ListAllUsers ¶ added in v0.0.6
func (c *Client) ListAllUsers(ctx context.Context, opts ListUsersOptions, handler func(context.Context, User) error) error
ListAllUsers iterates over all users matching the filters specified in opts, invoking handler for each.
func (*Client) ListCorrespondents ¶
func (c *Client) ListCorrespondents(ctx context.Context, opts ListCorrespondentsOptions) ([]Correspondent, *Response, error)
func (*Client) ListCustomFields ¶ added in v0.0.5
func (c *Client) ListCustomFields(ctx context.Context, opts ListCustomFieldsOptions) ([]CustomField, *Response, error)
func (*Client) ListDocumentTypes ¶
func (c *Client) ListDocumentTypes(ctx context.Context, opts ListDocumentTypesOptions) ([]DocumentType, *Response, error)
func (*Client) ListDocuments ¶
func (*Client) ListGroups ¶ added in v0.0.6
func (*Client) ListStoragePaths ¶
func (c *Client) ListStoragePaths(ctx context.Context, opts ListStoragePathsOptions) ([]StoragePath, *Response, error)
func (*Client) PatchCorrespondent ¶ added in v0.0.5
func (c *Client) PatchCorrespondent(ctx context.Context, id int64, data *CorrespondentFields) (*Correspondent, *Response, error)
func (*Client) PatchCustomField ¶ added in v0.0.5
func (c *Client) PatchCustomField(ctx context.Context, id int64, data *CustomFieldFields) (*CustomField, *Response, error)
func (*Client) PatchDocument ¶ added in v0.0.6
func (*Client) PatchDocumentType ¶ added in v0.0.5
func (c *Client) PatchDocumentType(ctx context.Context, id int64, data *DocumentTypeFields) (*DocumentType, *Response, error)
func (*Client) PatchStoragePath ¶ added in v0.0.5
func (c *Client) PatchStoragePath(ctx context.Context, id int64, data *StoragePathFields) (*StoragePath, *Response, error)
func (*Client) UpdateCorrespondent ¶
func (c *Client) UpdateCorrespondent(ctx context.Context, id int64, data *Correspondent) (*Correspondent, *Response, error)
func (*Client) UpdateCustomField ¶ added in v0.0.5
func (c *Client) UpdateCustomField(ctx context.Context, id int64, data *CustomField) (*CustomField, *Response, error)
func (*Client) UpdateDocument ¶
func (*Client) UpdateDocumentType ¶
func (c *Client) UpdateDocumentType(ctx context.Context, id int64, data *DocumentType) (*DocumentType, *Response, error)
func (*Client) UpdateStoragePath ¶
func (c *Client) UpdateStoragePath(ctx context.Context, id int64, data *StoragePath) (*StoragePath, *Response, error)
func (*Client) UploadDocument ¶
func (c *Client) UploadDocument(ctx context.Context, r io.Reader, opts DocumentUploadOptions) (*DocumentUpload, *Response, error)
Upload a file. Returns immediately and without error if the document consumption process was started successfully. No additional status information about the consumption process is available immediately. Poll the returned task ID to wait for the consumption.
func (*Client) WaitForTask ¶
func (c *Client) WaitForTask(ctx context.Context, taskID string, opts WaitForTaskOptions) (*Task, error)
WaitForTask polls the status of a task until it reaches a terminal status (success, failure or revoked). Task failures are reported as an error of type TaskError.
type Color ¶
type Color struct {
R, G, B uint8
}
func NewColor ¶
NewColor converts any color implementing the color.Color interface.
func (Color) MarshalJSON ¶
func (*Color) UnmarshalJSON ¶
type Correspondent ¶
type Correspondent struct { ID int64 `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Match string `json:"match"` MatchingAlgorithm MatchingAlgorithm `json:"matching_algorithm"` IsInsensitive bool `json:"is_insensitive"` DocumentCount int64 `json:"document_count"` LastCorrespondence *time.Time `json:"last_correspondence"` // Object owner; objects without owner can be viewed and edited by all users. Owner *int64 `json:"owner"` }
type CorrespondentFields ¶ added in v0.0.5
type CorrespondentFields struct {
// contains filtered or unexported fields
}
func NewCorrespondentFields ¶ added in v0.0.5
func NewCorrespondentFields() *CorrespondentFields
func (CorrespondentFields) AsMap ¶ added in v0.0.6
AsMap returns a map from object field name to value.
func (CorrespondentFields) MarshalJSON ¶ added in v0.0.5
func (*CorrespondentFields) SetIsInsensitive ¶ added in v0.0.6
func (f *CorrespondentFields) SetIsInsensitive(isInsensitive bool) *CorrespondentFields
SetIsInsensitive sets the "is_insensitive" field.
func (*CorrespondentFields) SetMatch ¶ added in v0.0.6
func (f *CorrespondentFields) SetMatch(match string) *CorrespondentFields
SetMatch sets the "match" field.
func (*CorrespondentFields) SetMatchingAlgorithm ¶ added in v0.0.6
func (f *CorrespondentFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *CorrespondentFields
SetMatchingAlgorithm sets the "matching_algorithm" field.
func (*CorrespondentFields) SetName ¶ added in v0.0.6
func (f *CorrespondentFields) SetName(name string) *CorrespondentFields
SetName sets the "name" field.
func (*CorrespondentFields) SetOwner ¶ added in v0.0.6
func (f *CorrespondentFields) SetOwner(owner *int64) *CorrespondentFields
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*CorrespondentFields) SetSetPermissions ¶ added in v0.0.6
func (f *CorrespondentFields) SetSetPermissions(setPermissions *ObjectPermissions) *CorrespondentFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
type CustomField ¶ added in v0.0.5
type CustomFieldFields ¶ added in v0.0.5
type CustomFieldFields struct {
// contains filtered or unexported fields
}
func NewCustomFieldFields ¶ added in v0.0.5
func NewCustomFieldFields() *CustomFieldFields
func (CustomFieldFields) AsMap ¶ added in v0.0.6
AsMap returns a map from object field name to value.
func (CustomFieldFields) MarshalJSON ¶ added in v0.0.5
func (*CustomFieldFields) SetDataType ¶ added in v0.0.6
func (f *CustomFieldFields) SetDataType(dataType string) *CustomFieldFields
SetDataType sets the "data_type" field.
func (*CustomFieldFields) SetName ¶ added in v0.0.6
func (f *CustomFieldFields) SetName(name string) *CustomFieldFields
SetName sets the "name" field.
func (*CustomFieldFields) SetOwner ¶ added in v0.0.6
func (f *CustomFieldFields) SetOwner(owner *int64) *CustomFieldFields
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*CustomFieldFields) SetSetPermissions ¶ added in v0.0.6
func (f *CustomFieldFields) SetSetPermissions(setPermissions *ObjectPermissions) *CustomFieldFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
type CustomFieldInstance ¶ added in v0.0.5
type DateTimeFilterSpec ¶
type DateTimeFilterSpec struct { // Set to a non-nil value to only include newer items. Gt *time.Time // Set to a non-nil value to only include older items. Lt *time.Time }
func (DateTimeFilterSpec) EncodeValues ¶
func (s DateTimeFilterSpec) EncodeValues(key string, v *url.Values) error
type Document ¶
type Document struct { // ID of the document. ID int64 `json:"id"` // Title of the document. Title string `json:"title"` // Plain-text content of the document. Content string `json:"content"` // List of tag IDs assigned to this document, or empty list. Tags []int64 `json:"tags"` // Document type of this document or nil. DocumentType *int64 `json:"document_type"` // Correspondent of this document or nil. Correspondent *int64 `json:"correspondent"` // Storage path of this document or nil. StoragePath *int64 `json:"storage_path"` // The date time at which this document was created. Created time.Time `json:"created"` // The date at which this document was last edited in paperless. Modified time.Time `json:"modified"` // The date at which this document was added to paperless. Added time.Time `json:"added"` // The identifier of this document in a physical document archive. ArchiveSerialNumber *int64 `json:"archive_serial_number"` // Verbose filename of the original document. OriginalFileName string `json:"original_file_name"` // Verbose filename of the archived document. Nil if no archived document is available. ArchivedFileName *string `json:"archived_file_name"` // Custom fields on the document. CustomFields []CustomFieldInstance `json:"custom_fields"` // Object owner; objects without owner can be viewed and edited by all users. Owner *int64 `json:"owner"` }
type DocumentFields ¶ added in v0.0.6
type DocumentFields struct {
// contains filtered or unexported fields
}
func NewDocumentFields ¶ added in v0.0.6
func NewDocumentFields() *DocumentFields
func (DocumentFields) MarshalJSON ¶ added in v0.0.6
func (*DocumentFields) SetArchiveSerialNumber ¶ added in v0.0.6
func (f *DocumentFields) SetArchiveSerialNumber(archiveSerialNumber *int64) *DocumentFields
SetArchiveSerialNumber sets the "archive_serial_number" field.
The identifier of this document in a physical document archive.
func (*DocumentFields) SetContent ¶ added in v0.0.6
func (f *DocumentFields) SetContent(content string) *DocumentFields
SetContent sets the "content" field.
Plain-text content of the document.
func (*DocumentFields) SetCorrespondent ¶ added in v0.0.6
func (f *DocumentFields) SetCorrespondent(correspondent *int64) *DocumentFields
SetCorrespondent sets the "correspondent" field.
Correspondent of this document or nil.
func (*DocumentFields) SetCreated ¶ added in v0.0.6
func (f *DocumentFields) SetCreated(created time.Time) *DocumentFields
SetCreated sets the "created" field.
The date time at which this document was created.
func (*DocumentFields) SetCustomFields ¶ added in v0.0.6
func (f *DocumentFields) SetCustomFields(customFields []CustomFieldInstance) *DocumentFields
SetCustomFields sets the "custom_fields" field.
Custom fields on the document.
func (*DocumentFields) SetDocumentType ¶ added in v0.0.6
func (f *DocumentFields) SetDocumentType(documentType *int64) *DocumentFields
SetDocumentType sets the "document_type" field.
Document type of this document or nil.
func (*DocumentFields) SetOwner ¶ added in v0.0.6
func (f *DocumentFields) SetOwner(owner *int64) *DocumentFields
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*DocumentFields) SetSetPermissions ¶ added in v0.0.6
func (f *DocumentFields) SetSetPermissions(setPermissions *ObjectPermissions) *DocumentFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
func (*DocumentFields) SetStoragePath ¶ added in v0.0.6
func (f *DocumentFields) SetStoragePath(storagePath *int64) *DocumentFields
SetStoragePath sets the "storage_path" field.
Storage path of this document or nil.
func (*DocumentFields) SetTags ¶ added in v0.0.6
func (f *DocumentFields) SetTags(tags []int64) *DocumentFields
SetTags sets the "tags" field.
List of tag IDs assigned to this document, or empty list.
func (*DocumentFields) SetTitle ¶ added in v0.0.6
func (f *DocumentFields) SetTitle(title string) *DocumentFields
SetTitle sets the "title" field.
Title of the document.
type DocumentMetadata ¶
type DocumentMetadata struct { OriginalFilename string `json:"original_filename"` OriginalMediaFilename string `json:"media_filename"` OriginalChecksum string `json:"original_checksum"` OriginalSize int64 `json:"original_size"` OriginalMimeType string `json:"original_mime_type"` OriginalMetadata []DocumentVersionMetadata `json:"original_metadata"` HasArchiveVersion bool `json:"has_archive_version"` ArchiveMediaFilename string `json:"archive_media_filename"` ArchiveChecksum string `json:"archive_checksum"` ArchiveSize int64 `json:"archive_size"` ArchiveMetadata []DocumentVersionMetadata `json:"archive_metadata"` Language string `json:"lang"` }
type DocumentType ¶
type DocumentType struct { ID int64 `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Match string `json:"match"` MatchingAlgorithm MatchingAlgorithm `json:"matching_algorithm"` IsInsensitive bool `json:"is_insensitive"` DocumentCount int64 `json:"document_count"` // Object owner; objects without owner can be viewed and edited by all users. Owner *int64 `json:"owner"` }
type DocumentTypeFields ¶ added in v0.0.5
type DocumentTypeFields struct {
// contains filtered or unexported fields
}
func NewDocumentTypeFields ¶ added in v0.0.5
func NewDocumentTypeFields() *DocumentTypeFields
func (DocumentTypeFields) AsMap ¶ added in v0.0.6
AsMap returns a map from object field name to value.
func (DocumentTypeFields) MarshalJSON ¶ added in v0.0.5
func (*DocumentTypeFields) SetIsInsensitive ¶ added in v0.0.6
func (f *DocumentTypeFields) SetIsInsensitive(isInsensitive bool) *DocumentTypeFields
SetIsInsensitive sets the "is_insensitive" field.
func (*DocumentTypeFields) SetMatch ¶ added in v0.0.6
func (f *DocumentTypeFields) SetMatch(match string) *DocumentTypeFields
SetMatch sets the "match" field.
func (*DocumentTypeFields) SetMatchingAlgorithm ¶ added in v0.0.6
func (f *DocumentTypeFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *DocumentTypeFields
SetMatchingAlgorithm sets the "matching_algorithm" field.
func (*DocumentTypeFields) SetName ¶ added in v0.0.6
func (f *DocumentTypeFields) SetName(name string) *DocumentTypeFields
SetName sets the "name" field.
func (*DocumentTypeFields) SetOwner ¶ added in v0.0.6
func (f *DocumentTypeFields) SetOwner(owner *int64) *DocumentTypeFields
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*DocumentTypeFields) SetSetPermissions ¶ added in v0.0.6
func (f *DocumentTypeFields) SetSetPermissions(setPermissions *ObjectPermissions) *DocumentTypeFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
type DocumentUpload ¶
type DocumentUpload struct {
TaskID string
}
type DocumentUploadOptions ¶
type DocumentUploadOptions struct { Filename string `url:"-"` // Title for the document. Title string `url:"title,omitempty"` // Datetime at which the document was created. Created time.Time `url:"created,omitempty"` // ID of a correspondent for the document. Correspondent *int64 `url:"correspondent,omitempty"` // ID of a document type for the document. DocumentType *int64 `url:"document_type,omitempty"` // ID of a storage path for the document. StoragePath *int64 `url:"storage_path,omitempty"` // Tag IDs for the document. Tags []int64 `url:"tags,omitempty"` // Archive serial number to set on the document. ArchiveSerialNumber *int64 `url:"archive_serial_number,omitempty"` }
type DocumentVersionMetadata ¶
type DownloadResult ¶
type DownloadResult struct { // MIME content type (e.g. "application/pdf"). ContentType string // Parameters for body content type (e.g. "charset"). ContentTypeParams map[string]string // The preferred filename as reported by the server (if any). Filename string // Length of the downloaded body in bytes. Length int64 }
type Flags ¶
type Flags struct { // Whether to enable verbose log messages. DebugMode bool // HTTP(S) URL for Paperless. BaseURL string // Number of concurrent requests allowed to be in flight. MaxConcurrentRequests int // Authenticate via token. AuthToken string // Read the authentication token from a file. AuthTokenFile string // Authenticate via HTTP basic authentication (username and password). AuthUsername string AuthPassword string // Read the password from a file. AuthPasswordFile string // Authenticate using OpenID Connect (OIDC) ID tokens derived from a Google // Cloud Platform service account key file. AuthGCPServiceAccountKeyFile string // Target audience for OpenID Connect (OIDC) ID tokens. May be left empty, // in which case the Paperless URL is used verbatim. AuthOIDCIDTokenAudience string // HTTP headers to set on all requests. Header http.Header // Timezone for parsing timestamps without offset. ServerTimezone string }
Flags contains attributes to construct a Paperless client instance. The separate "kpflag" package implements bindings for github.com/alecthomas/kingpin/v2.
func (*Flags) BuildOptions ¶
BuildOptions returns the client options derived from flags.
type ForeignKeyFilterSpec ¶
type ForeignKeyFilterSpec struct { IsNull *bool ID *int64 Name CharFilterSpec }
func (ForeignKeyFilterSpec) EncodeValues ¶
func (s ForeignKeyFilterSpec) EncodeValues(key string, v *url.Values) error
type GCPServiceAccountKeyAuth ¶ added in v0.0.9
type GCPServiceAccountKeyAuth struct { // Path to a file containing the service account key. KeyFile string // Service account key in JSON format. Key []byte // Audience to request for the ID token (case-sensitive). If empty the // Paperless URL is used verbatim. Audience string // Custom HTTP client for requesting tokens. HTTPClient *http.Client }
GCPServiceAccountKeyAuth uses a Google Cloud Platform service account key file to authenticate against an OAuth 2.0-protected Paperless instance using the two-legged JWT flow.
The service account key is used to request OpenID Connect (OIDC) ID tokens from the Google OAuth 2.0 API. The ID tokens are in turn used for all Paperless API requests.
References:
- https://cloud.google.com/iam/docs/service-account-creds
- https://openid.net/specs/openid-connect-core-1_0.html
func (GCPServiceAccountKeyAuth) Build ¶ added in v0.0.9
func (a GCPServiceAccountKeyAuth) Build() (AuthMechanism, error)
type GroupFields ¶ added in v0.0.6
type GroupFields struct {
// contains filtered or unexported fields
}
func NewGroupFields ¶ added in v0.0.6
func NewGroupFields() *GroupFields
func (GroupFields) MarshalJSON ¶ added in v0.0.6
func (*GroupFields) SetName ¶ added in v0.0.6
func (f *GroupFields) SetName(name string) *GroupFields
SetName sets the "name" field.
type IntFilterSpec ¶
IntFilterSpec contains filters available on numeric fields.
func (IntFilterSpec) EncodeValues ¶
func (s IntFilterSpec) EncodeValues(key string, v *url.Values) error
type ListCorrespondentsOptions ¶
type ListCorrespondentsOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Owner IntFilterSpec `url:"owner"` Name CharFilterSpec `url:"name"` }
type ListCustomFieldsOptions ¶ added in v0.0.5
type ListCustomFieldsOptions struct {
ListOptions
}
type ListDocumentTypesOptions ¶
type ListDocumentTypesOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Owner IntFilterSpec `url:"owner"` Name CharFilterSpec `url:"name"` }
type ListDocumentsOptions ¶
type ListDocumentsOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Owner IntFilterSpec `url:"owner"` Title CharFilterSpec `url:"title"` Content CharFilterSpec `url:"content"` ArchiveSerialNumber IntFilterSpec `url:"archive_serial_number"` Created DateTimeFilterSpec `url:"created"` Added DateTimeFilterSpec `url:"added"` Modified DateTimeFilterSpec `url:"modified"` Correspondent ForeignKeyFilterSpec `url:"correspondent"` Tags ForeignKeyFilterSpec `url:"tags"` DocumentType ForeignKeyFilterSpec `url:"document_type"` StoragePath ForeignKeyFilterSpec `url:"storage_path"` }
type ListGroupsOptions ¶ added in v0.0.6
type ListGroupsOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Name CharFilterSpec `url:"name"` }
type ListOptions ¶
type ListOptions struct {
Page *PageToken
}
type ListStoragePathsOptions ¶
type ListStoragePathsOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Owner IntFilterSpec `url:"owner"` Name CharFilterSpec `url:"name"` Path CharFilterSpec `url:"path"` }
type ListTagsOptions ¶
type ListTagsOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Owner IntFilterSpec `url:"owner"` Name CharFilterSpec `url:"name"` }
type ListUsersOptions ¶ added in v0.0.6
type ListUsersOptions struct { ListOptions Ordering OrderingSpec `url:"ordering"` Username CharFilterSpec `url:"username"` }
type MatchingAlgorithm ¶
type MatchingAlgorithm int
const ( // None. MatchNone MatchingAlgorithm = iota // Any word. MatchAny // All words. MatchAll // Exact match. MatchLiteral // Regular expression. MatchRegex // Fuzzy word. MatchFuzzy // Automatic using a document classification model. MatchAuto )
func (MatchingAlgorithm) String ¶
func (i MatchingAlgorithm) String() string
type ObjectPermissionPrincipals ¶ added in v0.0.6
type ObjectPermissions ¶ added in v0.0.6
type ObjectPermissions struct { View ObjectPermissionPrincipals `json:"view"` Change ObjectPermissionPrincipals `json:"change"` }
type Options ¶
type Options struct { // Paperless URL. May include a path. BaseURL string // API authentication. Auth AuthMechanism // Enable debug mode with many details logged. DebugMode bool // Logger for writing log messages. If debug mode is enabled and no logger // is configured all messages are written to standard library's default // logger (log.Default()). Logger Logger // HTTP headers to set on all requests. Header http.Header // Server's timezone for parsing timestamps without explicit offset. // Defaults to [time.Local]. ServerLocation *time.Location // Number of concurrent requests allowed to be in flight. Defaults to zero // (no limitation). MaxConcurrentRequests int // contains filtered or unexported fields }
Options for constructing a Paperless client.
type OrderingSpec ¶
type OrderingSpec struct { // Field name, e.g. "created". Field string // Set to true for descending order. Ascending is the default. Desc bool }
OrderingSpec controls the sorting order for lists.
func (OrderingSpec) EncodeValues ¶
func (o OrderingSpec) EncodeValues(key string, v *url.Values) error
type RequestError ¶
func (*RequestError) Error ¶
func (e *RequestError) Error() string
func (*RequestError) Is ¶
func (e *RequestError) Is(other error) bool
type StoragePath ¶
type StoragePath struct { ID int64 `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Match string `json:"match"` MatchingAlgorithm MatchingAlgorithm `json:"matching_algorithm"` IsInsensitive bool `json:"is_insensitive"` DocumentCount int64 `json:"document_count"` // Object owner; objects without owner can be viewed and edited by all users. Owner *int64 `json:"owner"` }
type StoragePathFields ¶ added in v0.0.5
type StoragePathFields struct {
// contains filtered or unexported fields
}
func NewStoragePathFields ¶ added in v0.0.5
func NewStoragePathFields() *StoragePathFields
func (StoragePathFields) AsMap ¶ added in v0.0.6
AsMap returns a map from object field name to value.
func (StoragePathFields) MarshalJSON ¶ added in v0.0.5
func (*StoragePathFields) SetIsInsensitive ¶ added in v0.0.6
func (f *StoragePathFields) SetIsInsensitive(isInsensitive bool) *StoragePathFields
SetIsInsensitive sets the "is_insensitive" field.
func (*StoragePathFields) SetMatch ¶ added in v0.0.6
func (f *StoragePathFields) SetMatch(match string) *StoragePathFields
SetMatch sets the "match" field.
func (*StoragePathFields) SetMatchingAlgorithm ¶ added in v0.0.6
func (f *StoragePathFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *StoragePathFields
SetMatchingAlgorithm sets the "matching_algorithm" field.
func (*StoragePathFields) SetName ¶ added in v0.0.6
func (f *StoragePathFields) SetName(name string) *StoragePathFields
SetName sets the "name" field.
func (*StoragePathFields) SetOwner ¶ added in v0.0.6
func (f *StoragePathFields) SetOwner(owner *int64) *StoragePathFields
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*StoragePathFields) SetSetPermissions ¶ added in v0.0.6
func (f *StoragePathFields) SetSetPermissions(setPermissions *ObjectPermissions) *StoragePathFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
type Tag ¶
type Tag struct { ID int64 `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Color Color `json:"color"` TextColor Color `json:"text_color"` Match string `json:"match"` MatchingAlgorithm MatchingAlgorithm `json:"matching_algorithm"` IsInsensitive bool `json:"is_insensitive"` IsInboxTag bool `json:"is_inbox_tag"` DocumentCount int64 `json:"document_count"` // Object owner; objects without owner can be viewed and edited by all users. Owner *int64 `json:"owner"` }
type TagFields ¶ added in v0.0.5
type TagFields struct {
// contains filtered or unexported fields
}
func NewTagFields ¶ added in v0.0.5
func NewTagFields() *TagFields
func (TagFields) MarshalJSON ¶ added in v0.0.5
func (*TagFields) SetIsInboxTag ¶ added in v0.0.6
SetIsInboxTag sets the "is_inbox_tag" field.
func (*TagFields) SetIsInsensitive ¶ added in v0.0.6
SetIsInsensitive sets the "is_insensitive" field.
func (*TagFields) SetMatchingAlgorithm ¶ added in v0.0.6
func (f *TagFields) SetMatchingAlgorithm(matchingAlgorithm MatchingAlgorithm) *TagFields
SetMatchingAlgorithm sets the "matching_algorithm" field.
func (*TagFields) SetOwner ¶ added in v0.0.6
SetOwner sets the "owner" field.
Object owner; objects without owner can be viewed and edited by all users.
func (*TagFields) SetSetPermissions ¶ added in v0.0.6
func (f *TagFields) SetSetPermissions(setPermissions *ObjectPermissions) *TagFields
SetSetPermissions sets the "set_permissions" field.
Change object-level permissions.
func (*TagFields) SetTextColor ¶ added in v0.0.6
SetTextColor sets the "text_color" field.
type Task ¶
type Task struct { ID int64 `json:"id"` TaskID string `json:"task_id"` TaskFileName *string `json:"task_file_name"` Created *time.Time `json:"date_created"` Done *time.Time `json:"date_done"` Type string `json:"type"` Status TaskStatus `json:"status"` Result *string `json:"result"` Acknowledged bool `json:"acknowledged"` }
type TaskError ¶
type TaskError struct { TaskID string Status TaskStatus Message string }
type TaskStatus ¶
type TaskStatus int
const ( TaskStatusUnspecified TaskStatus = iota // Task is waiting for execution. TaskPending // Task has been started. TaskStarted // Task has been successfully executed. TaskSuccess // Task execution resulted in failure. TaskFailure // Task is being retried. TaskRetry // Task has been revoked. TaskRevoked )
Celery task states (https://docs.celeryq.dev/en/latest/userguide/tasks.html#built-in-states).
func (TaskStatus) MarshalJSON ¶
func (s TaskStatus) MarshalJSON() ([]byte, error)
func (TaskStatus) String ¶
func (i TaskStatus) String() string
func (TaskStatus) Terminal ¶
func (s TaskStatus) Terminal() bool
Terminal returns whether a task with the receiving status is finished permanently.
func (*TaskStatus) UnmarshalJSON ¶
func (s *TaskStatus) UnmarshalJSON(data []byte) error
type TokenAuth ¶
type TokenAuth struct {
Token string
}
Paperless authentication token.
Example ¶
ts := httptest.NewServer(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {})) defer ts.Close() cl := New(Options{ BaseURL: ts.URL, Auth: &TokenAuth{"mytoken1234"}, }) if err := cl.Ping(context.Background()); err != nil { fmt.Printf("Pinging server failed: %v\n", err) } else { fmt.Println("Success!") }
Output: Success!
type UserFields ¶ added in v0.0.6
type UserFields struct {
// contains filtered or unexported fields
}
func NewUserFields ¶ added in v0.0.6
func NewUserFields() *UserFields
func (UserFields) MarshalJSON ¶ added in v0.0.6
func (*UserFields) SetEmail ¶ added in v0.0.6
func (f *UserFields) SetEmail(email string) *UserFields
SetEmail sets the "email" field.
func (*UserFields) SetFirstName ¶ added in v0.0.6
func (f *UserFields) SetFirstName(firstName string) *UserFields
SetFirstName sets the "first_name" field.
func (*UserFields) SetIsActive ¶ added in v0.0.6
func (f *UserFields) SetIsActive(isActive bool) *UserFields
SetIsActive sets the "is_active" field.
func (*UserFields) SetIsStaff ¶ added in v0.0.6
func (f *UserFields) SetIsStaff(isStaff bool) *UserFields
SetIsStaff sets the "is_staff" field.
func (*UserFields) SetIsSuperuser ¶ added in v0.0.6
func (f *UserFields) SetIsSuperuser(isSuperuser bool) *UserFields
SetIsSuperuser sets the "is_superuser" field.
func (*UserFields) SetLastName ¶ added in v0.0.6
func (f *UserFields) SetLastName(lastName string) *UserFields
SetLastName sets the "last_name" field.
func (*UserFields) SetUsername ¶ added in v0.0.6
func (f *UserFields) SetUsername(username string) *UserFields
SetUsername sets the "username" field.
type UsernamePasswordAuth ¶
HTTP basic authentication with a username and password.
type WaitForTaskOptions ¶
type WaitForTaskOptions struct { // Condition returns nil when the task is considered finished. // [DefaultWaitForTaskCondition] is the default implementation. Condition WaitForTaskConditionFunc // Maximum amount of time to wait. Defaults to one hour. MaxElapsedTime time.Duration }
Source Files ¶
- auth.go
- client.go
- color.go
- correspondent.go
- crud.go
- customfield.go
- doc.go
- document.go
- documenttype.go
- download.go
- error.go
- fields.go
- filter.go
- flags.go
- gcpauth.go
- generate.go
- group.go
- log.go
- logger.go
- matching.go
- matching_string.go
- models_generated.go
- pagination.go
- permissions.go
- ping.go
- pointer.go
- storagepath.go
- tag.go
- task.go
- task_string.go
- taskwait.go
- user.go