keep

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Overview

Package keep provides access to the Google Keep API.

For product documentation, see: https://developers.google.com/keep/api

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 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 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 option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
keepService, err := keep.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Constants

View Source
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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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); } The JSON representation for `Empty` is empty JSON object `{}`.

type Family

type Family struct {
}

Family: Describes a single Google Family.

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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Group: Describes a single Group.

func (*Group) MarshalJSON

func (s *Group) MarshalJSON() ([]byte, error)

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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListItem: A single list item in a note's list.

func (*ListItem) MarshalJSON

func (s *ListItem) MarshalJSON() ([]byte, error)

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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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

Context sets the context to be used in this call's Do and Download methods. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaDownloadCall) Do

Do executes the "keep.media.download" call. Exactly one of *Attachment or error will be non-nil. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaDownloadCall) Header

func (c *MediaDownloadCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaDownloadCall) IfNoneMatch

func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall

IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Note: A single note.

func (*Note) MarshalJSON

func (s *Note) MarshalJSON() ([]byte, error)

type NotesCreateCall

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

func (*NotesCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesCreateCall) Do

func (c *NotesCreateCall) Do(opts ...googleapi.CallOption) (*Note, error)

Do executes the "keep.notes.create" call. Exactly one of *Note or error will be non-nil. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*NotesCreateCall) Header

func (c *NotesCreateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type NotesDeleteCall

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

func (*NotesDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesDeleteCall) Do

func (c *NotesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)

Do executes the "keep.notes.delete" call. Exactly one of *Empty or error will be non-nil. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*NotesDeleteCall) Header

func (c *NotesDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP 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. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesGetCall) Do

func (c *NotesGetCall) Do(opts ...googleapi.CallOption) (*Note, error)

Do executes the "keep.notes.get" call. Exactly one of *Note or error will be non-nil. 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 information.

func (*NotesGetCall) Header

func (c *NotesGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*NotesGetCall) IfNoneMatch

func (c *NotesGetCall) IfNoneMatch(entityTag string) *NotesGetCall

IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

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. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesListCall) Do

Do executes the "keep.notes.list" call. Exactly one of *ListNotesResponse or error will be non-nil. 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 information.

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 an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*NotesListCall) IfNoneMatch

func (c *NotesListCall) IfNoneMatch(entityTag string) *NotesListCall

IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

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

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesPermissionsBatchCreateCall) Do

Do executes the "keep.notes.permissions.batchCreate" call. Exactly one of *BatchCreatePermissionsResponse or error will be non-nil. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*NotesPermissionsBatchCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type NotesPermissionsBatchDeleteCall

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

func (*NotesPermissionsBatchDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*NotesPermissionsBatchDeleteCall) Do

Do executes the "keep.notes.permissions.batchDelete" call. Exactly one of *Empty or error will be non-nil. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*NotesPermissionsBatchDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP 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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Section: The content of the note.

func (*Section) MarshalJSON

func (s *Section) MarshalJSON() ([]byte, error)

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

func New(client *http.Client) (*Service, error)

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

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	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 values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	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. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

User: Describes a single user.

func (*User) MarshalJSON

func (s *User) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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