Documentation ¶
Overview ¶
Package keep provides access to the Google Keep API.
For product documentation, see: https://developers.google.com/keep/api
Library status ¶
These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.
When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.
Creating a client ¶
Usage example:
import "google.golang.org/api/keep/v1" ... ctx := context.Background() keepService, err := keep.NewService(ctx)
In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options ¶
By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:
keepService, err := keep.NewService(ctx, option.WithScopes(keep.KeepReadonlyScope))
To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:
keepService, err := keep.NewService(ctx, option.WithAPIKey("AIza..."))
To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) keepService, err := keep.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See google.golang.org/api/option.ClientOption for details on options.
Index ¶
- Constants
- type Attachment
- type BatchCreatePermissionsRequest
- type BatchCreatePermissionsResponse
- type BatchDeletePermissionsRequest
- type CreatePermissionRequest
- type Empty
- type Family
- type Group
- type ListContent
- type ListItem
- type ListNotesResponse
- type MediaDownloadCall
- func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall
- func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*Attachment, error)
- func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)
- func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall
- func (c *MediaDownloadCall) Header() http.Header
- func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall
- func (c *MediaDownloadCall) MimeType(mimeType string) *MediaDownloadCall
- type MediaService
- type Note
- type NotesCreateCall
- type NotesDeleteCall
- type NotesGetCall
- func (c *NotesGetCall) Context(ctx context.Context) *NotesGetCall
- func (c *NotesGetCall) Do(opts ...googleapi.CallOption) (*Note, error)
- func (c *NotesGetCall) Fields(s ...googleapi.Field) *NotesGetCall
- func (c *NotesGetCall) Header() http.Header
- func (c *NotesGetCall) IfNoneMatch(entityTag string) *NotesGetCall
- type NotesListCall
- func (c *NotesListCall) Context(ctx context.Context) *NotesListCall
- func (c *NotesListCall) Do(opts ...googleapi.CallOption) (*ListNotesResponse, error)
- func (c *NotesListCall) Fields(s ...googleapi.Field) *NotesListCall
- func (c *NotesListCall) Filter(filter string) *NotesListCall
- func (c *NotesListCall) Header() http.Header
- func (c *NotesListCall) IfNoneMatch(entityTag string) *NotesListCall
- func (c *NotesListCall) PageSize(pageSize int64) *NotesListCall
- func (c *NotesListCall) PageToken(pageToken string) *NotesListCall
- func (c *NotesListCall) Pages(ctx context.Context, f func(*ListNotesResponse) error) error
- type NotesPermissionsBatchCreateCall
- func (c *NotesPermissionsBatchCreateCall) Context(ctx context.Context) *NotesPermissionsBatchCreateCall
- func (c *NotesPermissionsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreatePermissionsResponse, error)
- func (c *NotesPermissionsBatchCreateCall) Fields(s ...googleapi.Field) *NotesPermissionsBatchCreateCall
- func (c *NotesPermissionsBatchCreateCall) Header() http.Header
- type NotesPermissionsBatchDeleteCall
- func (c *NotesPermissionsBatchDeleteCall) Context(ctx context.Context) *NotesPermissionsBatchDeleteCall
- func (c *NotesPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *NotesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *NotesPermissionsBatchDeleteCall
- func (c *NotesPermissionsBatchDeleteCall) Header() http.Header
- type NotesPermissionsService
- func (r *NotesPermissionsService) BatchCreate(parent string, batchcreatepermissionsrequest *BatchCreatePermissionsRequest) *NotesPermissionsBatchCreateCall
- func (r *NotesPermissionsService) BatchDelete(parent string, batchdeletepermissionsrequest *BatchDeletePermissionsRequest) *NotesPermissionsBatchDeleteCall
- type NotesService
- type Permission
- type Section
- type Service
- type TextContent
- type User
Constants ¶
const ( // See, edit, create and permanently delete all your Google Keep data KeepScope = "https://www.googleapis.com/auth/keep" // View all your Google Keep data KeepReadonlyScope = "https://www.googleapis.com/auth/keep.readonly" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { // MimeType: The MIME types (IANA media types) in which the attachment is // available. MimeType []string `json:"mimeType,omitempty"` // Name: The resource name; Name string `json:"name,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "MimeType") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Attachment: An attachment to a note.
func (Attachment) MarshalJSON ¶
func (s Attachment) MarshalJSON() ([]byte, error)
type BatchCreatePermissionsRequest ¶
type BatchCreatePermissionsRequest struct { // Requests: The request message specifying the resources to create. Requests []*CreatePermissionRequest `json:"requests,omitempty"` // ForceSendFields is a list of field names (e.g. "Requests") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Requests") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
BatchCreatePermissionsRequest: The request to add one or more permissions on the note. Currently, only the `WRITER` role may be specified. If adding a permission fails, then the entire request fails and no changes are made.
func (BatchCreatePermissionsRequest) MarshalJSON ¶
func (s BatchCreatePermissionsRequest) MarshalJSON() ([]byte, error)
type BatchCreatePermissionsResponse ¶
type BatchCreatePermissionsResponse struct { // Permissions: Permissions created. Permissions []*Permission `json:"permissions,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Permissions") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Permissions") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
BatchCreatePermissionsResponse: The response for creating permissions on a note.
func (BatchCreatePermissionsResponse) MarshalJSON ¶
func (s BatchCreatePermissionsResponse) MarshalJSON() ([]byte, error)
type BatchDeletePermissionsRequest ¶
type BatchDeletePermissionsRequest struct { // Names: Required. The names of the permissions to delete. Format: // `notes/{note}/permissions/{permission}` Names []string `json:"names,omitempty"` // ForceSendFields is a list of field names (e.g. "Names") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Names") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
BatchDeletePermissionsRequest: The request to remove one or more permissions from a note. A permission with the `OWNER` role can't be removed. If removing a permission fails, then the entire request fails and no changes are made. Returns a 400 bad request error if a specified permission does not exist on the note.
func (BatchDeletePermissionsRequest) MarshalJSON ¶
func (s BatchDeletePermissionsRequest) MarshalJSON() ([]byte, error)
type CreatePermissionRequest ¶
type CreatePermissionRequest struct { // Parent: Required. The parent note where this permission will be created. // Format: `notes/{note}` Parent string `json:"parent,omitempty"` // Permission: Required. The permission to create. One of Permission.email, // User.email or Group.email must be supplied. Permission *Permission `json:"permission,omitempty"` // ForceSendFields is a list of field names (e.g. "Parent") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Parent") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
CreatePermissionRequest: The request to add a single permission on the note.
func (CreatePermissionRequest) MarshalJSON ¶
func (s CreatePermissionRequest) MarshalJSON() ([]byte, error)
type Empty ¶
type Empty struct { // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` }
Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
type Group ¶
type Group struct { // Email: The group email. Email string `json:"email,omitempty"` // ForceSendFields is a list of field names (e.g. "Email") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Email") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Group: Describes a single Group.
func (Group) MarshalJSON ¶
type ListContent ¶
type ListContent struct { // ListItems: The items in the list. The number of items must be less than // 1,000. ListItems []*ListItem `json:"listItems,omitempty"` // ForceSendFields is a list of field names (e.g. "ListItems") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ListItems") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ListContent: The list of items for a single list note.
func (ListContent) MarshalJSON ¶
func (s ListContent) MarshalJSON() ([]byte, error)
type ListItem ¶
type ListItem struct { // Checked: Whether this item has been checked off or not. Checked bool `json:"checked,omitempty"` // ChildListItems: If set, list of list items nested under this list item. Only // one level of nesting is allowed. ChildListItems []*ListItem `json:"childListItems,omitempty"` // Text: The text of this item. Length must be less than 1,000 characters. Text *TextContent `json:"text,omitempty"` // ForceSendFields is a list of field names (e.g. "Checked") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Checked") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ListItem: A single list item in a note's list.
func (ListItem) MarshalJSON ¶
type ListNotesResponse ¶
type ListNotesResponse struct { // NextPageToken: Next page's `page_token` field. NextPageToken string `json:"nextPageToken,omitempty"` // Notes: A page of notes. Notes []*Note `json:"notes,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "NextPageToken") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
ListNotesResponse: The response when listing a page of notes.
func (ListNotesResponse) MarshalJSON ¶
func (s ListNotesResponse) MarshalJSON() ([]byte, error)
type MediaDownloadCall ¶
type MediaDownloadCall struct {
// contains filtered or unexported fields
}
func (*MediaDownloadCall) Context ¶
func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall
Context sets the context to be used in this call's Do and Download methods.
func (*MediaDownloadCall) Do ¶
func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*Attachment, error)
Do executes the "keep.media.download" call. Any non-2xx status code is an error. Response headers are in either *Attachment.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*MediaDownloadCall) Download ¶
func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)
Download fetches the API endpoint's "media" value, instead of the normal API response value. If the returned error is nil, the Response is guaranteed to have a 2xx status code. Callers must close the Response.Body as usual.
func (*MediaDownloadCall) Fields ¶
func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*MediaDownloadCall) Header ¶
func (c *MediaDownloadCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*MediaDownloadCall) IfNoneMatch ¶
func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
func (*MediaDownloadCall) MimeType ¶
func (c *MediaDownloadCall) MimeType(mimeType string) *MediaDownloadCall
MimeType sets the optional parameter "mimeType": The IANA MIME type format requested. The requested MIME type must be one specified in the attachment.mime_type. Required when downloading attachment media and ignored otherwise.
type MediaService ¶
type MediaService struct {
// contains filtered or unexported fields
}
func NewMediaService ¶
func NewMediaService(s *Service) *MediaService
func (*MediaService) Download ¶
func (r *MediaService) Download(name string) *MediaDownloadCall
Download: Gets an attachment. To download attachment media via REST requires the alt=media query parameter. Returns a 400 bad request error if attachment media is not available in the requested MIME type.
- name: The name of the attachment.
type Note ¶
type Note struct { // Attachments: Output only. The attachments attached to this note. Attachments []*Attachment `json:"attachments,omitempty"` // Body: The body of the note. Body *Section `json:"body,omitempty"` // CreateTime: Output only. When this note was created. CreateTime string `json:"createTime,omitempty"` // Name: Output only. The resource name of this note. See general note on // identifiers in KeepService. Name string `json:"name,omitempty"` // Permissions: Output only. The list of permissions set on the note. Contains // at least one entry for the note owner. Permissions []*Permission `json:"permissions,omitempty"` // Title: The title of the note. Length must be less than 1,000 characters. Title string `json:"title,omitempty"` // TrashTime: Output only. When this note was trashed. If `trashed`, the note // is eventually deleted. If the note is not trashed, this field is not set // (and the trashed field is `false`). TrashTime string `json:"trashTime,omitempty"` // Trashed: Output only. `true` if this note has been trashed. If trashed, the // note is eventually deleted. Trashed bool `json:"trashed,omitempty"` // UpdateTime: Output only. When this note was last modified. UpdateTime string `json:"updateTime,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Attachments") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Attachments") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Note: A single note.
func (Note) MarshalJSON ¶
type NotesCreateCall ¶
type NotesCreateCall struct {
// contains filtered or unexported fields
}
func (*NotesCreateCall) Context ¶
func (c *NotesCreateCall) Context(ctx context.Context) *NotesCreateCall
Context sets the context to be used in this call's Do method.
func (*NotesCreateCall) Do ¶
func (c *NotesCreateCall) Do(opts ...googleapi.CallOption) (*Note, error)
Do executes the "keep.notes.create" call. Any non-2xx status code is an error. Response headers are in either *Note.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesCreateCall) Fields ¶
func (c *NotesCreateCall) Fields(s ...googleapi.Field) *NotesCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesCreateCall) Header ¶
func (c *NotesCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type NotesDeleteCall ¶
type NotesDeleteCall struct {
// contains filtered or unexported fields
}
func (*NotesDeleteCall) Context ¶
func (c *NotesDeleteCall) Context(ctx context.Context) *NotesDeleteCall
Context sets the context to be used in this call's Do method.
func (*NotesDeleteCall) Do ¶
func (c *NotesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "keep.notes.delete" call. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesDeleteCall) Fields ¶
func (c *NotesDeleteCall) Fields(s ...googleapi.Field) *NotesDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesDeleteCall) Header ¶
func (c *NotesDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type NotesGetCall ¶
type NotesGetCall struct {
// contains filtered or unexported fields
}
func (*NotesGetCall) Context ¶
func (c *NotesGetCall) Context(ctx context.Context) *NotesGetCall
Context sets the context to be used in this call's Do method.
func (*NotesGetCall) Do ¶
func (c *NotesGetCall) Do(opts ...googleapi.CallOption) (*Note, error)
Do executes the "keep.notes.get" call. Any non-2xx status code is an error. Response headers are in either *Note.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesGetCall) Fields ¶
func (c *NotesGetCall) Fields(s ...googleapi.Field) *NotesGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesGetCall) Header ¶
func (c *NotesGetCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*NotesGetCall) IfNoneMatch ¶
func (c *NotesGetCall) IfNoneMatch(entityTag string) *NotesGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
type NotesListCall ¶
type NotesListCall struct {
// contains filtered or unexported fields
}
func (*NotesListCall) Context ¶
func (c *NotesListCall) Context(ctx context.Context) *NotesListCall
Context sets the context to be used in this call's Do method.
func (*NotesListCall) Do ¶
func (c *NotesListCall) Do(opts ...googleapi.CallOption) (*ListNotesResponse, error)
Do executes the "keep.notes.list" call. Any non-2xx status code is an error. Response headers are in either *ListNotesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesListCall) Fields ¶
func (c *NotesListCall) Fields(s ...googleapi.Field) *NotesListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesListCall) Filter ¶
func (c *NotesListCall) Filter(filter string) *NotesListCall
Filter sets the optional parameter "filter": Filter for list results. If no filter is supplied, the `trashed` filter is applied by default. Valid fields to filter by are: `create_time`, `update_time`, `trash_time`, and `trashed`. Filter syntax follows the Google AIP filtering spec (https://aip.dev/160).
func (*NotesListCall) Header ¶
func (c *NotesListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (*NotesListCall) IfNoneMatch ¶
func (c *NotesListCall) IfNoneMatch(entityTag string) *NotesListCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
func (*NotesListCall) PageSize ¶
func (c *NotesListCall) PageSize(pageSize int64) *NotesListCall
PageSize sets the optional parameter "pageSize": The maximum number of results to return.
func (*NotesListCall) PageToken ¶
func (c *NotesListCall) PageToken(pageToken string) *NotesListCall
PageToken sets the optional parameter "pageToken": The previous page's `next_page_token` field.
func (*NotesListCall) Pages ¶
func (c *NotesListCall) Pages(ctx context.Context, f func(*ListNotesResponse) error) error
Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.
type NotesPermissionsBatchCreateCall ¶
type NotesPermissionsBatchCreateCall struct {
// contains filtered or unexported fields
}
func (*NotesPermissionsBatchCreateCall) Context ¶
func (c *NotesPermissionsBatchCreateCall) Context(ctx context.Context) *NotesPermissionsBatchCreateCall
Context sets the context to be used in this call's Do method.
func (*NotesPermissionsBatchCreateCall) Do ¶
func (c *NotesPermissionsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreatePermissionsResponse, error)
Do executes the "keep.notes.permissions.batchCreate" call. Any non-2xx status code is an error. Response headers are in either *BatchCreatePermissionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesPermissionsBatchCreateCall) Fields ¶
func (c *NotesPermissionsBatchCreateCall) Fields(s ...googleapi.Field) *NotesPermissionsBatchCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesPermissionsBatchCreateCall) Header ¶
func (c *NotesPermissionsBatchCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type NotesPermissionsBatchDeleteCall ¶
type NotesPermissionsBatchDeleteCall struct {
// contains filtered or unexported fields
}
func (*NotesPermissionsBatchDeleteCall) Context ¶
func (c *NotesPermissionsBatchDeleteCall) Context(ctx context.Context) *NotesPermissionsBatchDeleteCall
Context sets the context to be used in this call's Do method.
func (*NotesPermissionsBatchDeleteCall) Do ¶
func (c *NotesPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "keep.notes.permissions.batchDelete" call. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*NotesPermissionsBatchDeleteCall) Fields ¶
func (c *NotesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *NotesPermissionsBatchDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (*NotesPermissionsBatchDeleteCall) Header ¶
func (c *NotesPermissionsBatchDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type NotesPermissionsService ¶
type NotesPermissionsService struct {
// contains filtered or unexported fields
}
func NewNotesPermissionsService ¶
func NewNotesPermissionsService(s *Service) *NotesPermissionsService
func (*NotesPermissionsService) BatchCreate ¶
func (r *NotesPermissionsService) BatchCreate(parent string, batchcreatepermissionsrequest *BatchCreatePermissionsRequest) *NotesPermissionsBatchCreateCall
BatchCreate: Creates one or more permissions on the note. Only permissions with the `WRITER` role may be created. If adding any permission fails, then the entire request fails and no changes are made.
- parent: The parent resource shared by all Permissions being created. Format: `notes/{note}` If this is set, the parent field in the CreatePermission messages must either be empty or match this field.
func (*NotesPermissionsService) BatchDelete ¶
func (r *NotesPermissionsService) BatchDelete(parent string, batchdeletepermissionsrequest *BatchDeletePermissionsRequest) *NotesPermissionsBatchDeleteCall
BatchDelete: Deletes one or more permissions on the note. The specified entities will immediately lose access. A permission with the `OWNER` role can't be removed. If removing a permission fails, then the entire request fails and no changes are made. Returns a 400 bad request error if a specified permission does not exist on the note.
- parent: The parent resource shared by all permissions being deleted. Format: `notes/{note}` If this is set, the parent of all of the permissions specified in the DeletePermissionRequest messages must match this field.
type NotesService ¶
type NotesService struct { Permissions *NotesPermissionsService // contains filtered or unexported fields }
func NewNotesService ¶
func NewNotesService(s *Service) *NotesService
func (*NotesService) Create ¶
func (r *NotesService) Create(note *Note) *NotesCreateCall
Create: Creates a new note.
func (*NotesService) Delete ¶
func (r *NotesService) Delete(name string) *NotesDeleteCall
Delete: Deletes a note. Caller must have the `OWNER` role on the note to delete. Deleting a note removes the resource immediately and cannot be undone. Any collaborators will lose access to the note.
- name: Name of the note to delete.
func (*NotesService) Get ¶
func (r *NotesService) Get(name string) *NotesGetCall
Get: Gets a note.
- name: Name of the resource.
func (*NotesService) List ¶
func (r *NotesService) List() *NotesListCall
List: Lists notes. Every list call returns a page of results with `page_size` as the upper bound of returned items. A `page_size` of zero allows the server to choose the upper bound. The ListNotesResponse contains at most `page_size` entries. If there are more things left to list, it provides a `next_page_token` value. (Page tokens are opaque values.) To get the next page of results, copy the result's `next_page_token` into the next request's `page_token`. Repeat until the `next_page_token` returned with a page of results is empty. ListNotes return consistent results in the face of concurrent changes, or signals that it cannot with an ABORTED error.
type Permission ¶
type Permission struct { // Deleted: Output only. Whether this member has been deleted. If the member is // recovered, this value is set to false and the recovered member retains the // role on the note. Deleted bool `json:"deleted,omitempty"` // Email: The email associated with the member. If set on create, the `email` // field in the `User` or `Group` message must either be empty or match this // field. On read, may be unset if the member does not have an associated // email. Email string `json:"email,omitempty"` // Family: Output only. The Google Family to which this role applies. Family *Family `json:"family,omitempty"` // Group: Output only. The group to which this role applies. Group *Group `json:"group,omitempty"` // Name: Output only. The resource name. Name string `json:"name,omitempty"` // Role: The role granted by this permission. The role determines the // entity’s ability to read, write, and share notes. // // Possible values: // "ROLE_UNSPECIFIED" - An undefined role. // "OWNER" - A role granting full access. This role cannot be added or // removed. Defined by the creator of the note. // "WRITER" - A role granting the ability to contribute content and modify // note permissions. Role string `json:"role,omitempty"` // User: Output only. The user to whom this role applies. User *User `json:"user,omitempty"` // ForceSendFields is a list of field names (e.g. "Deleted") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Deleted") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Permission: A single permission on the note. Associates a `member` with a `role`.
func (Permission) MarshalJSON ¶
func (s Permission) MarshalJSON() ([]byte, error)
type Section ¶
type Section struct { // List: Used if this section's content is a list. List *ListContent `json:"list,omitempty"` // Text: Used if this section's content is a block of text. The length of the // text content must be less than 20,000 characters. Text *TextContent `json:"text,omitempty"` // ForceSendFields is a list of field names (e.g. "List") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "List") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
Section: The content of the note.
func (Section) MarshalJSON ¶
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Media *MediaService Notes *NotesService // contains filtered or unexported fields }
func New
deprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService ¶
NewService creates a new Service.
type TextContent ¶
type TextContent struct { // Text: The text of the note. The limits on this vary with the specific field // using this type. Text string `json:"text,omitempty"` // ForceSendFields is a list of field names (e.g. "Text") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Text") to include in API requests // with the JSON null value. By default, fields with empty values are omitted // from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
TextContent: The block of text for a single text section or list item.
func (TextContent) MarshalJSON ¶
func (s TextContent) MarshalJSON() ([]byte, error)
type User ¶
type User struct { // Email: The user's email. Email string `json:"email,omitempty"` // ForceSendFields is a list of field names (e.g. "Email") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Email") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
User: Describes a single user.