google-apis-keep_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module KeepV1
18
+ # Version of the google-apis-keep_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.3.0"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20210528"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,267 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module KeepV1
24
+
25
+ class Attachment
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class BatchCreatePermissionsRequest
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class BatchCreatePermissionsResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class BatchDeletePermissionsRequest
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class CreatePermissionRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Empty
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Family
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Group
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ListContent
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ListItem
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class ListNotesResponse
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class Note
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Permission
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Section
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class TextContent
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class User
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Attachment
122
+ # @private
123
+ class Representation < Google::Apis::Core::JsonRepresentation
124
+ collection :mime_type, as: 'mimeType'
125
+ property :name, as: 'name'
126
+ end
127
+ end
128
+
129
+ class BatchCreatePermissionsRequest
130
+ # @private
131
+ class Representation < Google::Apis::Core::JsonRepresentation
132
+ collection :requests, as: 'requests', class: Google::Apis::KeepV1::CreatePermissionRequest, decorator: Google::Apis::KeepV1::CreatePermissionRequest::Representation
133
+
134
+ end
135
+ end
136
+
137
+ class BatchCreatePermissionsResponse
138
+ # @private
139
+ class Representation < Google::Apis::Core::JsonRepresentation
140
+ collection :permissions, as: 'permissions', class: Google::Apis::KeepV1::Permission, decorator: Google::Apis::KeepV1::Permission::Representation
141
+
142
+ end
143
+ end
144
+
145
+ class BatchDeletePermissionsRequest
146
+ # @private
147
+ class Representation < Google::Apis::Core::JsonRepresentation
148
+ collection :names, as: 'names'
149
+ end
150
+ end
151
+
152
+ class CreatePermissionRequest
153
+ # @private
154
+ class Representation < Google::Apis::Core::JsonRepresentation
155
+ property :parent, as: 'parent'
156
+ property :permission, as: 'permission', class: Google::Apis::KeepV1::Permission, decorator: Google::Apis::KeepV1::Permission::Representation
157
+
158
+ end
159
+ end
160
+
161
+ class Empty
162
+ # @private
163
+ class Representation < Google::Apis::Core::JsonRepresentation
164
+ end
165
+ end
166
+
167
+ class Family
168
+ # @private
169
+ class Representation < Google::Apis::Core::JsonRepresentation
170
+ end
171
+ end
172
+
173
+ class Group
174
+ # @private
175
+ class Representation < Google::Apis::Core::JsonRepresentation
176
+ property :email, as: 'email'
177
+ end
178
+ end
179
+
180
+ class ListContent
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ collection :list_items, as: 'listItems', class: Google::Apis::KeepV1::ListItem, decorator: Google::Apis::KeepV1::ListItem::Representation
184
+
185
+ end
186
+ end
187
+
188
+ class ListItem
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ property :checked, as: 'checked'
192
+ collection :child_list_items, as: 'childListItems', class: Google::Apis::KeepV1::ListItem, decorator: Google::Apis::KeepV1::ListItem::Representation
193
+
194
+ property :text, as: 'text', class: Google::Apis::KeepV1::TextContent, decorator: Google::Apis::KeepV1::TextContent::Representation
195
+
196
+ end
197
+ end
198
+
199
+ class ListNotesResponse
200
+ # @private
201
+ class Representation < Google::Apis::Core::JsonRepresentation
202
+ property :next_page_token, as: 'nextPageToken'
203
+ collection :notes, as: 'notes', class: Google::Apis::KeepV1::Note, decorator: Google::Apis::KeepV1::Note::Representation
204
+
205
+ end
206
+ end
207
+
208
+ class Note
209
+ # @private
210
+ class Representation < Google::Apis::Core::JsonRepresentation
211
+ collection :attachments, as: 'attachments', class: Google::Apis::KeepV1::Attachment, decorator: Google::Apis::KeepV1::Attachment::Representation
212
+
213
+ property :body, as: 'body', class: Google::Apis::KeepV1::Section, decorator: Google::Apis::KeepV1::Section::Representation
214
+
215
+ property :create_time, as: 'createTime'
216
+ property :name, as: 'name'
217
+ collection :permissions, as: 'permissions', class: Google::Apis::KeepV1::Permission, decorator: Google::Apis::KeepV1::Permission::Representation
218
+
219
+ property :title, as: 'title'
220
+ property :trash_time, as: 'trashTime'
221
+ property :trashed, as: 'trashed'
222
+ property :update_time, as: 'updateTime'
223
+ end
224
+ end
225
+
226
+ class Permission
227
+ # @private
228
+ class Representation < Google::Apis::Core::JsonRepresentation
229
+ property :deleted, as: 'deleted'
230
+ property :email, as: 'email'
231
+ property :family, as: 'family', class: Google::Apis::KeepV1::Family, decorator: Google::Apis::KeepV1::Family::Representation
232
+
233
+ property :group, as: 'group', class: Google::Apis::KeepV1::Group, decorator: Google::Apis::KeepV1::Group::Representation
234
+
235
+ property :name, as: 'name'
236
+ property :role, as: 'role'
237
+ property :user, as: 'user', class: Google::Apis::KeepV1::User, decorator: Google::Apis::KeepV1::User::Representation
238
+
239
+ end
240
+ end
241
+
242
+ class Section
243
+ # @private
244
+ class Representation < Google::Apis::Core::JsonRepresentation
245
+ property :list, as: 'list', class: Google::Apis::KeepV1::ListContent, decorator: Google::Apis::KeepV1::ListContent::Representation
246
+
247
+ property :text, as: 'text', class: Google::Apis::KeepV1::TextContent, decorator: Google::Apis::KeepV1::TextContent::Representation
248
+
249
+ end
250
+ end
251
+
252
+ class TextContent
253
+ # @private
254
+ class Representation < Google::Apis::Core::JsonRepresentation
255
+ property :text, as: 'text'
256
+ end
257
+ end
258
+
259
+ class User
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ property :email, as: 'email'
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
@@ -0,0 +1,320 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module KeepV1
23
+ # Google Keep API
24
+ #
25
+ # Allows clients to create, read, and write their Google Keep Notes.
26
+ #
27
+ # @example
28
+ # require 'google/apis/keep_v1'
29
+ #
30
+ # Keep = Google::Apis::KeepV1 # Alias the module
31
+ # service = Keep::KeepService.new
32
+ #
33
+ # @see https://support.google.com/keep
34
+ class KeepService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://keep.googleapis.com/', '',
47
+ client_name: 'google-apis-keep_v1',
48
+ client_version: Google::Apis::KeepV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets an attachment. To download attachment media via REST requires the alt=
53
+ # media query parameter. Returns a 400 bad request error if attachment media is
54
+ # not available in the requested MIME type.
55
+ # @param [String] name
56
+ # Required. The name of the attachment.
57
+ # @param [String] mime_type
58
+ # The IANA MIME type format requested. The requested MIME type must be one
59
+ # specified in the attachment.mime_type. Required when downloading attachment
60
+ # media and ignored otherwise.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [IO, String] download_dest
67
+ # IO stream or filename to receive content download
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::KeepV1::Attachment] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::KeepV1::Attachment]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def download_medium(name, mime_type: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
81
+ if download_dest.nil?
82
+ command = make_simple_command(:get, 'v1/{+name}', options)
83
+ else
84
+ command = make_download_command(:get, 'v1/{+name}', options)
85
+ command.download_dest = download_dest
86
+ end
87
+ command.response_representation = Google::Apis::KeepV1::Attachment::Representation
88
+ command.response_class = Google::Apis::KeepV1::Attachment
89
+ command.params['name'] = name unless name.nil?
90
+ command.query['mimeType'] = mime_type unless mime_type.nil?
91
+ command.query['fields'] = fields unless fields.nil?
92
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
93
+ execute_or_queue_command(command, &block)
94
+ end
95
+
96
+ # Creates a new note.
97
+ # @param [Google::Apis::KeepV1::Note] note_object
98
+ # @param [String] fields
99
+ # Selector specifying which fields to include in a partial response.
100
+ # @param [String] quota_user
101
+ # Available to use for quota purposes for server-side applications. Can be any
102
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
103
+ # @param [Google::Apis::RequestOptions] options
104
+ # Request-specific options
105
+ #
106
+ # @yield [result, err] Result & error if block supplied
107
+ # @yieldparam result [Google::Apis::KeepV1::Note] parsed result object
108
+ # @yieldparam err [StandardError] error object if request failed
109
+ #
110
+ # @return [Google::Apis::KeepV1::Note]
111
+ #
112
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
113
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
114
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
115
+ def create_note(note_object = nil, fields: nil, quota_user: nil, options: nil, &block)
116
+ command = make_simple_command(:post, 'v1/notes', options)
117
+ command.request_representation = Google::Apis::KeepV1::Note::Representation
118
+ command.request_object = note_object
119
+ command.response_representation = Google::Apis::KeepV1::Note::Representation
120
+ command.response_class = Google::Apis::KeepV1::Note
121
+ command.query['fields'] = fields unless fields.nil?
122
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
123
+ execute_or_queue_command(command, &block)
124
+ end
125
+
126
+ # Deletes a note. Caller must have the `OWNER` role on the note to delete.
127
+ # Deleting a note removes the resource immediately and cannot be undone. Any
128
+ # collaborators will lose access to the note.
129
+ # @param [String] name
130
+ # Required. Name of the note to delete.
131
+ # @param [String] fields
132
+ # Selector specifying which fields to include in a partial response.
133
+ # @param [String] quota_user
134
+ # Available to use for quota purposes for server-side applications. Can be any
135
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
136
+ # @param [Google::Apis::RequestOptions] options
137
+ # Request-specific options
138
+ #
139
+ # @yield [result, err] Result & error if block supplied
140
+ # @yieldparam result [Google::Apis::KeepV1::Empty] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::KeepV1::Empty]
144
+ #
145
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
148
+ def delete_note(name, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:delete, 'v1/{+name}', options)
150
+ command.response_representation = Google::Apis::KeepV1::Empty::Representation
151
+ command.response_class = Google::Apis::KeepV1::Empty
152
+ command.params['name'] = name unless name.nil?
153
+ command.query['fields'] = fields unless fields.nil?
154
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
155
+ execute_or_queue_command(command, &block)
156
+ end
157
+
158
+ # Gets a note.
159
+ # @param [String] name
160
+ # Required. Name of the resource.
161
+ # @param [String] fields
162
+ # Selector specifying which fields to include in a partial response.
163
+ # @param [String] quota_user
164
+ # Available to use for quota purposes for server-side applications. Can be any
165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
166
+ # @param [Google::Apis::RequestOptions] options
167
+ # Request-specific options
168
+ #
169
+ # @yield [result, err] Result & error if block supplied
170
+ # @yieldparam result [Google::Apis::KeepV1::Note] parsed result object
171
+ # @yieldparam err [StandardError] error object if request failed
172
+ #
173
+ # @return [Google::Apis::KeepV1::Note]
174
+ #
175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
178
+ def get_note(name, fields: nil, quota_user: nil, options: nil, &block)
179
+ command = make_simple_command(:get, 'v1/{+name}', options)
180
+ command.response_representation = Google::Apis::KeepV1::Note::Representation
181
+ command.response_class = Google::Apis::KeepV1::Note
182
+ command.params['name'] = name unless name.nil?
183
+ command.query['fields'] = fields unless fields.nil?
184
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
185
+ execute_or_queue_command(command, &block)
186
+ end
187
+
188
+ # Lists notes. Every list call returns a page of results with `page_size` as the
189
+ # upper bound of returned items. A `page_size` of zero allows the server to
190
+ # choose the upper bound. The ListNotesResponse contains at most `page_size`
191
+ # entries. If there are more things left to list, it provides a `next_page_token`
192
+ # value. (Page tokens are opaque values.) To get the next page of results, copy
193
+ # the result's `next_page_token` into the next request's `page_token`. Repeat
194
+ # until the `next_page_token` returned with a page of results is empty.
195
+ # ListNotes return consistent results in the face of concurrent changes, or
196
+ # signals that it cannot with an ABORTED error.
197
+ # @param [String] filter
198
+ # Filter for list results. If no filter is supplied, the "-trashed" filter is
199
+ # applied by default. Valid fields to filter by are: - `create_time` - `
200
+ # update_time` - `trash_time` - `trashed` Filter syntax follows the Google AIP
201
+ # filtering spec: https://aip.dev/160
202
+ # @param [Fixnum] page_size
203
+ # The maximum number of results to return.
204
+ # @param [String] page_token
205
+ # The previous page's `next_page_token` field.
206
+ # @param [String] fields
207
+ # Selector specifying which fields to include in a partial response.
208
+ # @param [String] quota_user
209
+ # Available to use for quota purposes for server-side applications. Can be any
210
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
211
+ # @param [Google::Apis::RequestOptions] options
212
+ # Request-specific options
213
+ #
214
+ # @yield [result, err] Result & error if block supplied
215
+ # @yieldparam result [Google::Apis::KeepV1::ListNotesResponse] parsed result object
216
+ # @yieldparam err [StandardError] error object if request failed
217
+ #
218
+ # @return [Google::Apis::KeepV1::ListNotesResponse]
219
+ #
220
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
221
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
222
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
223
+ def list_notes(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
224
+ command = make_simple_command(:get, 'v1/notes', options)
225
+ command.response_representation = Google::Apis::KeepV1::ListNotesResponse::Representation
226
+ command.response_class = Google::Apis::KeepV1::ListNotesResponse
227
+ command.query['filter'] = filter unless filter.nil?
228
+ command.query['pageSize'] = page_size unless page_size.nil?
229
+ command.query['pageToken'] = page_token unless page_token.nil?
230
+ command.query['fields'] = fields unless fields.nil?
231
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
232
+ execute_or_queue_command(command, &block)
233
+ end
234
+
235
+ # Creates one or more permission on the note. Only permissions with the `WRITER`
236
+ # role may be created. If adding any permission fails, then the entire request
237
+ # fails and no changes are made.
238
+ # @param [String] parent
239
+ # The parent resource shared by all Permissions being created. Format: `notes/`
240
+ # note`` If this is set, the parent field in the CreatePermission messages must
241
+ # either be empty or match this field.
242
+ # @param [Google::Apis::KeepV1::BatchCreatePermissionsRequest] batch_create_permissions_request_object
243
+ # @param [String] fields
244
+ # Selector specifying which fields to include in a partial response.
245
+ # @param [String] quota_user
246
+ # Available to use for quota purposes for server-side applications. Can be any
247
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
248
+ # @param [Google::Apis::RequestOptions] options
249
+ # Request-specific options
250
+ #
251
+ # @yield [result, err] Result & error if block supplied
252
+ # @yieldparam result [Google::Apis::KeepV1::BatchCreatePermissionsResponse] parsed result object
253
+ # @yieldparam err [StandardError] error object if request failed
254
+ #
255
+ # @return [Google::Apis::KeepV1::BatchCreatePermissionsResponse]
256
+ #
257
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
258
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
259
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
260
+ def batch_create_permissions(parent, batch_create_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
261
+ command = make_simple_command(:post, 'v1/{+parent}/permissions:batchCreate', options)
262
+ command.request_representation = Google::Apis::KeepV1::BatchCreatePermissionsRequest::Representation
263
+ command.request_object = batch_create_permissions_request_object
264
+ command.response_representation = Google::Apis::KeepV1::BatchCreatePermissionsResponse::Representation
265
+ command.response_class = Google::Apis::KeepV1::BatchCreatePermissionsResponse
266
+ command.params['parent'] = parent unless parent.nil?
267
+ command.query['fields'] = fields unless fields.nil?
268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
269
+ execute_or_queue_command(command, &block)
270
+ end
271
+
272
+ # Deletes one or more permissions on the note. The specified entities will
273
+ # immediately lose access. A permission with the `OWNER` role can't be removed.
274
+ # If removing a permission fails, then the entire request fails and no changes
275
+ # are made. Returns a 400 bad request error if a specified permission does not
276
+ # exist on the note.
277
+ # @param [String] parent
278
+ # The parent resource shared by all permissions being deleted. Format: `notes/`
279
+ # note`` If this is set, the parent of all of the permissions specified in the
280
+ # DeletePermissionRequest messages must match this field.
281
+ # @param [Google::Apis::KeepV1::BatchDeletePermissionsRequest] batch_delete_permissions_request_object
282
+ # @param [String] fields
283
+ # Selector specifying which fields to include in a partial response.
284
+ # @param [String] quota_user
285
+ # Available to use for quota purposes for server-side applications. Can be any
286
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
287
+ # @param [Google::Apis::RequestOptions] options
288
+ # Request-specific options
289
+ #
290
+ # @yield [result, err] Result & error if block supplied
291
+ # @yieldparam result [Google::Apis::KeepV1::Empty] parsed result object
292
+ # @yieldparam err [StandardError] error object if request failed
293
+ #
294
+ # @return [Google::Apis::KeepV1::Empty]
295
+ #
296
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
297
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
298
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
299
+ def batch_delete_permissions(parent, batch_delete_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
300
+ command = make_simple_command(:post, 'v1/{+parent}/permissions:batchDelete', options)
301
+ command.request_representation = Google::Apis::KeepV1::BatchDeletePermissionsRequest::Representation
302
+ command.request_object = batch_delete_permissions_request_object
303
+ command.response_representation = Google::Apis::KeepV1::Empty::Representation
304
+ command.response_class = Google::Apis::KeepV1::Empty
305
+ command.params['parent'] = parent unless parent.nil?
306
+ command.query['fields'] = fields unless fields.nil?
307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
308
+ execute_or_queue_command(command, &block)
309
+ end
310
+
311
+ protected
312
+
313
+ def apply_command_defaults(command)
314
+ command.query['key'] = key unless key.nil?
315
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
316
+ end
317
+ end
318
+ end
319
+ end
320
+ end