Class: Google::Apis::KeepV1::KeepService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::KeepV1::KeepService
- Defined in:
- lib/google/apis/keep_v1/service.rb
Overview
Google Keep API
The Google Keep API is used in an enterprise environment to manage Google Keep content and resolve issues identified by cloud security software.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://keep.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#batch_create_permissions(parent, batch_create_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::BatchCreatePermissionsResponse
Creates one or more permissions on the note.
-
#batch_delete_permissions(parent, batch_delete_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Empty
Deletes one or more permissions on the note.
-
#create_note(note_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Note
Creates a new note.
-
#delete_note(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Empty
Deletes a note.
-
#download_medium(name, mime_type: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Attachment
Gets an attachment.
-
#get_note(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Note
Gets a note.
-
#initialize ⇒ KeepService
constructor
A new instance of KeepService.
-
#list_notes(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::ListNotesResponse
Lists notes.
Constructor Details
#initialize ⇒ KeepService
Returns a new instance of KeepService.
48 49 50 51 52 53 |
# File 'lib/google/apis/keep_v1/service.rb', line 48 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-keep_v1', client_version: Google::Apis::KeepV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
41 42 43 |
# File 'lib/google/apis/keep_v1/service.rb', line 41 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
46 47 48 |
# File 'lib/google/apis/keep_v1/service.rb', line 46 def quota_user @quota_user end |
Instance Method Details
#batch_create_permissions(parent, batch_create_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::BatchCreatePermissionsResponse
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.
263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/google/apis/keep_v1/service.rb', line 263 def (parent, = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/permissions:batchCreate', ) command.request_representation = Google::Apis::KeepV1::BatchCreatePermissionsRequest::Representation command.request_object = command.response_representation = Google::Apis::KeepV1::BatchCreatePermissionsResponse::Representation command.response_class = Google::Apis::KeepV1::BatchCreatePermissionsResponse command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#batch_delete_permissions(parent, batch_delete_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Empty
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.
302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/google/apis/keep_v1/service.rb', line 302 def (parent, = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/permissions:batchDelete', ) command.request_representation = Google::Apis::KeepV1::BatchDeletePermissionsRequest::Representation command.request_object = command.response_representation = Google::Apis::KeepV1::Empty::Representation command.response_class = Google::Apis::KeepV1::Empty command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_note(note_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Note
Creates a new note.
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/google/apis/keep_v1/service.rb', line 118 def create_note(note_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/notes', ) command.request_representation = Google::Apis::KeepV1::Note::Representation command.request_object = note_object command.response_representation = Google::Apis::KeepV1::Note::Representation command.response_class = Google::Apis::KeepV1::Note command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_note(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Empty
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.
151 152 153 154 155 156 157 158 159 |
# File 'lib/google/apis/keep_v1/service.rb', line 151 def delete_note(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::KeepV1::Empty::Representation command.response_class = Google::Apis::KeepV1::Empty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#download_medium(name, mime_type: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Attachment
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.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/google/apis/keep_v1/service.rb', line 83 def download_medium(name, mime_type: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block) if download_dest.nil? command = make_simple_command(:get, 'v1/{+name}', ) else command = make_download_command(:get, 'v1/{+name}', ) command.download_dest = download_dest end command.response_representation = Google::Apis::KeepV1::Attachment::Representation command.response_class = Google::Apis::KeepV1::Attachment command.params['name'] = name unless name.nil? command.query['mimeType'] = mime_type unless mime_type.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_note(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::Note
Gets a note.
181 182 183 184 185 186 187 188 189 |
# File 'lib/google/apis/keep_v1/service.rb', line 181 def get_note(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::KeepV1::Note::Representation command.response_class = Google::Apis::KeepV1::Note command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_notes(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KeepV1::ListNotesResponse
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.
226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/google/apis/keep_v1/service.rb', line 226 def list_notes(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/notes', ) command.response_representation = Google::Apis::KeepV1::ListNotesResponse::Representation command.response_class = Google::Apis::KeepV1::ListNotesResponse command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |