google-apis-drive_v2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-drive_v2.rb +15 -0
- data/lib/google/apis/drive_v2.rb +61 -0
- data/lib/google/apis/drive_v2/classes.rb +4137 -0
- data/lib/google/apis/drive_v2/gem_version.rb +28 -0
- data/lib/google/apis/drive_v2/representations.rb +1290 -0
- data/lib/google/apis/drive_v2/service.rb +3409 -0
- metadata +76 -0
@@ -0,0 +1,3409 @@
|
|
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 DriveV2
|
23
|
+
# Drive API
|
24
|
+
#
|
25
|
+
# Manages files in Drive including uploading, downloading, searching, detecting
|
26
|
+
# changes, and updating sharing permissions.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# require 'google/apis/drive_v2'
|
30
|
+
#
|
31
|
+
# Drive = Google::Apis::DriveV2 # Alias the module
|
32
|
+
# service = Drive::DriveService.new
|
33
|
+
#
|
34
|
+
# @see https://developers.google.com/drive/
|
35
|
+
class DriveService < Google::Apis::Core::BaseService
|
36
|
+
# @return [String]
|
37
|
+
# API key. Your API key identifies your project and provides you with API access,
|
38
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
39
|
+
attr_accessor :key
|
40
|
+
|
41
|
+
# @return [String]
|
42
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
43
|
+
# characters.
|
44
|
+
attr_accessor :quota_user
|
45
|
+
|
46
|
+
# @return [String]
|
47
|
+
# Deprecated. Please use quotaUser instead.
|
48
|
+
attr_accessor :user_ip
|
49
|
+
|
50
|
+
def initialize
|
51
|
+
super('https://www.googleapis.com/', 'drive/v2/',
|
52
|
+
client_name: 'google-apis-drive_v2',
|
53
|
+
client_version: Google::Apis::DriveV2::GEM_VERSION)
|
54
|
+
@batch_path = 'batch/drive/v2'
|
55
|
+
end
|
56
|
+
|
57
|
+
# Gets the information about the current user along with Drive API settings
|
58
|
+
# @param [Boolean] include_subscribed
|
59
|
+
# Whether to count changes outside the My Drive hierarchy. When set to false,
|
60
|
+
# changes to files such as those in the Application Data folder or shared files
|
61
|
+
# which have not been added to My Drive will be omitted from the
|
62
|
+
# maxChangeIdCount.
|
63
|
+
# @param [Fixnum] max_change_id_count
|
64
|
+
# Maximum number of remaining change IDs to count
|
65
|
+
# @param [Fixnum] start_change_id
|
66
|
+
# Change ID to start counting from when calculating number of remaining change
|
67
|
+
# IDs
|
68
|
+
# @param [String] fields
|
69
|
+
# Selector specifying which fields to include in a partial response.
|
70
|
+
# @param [String] quota_user
|
71
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
72
|
+
# characters.
|
73
|
+
# @param [String] user_ip
|
74
|
+
# Deprecated. Please use quotaUser instead.
|
75
|
+
# @param [Google::Apis::RequestOptions] options
|
76
|
+
# Request-specific options
|
77
|
+
#
|
78
|
+
# @yield [result, err] Result & error if block supplied
|
79
|
+
# @yieldparam result [Google::Apis::DriveV2::About] parsed result object
|
80
|
+
# @yieldparam err [StandardError] error object if request failed
|
81
|
+
#
|
82
|
+
# @return [Google::Apis::DriveV2::About]
|
83
|
+
#
|
84
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
85
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
86
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
87
|
+
def get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
88
|
+
command = make_simple_command(:get, 'about', options)
|
89
|
+
command.response_representation = Google::Apis::DriveV2::About::Representation
|
90
|
+
command.response_class = Google::Apis::DriveV2::About
|
91
|
+
command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
|
92
|
+
command.query['maxChangeIdCount'] = max_change_id_count unless max_change_id_count.nil?
|
93
|
+
command.query['startChangeId'] = start_change_id unless start_change_id.nil?
|
94
|
+
command.query['fields'] = fields unless fields.nil?
|
95
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
96
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
97
|
+
execute_or_queue_command(command, &block)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Gets a specific app.
|
101
|
+
# @param [String] app_id
|
102
|
+
# The ID of the app.
|
103
|
+
# @param [String] fields
|
104
|
+
# Selector specifying which fields to include in a partial response.
|
105
|
+
# @param [String] quota_user
|
106
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
107
|
+
# characters.
|
108
|
+
# @param [String] user_ip
|
109
|
+
# Deprecated. Please use quotaUser instead.
|
110
|
+
# @param [Google::Apis::RequestOptions] options
|
111
|
+
# Request-specific options
|
112
|
+
#
|
113
|
+
# @yield [result, err] Result & error if block supplied
|
114
|
+
# @yieldparam result [Google::Apis::DriveV2::App] parsed result object
|
115
|
+
# @yieldparam err [StandardError] error object if request failed
|
116
|
+
#
|
117
|
+
# @return [Google::Apis::DriveV2::App]
|
118
|
+
#
|
119
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
120
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
121
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
122
|
+
def get_app(app_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
123
|
+
command = make_simple_command(:get, 'apps/{appId}', options)
|
124
|
+
command.response_representation = Google::Apis::DriveV2::App::Representation
|
125
|
+
command.response_class = Google::Apis::DriveV2::App
|
126
|
+
command.params['appId'] = app_id unless app_id.nil?
|
127
|
+
command.query['fields'] = fields unless fields.nil?
|
128
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
129
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
130
|
+
execute_or_queue_command(command, &block)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Lists a user's installed apps.
|
134
|
+
# @param [String] app_filter_extensions
|
135
|
+
# A comma-separated list of file extensions for open with filtering. All apps
|
136
|
+
# within the given app query scope which can open any of the given file
|
137
|
+
# extensions will be included in the response. If appFilterMimeTypes are
|
138
|
+
# provided as well, the result is a union of the two resulting app lists.
|
139
|
+
# @param [String] app_filter_mime_types
|
140
|
+
# A comma-separated list of MIME types for open with filtering. All apps within
|
141
|
+
# the given app query scope which can open any of the given MIME types will be
|
142
|
+
# included in the response. If appFilterExtensions are provided as well, the
|
143
|
+
# result is a union of the two resulting app lists.
|
144
|
+
# @param [String] language_code
|
145
|
+
# A language or locale code, as defined by BCP 47, with some extensions from
|
146
|
+
# Unicode's LDML format (http://www.unicode.org/reports/tr35/).
|
147
|
+
# @param [String] fields
|
148
|
+
# Selector specifying which fields to include in a partial response.
|
149
|
+
# @param [String] quota_user
|
150
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
151
|
+
# characters.
|
152
|
+
# @param [String] user_ip
|
153
|
+
# Deprecated. Please use quotaUser instead.
|
154
|
+
# @param [Google::Apis::RequestOptions] options
|
155
|
+
# Request-specific options
|
156
|
+
#
|
157
|
+
# @yield [result, err] Result & error if block supplied
|
158
|
+
# @yieldparam result [Google::Apis::DriveV2::AppList] parsed result object
|
159
|
+
# @yieldparam err [StandardError] error object if request failed
|
160
|
+
#
|
161
|
+
# @return [Google::Apis::DriveV2::AppList]
|
162
|
+
#
|
163
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
164
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
165
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
166
|
+
def list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
167
|
+
command = make_simple_command(:get, 'apps', options)
|
168
|
+
command.response_representation = Google::Apis::DriveV2::AppList::Representation
|
169
|
+
command.response_class = Google::Apis::DriveV2::AppList
|
170
|
+
command.query['appFilterExtensions'] = app_filter_extensions unless app_filter_extensions.nil?
|
171
|
+
command.query['appFilterMimeTypes'] = app_filter_mime_types unless app_filter_mime_types.nil?
|
172
|
+
command.query['languageCode'] = language_code unless language_code.nil?
|
173
|
+
command.query['fields'] = fields unless fields.nil?
|
174
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
175
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
176
|
+
execute_or_queue_command(command, &block)
|
177
|
+
end
|
178
|
+
|
179
|
+
# Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent
|
180
|
+
# changes.
|
181
|
+
# @param [String] change_id
|
182
|
+
# The ID of the change.
|
183
|
+
# @param [String] drive_id
|
184
|
+
# The shared drive from which the change is returned.
|
185
|
+
# @param [Boolean] supports_all_drives
|
186
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
187
|
+
# @param [Boolean] supports_team_drives
|
188
|
+
# Deprecated use supportsAllDrives instead.
|
189
|
+
# @param [String] team_drive_id
|
190
|
+
# Deprecated use driveId instead.
|
191
|
+
# @param [String] fields
|
192
|
+
# Selector specifying which fields to include in a partial response.
|
193
|
+
# @param [String] quota_user
|
194
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
195
|
+
# characters.
|
196
|
+
# @param [String] user_ip
|
197
|
+
# Deprecated. Please use quotaUser instead.
|
198
|
+
# @param [Google::Apis::RequestOptions] options
|
199
|
+
# Request-specific options
|
200
|
+
#
|
201
|
+
# @yield [result, err] Result & error if block supplied
|
202
|
+
# @yieldparam result [Google::Apis::DriveV2::Change] parsed result object
|
203
|
+
# @yieldparam err [StandardError] error object if request failed
|
204
|
+
#
|
205
|
+
# @return [Google::Apis::DriveV2::Change]
|
206
|
+
#
|
207
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
208
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
209
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
210
|
+
def get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
211
|
+
command = make_simple_command(:get, 'changes/{changeId}', options)
|
212
|
+
command.response_representation = Google::Apis::DriveV2::Change::Representation
|
213
|
+
command.response_class = Google::Apis::DriveV2::Change
|
214
|
+
command.params['changeId'] = change_id unless change_id.nil?
|
215
|
+
command.query['driveId'] = drive_id unless drive_id.nil?
|
216
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
217
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
218
|
+
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
219
|
+
command.query['fields'] = fields unless fields.nil?
|
220
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
221
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
222
|
+
execute_or_queue_command(command, &block)
|
223
|
+
end
|
224
|
+
|
225
|
+
# Gets the starting pageToken for listing future changes.
|
226
|
+
# @param [String] drive_id
|
227
|
+
# The ID of the shared drive for which the starting pageToken for listing future
|
228
|
+
# changes from that shared drive is returned.
|
229
|
+
# @param [Boolean] supports_all_drives
|
230
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
231
|
+
# @param [Boolean] supports_team_drives
|
232
|
+
# Deprecated use supportsAllDrives instead.
|
233
|
+
# @param [String] team_drive_id
|
234
|
+
# Deprecated use driveId instead.
|
235
|
+
# @param [String] fields
|
236
|
+
# Selector specifying which fields to include in a partial response.
|
237
|
+
# @param [String] quota_user
|
238
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
239
|
+
# characters.
|
240
|
+
# @param [String] user_ip
|
241
|
+
# Deprecated. Please use quotaUser instead.
|
242
|
+
# @param [Google::Apis::RequestOptions] options
|
243
|
+
# Request-specific options
|
244
|
+
#
|
245
|
+
# @yield [result, err] Result & error if block supplied
|
246
|
+
# @yieldparam result [Google::Apis::DriveV2::StartPageToken] parsed result object
|
247
|
+
# @yieldparam err [StandardError] error object if request failed
|
248
|
+
#
|
249
|
+
# @return [Google::Apis::DriveV2::StartPageToken]
|
250
|
+
#
|
251
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
252
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
253
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
254
|
+
def get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
255
|
+
command = make_simple_command(:get, 'changes/startPageToken', options)
|
256
|
+
command.response_representation = Google::Apis::DriveV2::StartPageToken::Representation
|
257
|
+
command.response_class = Google::Apis::DriveV2::StartPageToken
|
258
|
+
command.query['driveId'] = drive_id unless drive_id.nil?
|
259
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
260
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
261
|
+
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
262
|
+
command.query['fields'] = fields unless fields.nil?
|
263
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
264
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
265
|
+
execute_or_queue_command(command, &block)
|
266
|
+
end
|
267
|
+
|
268
|
+
# Lists the changes for a user or shared drive.
|
269
|
+
# @param [String] drive_id
|
270
|
+
# The shared drive from which changes are returned. If specified the change IDs
|
271
|
+
# will be reflective of the shared drive; use the combined drive ID and change
|
272
|
+
# ID as an identifier.
|
273
|
+
# @param [Boolean] include_corpus_removals
|
274
|
+
# Whether changes should include the file resource if the file is still
|
275
|
+
# accessible by the user at the time of the request, even when a file was
|
276
|
+
# removed from the list of changes and there will be no further change entries
|
277
|
+
# for this file.
|
278
|
+
# @param [Boolean] include_deleted
|
279
|
+
# Whether to include changes indicating that items have been removed from the
|
280
|
+
# list of changes, for example by deletion or loss of access.
|
281
|
+
# @param [Boolean] include_items_from_all_drives
|
282
|
+
# Whether both My Drive and shared drive items should be included in results.
|
283
|
+
# @param [String] include_permissions_for_view
|
284
|
+
# Specifies which additional view's permissions to include in the response. Only
|
285
|
+
# 'published' is supported.
|
286
|
+
# @param [Boolean] include_subscribed
|
287
|
+
# Whether to include changes outside the My Drive hierarchy in the result. When
|
288
|
+
# set to false, changes to files such as those in the Application Data folder or
|
289
|
+
# shared files which have not been added to My Drive are omitted from the result.
|
290
|
+
# @param [Boolean] include_team_drive_items
|
291
|
+
# Deprecated use includeItemsFromAllDrives instead.
|
292
|
+
# @param [Fixnum] max_results
|
293
|
+
# Maximum number of changes to return.
|
294
|
+
# @param [String] page_token
|
295
|
+
# The token for continuing a previous list request on the next page. This should
|
296
|
+
# be set to the value of 'nextPageToken' from the previous response or to the
|
297
|
+
# response from the getStartPageToken method.
|
298
|
+
# @param [String] spaces
|
299
|
+
# A comma-separated list of spaces to query. Supported values are 'drive', '
|
300
|
+
# appDataFolder' and 'photos'.
|
301
|
+
# @param [Fixnum] start_change_id
|
302
|
+
# Deprecated - use pageToken instead.
|
303
|
+
# @param [Boolean] supports_all_drives
|
304
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
305
|
+
# @param [Boolean] supports_team_drives
|
306
|
+
# Deprecated use supportsAllDrives instead.
|
307
|
+
# @param [String] team_drive_id
|
308
|
+
# Deprecated use driveId instead.
|
309
|
+
# @param [String] fields
|
310
|
+
# Selector specifying which fields to include in a partial response.
|
311
|
+
# @param [String] quota_user
|
312
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
313
|
+
# characters.
|
314
|
+
# @param [String] user_ip
|
315
|
+
# Deprecated. Please use quotaUser instead.
|
316
|
+
# @param [Google::Apis::RequestOptions] options
|
317
|
+
# Request-specific options
|
318
|
+
#
|
319
|
+
# @yield [result, err] Result & error if block supplied
|
320
|
+
# @yieldparam result [Google::Apis::DriveV2::ChangeList] parsed result object
|
321
|
+
# @yieldparam err [StandardError] error object if request failed
|
322
|
+
#
|
323
|
+
# @return [Google::Apis::DriveV2::ChangeList]
|
324
|
+
#
|
325
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
326
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
327
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
328
|
+
def list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
329
|
+
command = make_simple_command(:get, 'changes', options)
|
330
|
+
command.response_representation = Google::Apis::DriveV2::ChangeList::Representation
|
331
|
+
command.response_class = Google::Apis::DriveV2::ChangeList
|
332
|
+
command.query['driveId'] = drive_id unless drive_id.nil?
|
333
|
+
command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
|
334
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
335
|
+
command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
|
336
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
337
|
+
command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
|
338
|
+
command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
|
339
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
340
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
341
|
+
command.query['spaces'] = spaces unless spaces.nil?
|
342
|
+
command.query['startChangeId'] = start_change_id unless start_change_id.nil?
|
343
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
344
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
345
|
+
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
346
|
+
command.query['fields'] = fields unless fields.nil?
|
347
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
348
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
349
|
+
execute_or_queue_command(command, &block)
|
350
|
+
end
|
351
|
+
|
352
|
+
# Subscribe to changes for a user.
|
353
|
+
# @param [Google::Apis::DriveV2::Channel] channel_object
|
354
|
+
# @param [String] drive_id
|
355
|
+
# The shared drive from which changes are returned. If specified the change IDs
|
356
|
+
# will be reflective of the shared drive; use the combined drive ID and change
|
357
|
+
# ID as an identifier.
|
358
|
+
# @param [Boolean] include_corpus_removals
|
359
|
+
# Whether changes should include the file resource if the file is still
|
360
|
+
# accessible by the user at the time of the request, even when a file was
|
361
|
+
# removed from the list of changes and there will be no further change entries
|
362
|
+
# for this file.
|
363
|
+
# @param [Boolean] include_deleted
|
364
|
+
# Whether to include changes indicating that items have been removed from the
|
365
|
+
# list of changes, for example by deletion or loss of access.
|
366
|
+
# @param [Boolean] include_items_from_all_drives
|
367
|
+
# Whether both My Drive and shared drive items should be included in results.
|
368
|
+
# @param [String] include_permissions_for_view
|
369
|
+
# Specifies which additional view's permissions to include in the response. Only
|
370
|
+
# 'published' is supported.
|
371
|
+
# @param [Boolean] include_subscribed
|
372
|
+
# Whether to include changes outside the My Drive hierarchy in the result. When
|
373
|
+
# set to false, changes to files such as those in the Application Data folder or
|
374
|
+
# shared files which have not been added to My Drive are omitted from the result.
|
375
|
+
# @param [Boolean] include_team_drive_items
|
376
|
+
# Deprecated use includeItemsFromAllDrives instead.
|
377
|
+
# @param [Fixnum] max_results
|
378
|
+
# Maximum number of changes to return.
|
379
|
+
# @param [String] page_token
|
380
|
+
# The token for continuing a previous list request on the next page. This should
|
381
|
+
# be set to the value of 'nextPageToken' from the previous response or to the
|
382
|
+
# response from the getStartPageToken method.
|
383
|
+
# @param [String] spaces
|
384
|
+
# A comma-separated list of spaces to query. Supported values are 'drive', '
|
385
|
+
# appDataFolder' and 'photos'.
|
386
|
+
# @param [Fixnum] start_change_id
|
387
|
+
# Deprecated - use pageToken instead.
|
388
|
+
# @param [Boolean] supports_all_drives
|
389
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
390
|
+
# @param [Boolean] supports_team_drives
|
391
|
+
# Deprecated use supportsAllDrives instead.
|
392
|
+
# @param [String] team_drive_id
|
393
|
+
# Deprecated use driveId instead.
|
394
|
+
# @param [String] fields
|
395
|
+
# Selector specifying which fields to include in a partial response.
|
396
|
+
# @param [String] quota_user
|
397
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
398
|
+
# characters.
|
399
|
+
# @param [String] user_ip
|
400
|
+
# Deprecated. Please use quotaUser instead.
|
401
|
+
# @param [Google::Apis::RequestOptions] options
|
402
|
+
# Request-specific options
|
403
|
+
#
|
404
|
+
# @yield [result, err] Result & error if block supplied
|
405
|
+
# @yieldparam result [Google::Apis::DriveV2::Channel] parsed result object
|
406
|
+
# @yieldparam err [StandardError] error object if request failed
|
407
|
+
#
|
408
|
+
# @return [Google::Apis::DriveV2::Channel]
|
409
|
+
#
|
410
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
411
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
412
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
413
|
+
def watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
414
|
+
command = make_simple_command(:post, 'changes/watch', options)
|
415
|
+
command.request_representation = Google::Apis::DriveV2::Channel::Representation
|
416
|
+
command.request_object = channel_object
|
417
|
+
command.response_representation = Google::Apis::DriveV2::Channel::Representation
|
418
|
+
command.response_class = Google::Apis::DriveV2::Channel
|
419
|
+
command.query['driveId'] = drive_id unless drive_id.nil?
|
420
|
+
command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
|
421
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
422
|
+
command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
|
423
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
424
|
+
command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
|
425
|
+
command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
|
426
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
427
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
428
|
+
command.query['spaces'] = spaces unless spaces.nil?
|
429
|
+
command.query['startChangeId'] = start_change_id unless start_change_id.nil?
|
430
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
431
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
432
|
+
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
433
|
+
command.query['fields'] = fields unless fields.nil?
|
434
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
435
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
436
|
+
execute_or_queue_command(command, &block)
|
437
|
+
end
|
438
|
+
|
439
|
+
# Stop watching resources through this channel
|
440
|
+
# @param [Google::Apis::DriveV2::Channel] channel_object
|
441
|
+
# @param [String] fields
|
442
|
+
# Selector specifying which fields to include in a partial response.
|
443
|
+
# @param [String] quota_user
|
444
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
445
|
+
# characters.
|
446
|
+
# @param [String] user_ip
|
447
|
+
# Deprecated. Please use quotaUser instead.
|
448
|
+
# @param [Google::Apis::RequestOptions] options
|
449
|
+
# Request-specific options
|
450
|
+
#
|
451
|
+
# @yield [result, err] Result & error if block supplied
|
452
|
+
# @yieldparam result [NilClass] No result returned for this method
|
453
|
+
# @yieldparam err [StandardError] error object if request failed
|
454
|
+
#
|
455
|
+
# @return [void]
|
456
|
+
#
|
457
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
458
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
459
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
460
|
+
def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
461
|
+
command = make_simple_command(:post, 'channels/stop', options)
|
462
|
+
command.request_representation = Google::Apis::DriveV2::Channel::Representation
|
463
|
+
command.request_object = channel_object
|
464
|
+
command.query['fields'] = fields unless fields.nil?
|
465
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
466
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
467
|
+
execute_or_queue_command(command, &block)
|
468
|
+
end
|
469
|
+
|
470
|
+
# Removes a child from a folder.
|
471
|
+
# @param [String] folder_id
|
472
|
+
# The ID of the folder.
|
473
|
+
# @param [String] child_id
|
474
|
+
# The ID of the child.
|
475
|
+
# @param [Boolean] enforce_single_parent
|
476
|
+
# Deprecated. If an item is not in a shared drive and its last parent is deleted
|
477
|
+
# but the item itself is not, the item will be placed under its owner's root.
|
478
|
+
# @param [String] fields
|
479
|
+
# Selector specifying which fields to include in a partial response.
|
480
|
+
# @param [String] quota_user
|
481
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
482
|
+
# characters.
|
483
|
+
# @param [String] user_ip
|
484
|
+
# Deprecated. Please use quotaUser instead.
|
485
|
+
# @param [Google::Apis::RequestOptions] options
|
486
|
+
# Request-specific options
|
487
|
+
#
|
488
|
+
# @yield [result, err] Result & error if block supplied
|
489
|
+
# @yieldparam result [NilClass] No result returned for this method
|
490
|
+
# @yieldparam err [StandardError] error object if request failed
|
491
|
+
#
|
492
|
+
# @return [void]
|
493
|
+
#
|
494
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
495
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
496
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
497
|
+
def delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
498
|
+
command = make_simple_command(:delete, 'files/{folderId}/children/{childId}', options)
|
499
|
+
command.params['folderId'] = folder_id unless folder_id.nil?
|
500
|
+
command.params['childId'] = child_id unless child_id.nil?
|
501
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
502
|
+
command.query['fields'] = fields unless fields.nil?
|
503
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
504
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
505
|
+
execute_or_queue_command(command, &block)
|
506
|
+
end
|
507
|
+
|
508
|
+
# Gets a specific child reference.
|
509
|
+
# @param [String] folder_id
|
510
|
+
# The ID of the folder.
|
511
|
+
# @param [String] child_id
|
512
|
+
# The ID of the child.
|
513
|
+
# @param [String] fields
|
514
|
+
# Selector specifying which fields to include in a partial response.
|
515
|
+
# @param [String] quota_user
|
516
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
517
|
+
# characters.
|
518
|
+
# @param [String] user_ip
|
519
|
+
# Deprecated. Please use quotaUser instead.
|
520
|
+
# @param [Google::Apis::RequestOptions] options
|
521
|
+
# Request-specific options
|
522
|
+
#
|
523
|
+
# @yield [result, err] Result & error if block supplied
|
524
|
+
# @yieldparam result [Google::Apis::DriveV2::ChildReference] parsed result object
|
525
|
+
# @yieldparam err [StandardError] error object if request failed
|
526
|
+
#
|
527
|
+
# @return [Google::Apis::DriveV2::ChildReference]
|
528
|
+
#
|
529
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
530
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
531
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
532
|
+
def get_child(folder_id, child_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
533
|
+
command = make_simple_command(:get, 'files/{folderId}/children/{childId}', options)
|
534
|
+
command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
|
535
|
+
command.response_class = Google::Apis::DriveV2::ChildReference
|
536
|
+
command.params['folderId'] = folder_id unless folder_id.nil?
|
537
|
+
command.params['childId'] = child_id unless child_id.nil?
|
538
|
+
command.query['fields'] = fields unless fields.nil?
|
539
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
540
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
541
|
+
execute_or_queue_command(command, &block)
|
542
|
+
end
|
543
|
+
|
544
|
+
# Inserts a file into a folder.
|
545
|
+
# @param [String] folder_id
|
546
|
+
# The ID of the folder.
|
547
|
+
# @param [Google::Apis::DriveV2::ChildReference] child_reference_object
|
548
|
+
# @param [Boolean] enforce_single_parent
|
549
|
+
# Deprecated. Adding files to multiple folders is no longer supported. Use
|
550
|
+
# shortcuts instead.
|
551
|
+
# @param [Boolean] supports_all_drives
|
552
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
553
|
+
# @param [Boolean] supports_team_drives
|
554
|
+
# Deprecated use supportsAllDrives instead.
|
555
|
+
# @param [String] fields
|
556
|
+
# Selector specifying which fields to include in a partial response.
|
557
|
+
# @param [String] quota_user
|
558
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
559
|
+
# characters.
|
560
|
+
# @param [String] user_ip
|
561
|
+
# Deprecated. Please use quotaUser instead.
|
562
|
+
# @param [Google::Apis::RequestOptions] options
|
563
|
+
# Request-specific options
|
564
|
+
#
|
565
|
+
# @yield [result, err] Result & error if block supplied
|
566
|
+
# @yieldparam result [Google::Apis::DriveV2::ChildReference] parsed result object
|
567
|
+
# @yieldparam err [StandardError] error object if request failed
|
568
|
+
#
|
569
|
+
# @return [Google::Apis::DriveV2::ChildReference]
|
570
|
+
#
|
571
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
572
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
573
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
574
|
+
def insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
575
|
+
command = make_simple_command(:post, 'files/{folderId}/children', options)
|
576
|
+
command.request_representation = Google::Apis::DriveV2::ChildReference::Representation
|
577
|
+
command.request_object = child_reference_object
|
578
|
+
command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
|
579
|
+
command.response_class = Google::Apis::DriveV2::ChildReference
|
580
|
+
command.params['folderId'] = folder_id unless folder_id.nil?
|
581
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
582
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
583
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
584
|
+
command.query['fields'] = fields unless fields.nil?
|
585
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
586
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
587
|
+
execute_or_queue_command(command, &block)
|
588
|
+
end
|
589
|
+
|
590
|
+
# Lists a folder's children.
|
591
|
+
# @param [String] folder_id
|
592
|
+
# The ID of the folder.
|
593
|
+
# @param [Fixnum] max_results
|
594
|
+
# Maximum number of children to return.
|
595
|
+
# @param [String] order_by
|
596
|
+
# A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', '
|
597
|
+
# lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', '
|
598
|
+
# recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending
|
599
|
+
# by default, but may be reversed with the 'desc' modifier. Example usage: ?
|
600
|
+
# orderBy=folder,modifiedDate desc,title. Please note that there is a current
|
601
|
+
# limitation for users with approximately one million files in which the
|
602
|
+
# requested sort order is ignored.
|
603
|
+
# @param [String] page_token
|
604
|
+
# Page token for children.
|
605
|
+
# @param [String] q
|
606
|
+
# Query string for searching children.
|
607
|
+
# @param [String] fields
|
608
|
+
# Selector specifying which fields to include in a partial response.
|
609
|
+
# @param [String] quota_user
|
610
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
611
|
+
# characters.
|
612
|
+
# @param [String] user_ip
|
613
|
+
# Deprecated. Please use quotaUser instead.
|
614
|
+
# @param [Google::Apis::RequestOptions] options
|
615
|
+
# Request-specific options
|
616
|
+
#
|
617
|
+
# @yield [result, err] Result & error if block supplied
|
618
|
+
# @yieldparam result [Google::Apis::DriveV2::ChildList] parsed result object
|
619
|
+
# @yieldparam err [StandardError] error object if request failed
|
620
|
+
#
|
621
|
+
# @return [Google::Apis::DriveV2::ChildList]
|
622
|
+
#
|
623
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
624
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
625
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
626
|
+
def list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
627
|
+
command = make_simple_command(:get, 'files/{folderId}/children', options)
|
628
|
+
command.response_representation = Google::Apis::DriveV2::ChildList::Representation
|
629
|
+
command.response_class = Google::Apis::DriveV2::ChildList
|
630
|
+
command.params['folderId'] = folder_id unless folder_id.nil?
|
631
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
632
|
+
command.query['orderBy'] = order_by unless order_by.nil?
|
633
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
634
|
+
command.query['q'] = q unless q.nil?
|
635
|
+
command.query['fields'] = fields unless fields.nil?
|
636
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
637
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
638
|
+
execute_or_queue_command(command, &block)
|
639
|
+
end
|
640
|
+
|
641
|
+
# Deletes a comment.
|
642
|
+
# @param [String] file_id
|
643
|
+
# The ID of the file.
|
644
|
+
# @param [String] comment_id
|
645
|
+
# The ID of the comment.
|
646
|
+
# @param [String] fields
|
647
|
+
# Selector specifying which fields to include in a partial response.
|
648
|
+
# @param [String] quota_user
|
649
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
650
|
+
# characters.
|
651
|
+
# @param [String] user_ip
|
652
|
+
# Deprecated. Please use quotaUser instead.
|
653
|
+
# @param [Google::Apis::RequestOptions] options
|
654
|
+
# Request-specific options
|
655
|
+
#
|
656
|
+
# @yield [result, err] Result & error if block supplied
|
657
|
+
# @yieldparam result [NilClass] No result returned for this method
|
658
|
+
# @yieldparam err [StandardError] error object if request failed
|
659
|
+
#
|
660
|
+
# @return [void]
|
661
|
+
#
|
662
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
663
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
664
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
665
|
+
def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
666
|
+
command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', options)
|
667
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
668
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
669
|
+
command.query['fields'] = fields unless fields.nil?
|
670
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
671
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
672
|
+
execute_or_queue_command(command, &block)
|
673
|
+
end
|
674
|
+
|
675
|
+
# Gets a comment by ID.
|
676
|
+
# @param [String] file_id
|
677
|
+
# The ID of the file.
|
678
|
+
# @param [String] comment_id
|
679
|
+
# The ID of the comment.
|
680
|
+
# @param [Boolean] include_deleted
|
681
|
+
# If set, this will succeed when retrieving a deleted comment, and will include
|
682
|
+
# any deleted replies.
|
683
|
+
# @param [String] fields
|
684
|
+
# Selector specifying which fields to include in a partial response.
|
685
|
+
# @param [String] quota_user
|
686
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
687
|
+
# characters.
|
688
|
+
# @param [String] user_ip
|
689
|
+
# Deprecated. Please use quotaUser instead.
|
690
|
+
# @param [Google::Apis::RequestOptions] options
|
691
|
+
# Request-specific options
|
692
|
+
#
|
693
|
+
# @yield [result, err] Result & error if block supplied
|
694
|
+
# @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
|
695
|
+
# @yieldparam err [StandardError] error object if request failed
|
696
|
+
#
|
697
|
+
# @return [Google::Apis::DriveV2::Comment]
|
698
|
+
#
|
699
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
700
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
701
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
702
|
+
def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
703
|
+
command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', options)
|
704
|
+
command.response_representation = Google::Apis::DriveV2::Comment::Representation
|
705
|
+
command.response_class = Google::Apis::DriveV2::Comment
|
706
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
707
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
708
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
709
|
+
command.query['fields'] = fields unless fields.nil?
|
710
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
711
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
712
|
+
execute_or_queue_command(command, &block)
|
713
|
+
end
|
714
|
+
|
715
|
+
# Creates a new comment on the given file.
|
716
|
+
# @param [String] file_id
|
717
|
+
# The ID of the file.
|
718
|
+
# @param [Google::Apis::DriveV2::Comment] comment_object
|
719
|
+
# @param [String] fields
|
720
|
+
# Selector specifying which fields to include in a partial response.
|
721
|
+
# @param [String] quota_user
|
722
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
723
|
+
# characters.
|
724
|
+
# @param [String] user_ip
|
725
|
+
# Deprecated. Please use quotaUser instead.
|
726
|
+
# @param [Google::Apis::RequestOptions] options
|
727
|
+
# Request-specific options
|
728
|
+
#
|
729
|
+
# @yield [result, err] Result & error if block supplied
|
730
|
+
# @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
|
731
|
+
# @yieldparam err [StandardError] error object if request failed
|
732
|
+
#
|
733
|
+
# @return [Google::Apis::DriveV2::Comment]
|
734
|
+
#
|
735
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
736
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
737
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
738
|
+
def insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
739
|
+
command = make_simple_command(:post, 'files/{fileId}/comments', options)
|
740
|
+
command.request_representation = Google::Apis::DriveV2::Comment::Representation
|
741
|
+
command.request_object = comment_object
|
742
|
+
command.response_representation = Google::Apis::DriveV2::Comment::Representation
|
743
|
+
command.response_class = Google::Apis::DriveV2::Comment
|
744
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
745
|
+
command.query['fields'] = fields unless fields.nil?
|
746
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
747
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
748
|
+
execute_or_queue_command(command, &block)
|
749
|
+
end
|
750
|
+
|
751
|
+
# Lists a file's comments.
|
752
|
+
# @param [String] file_id
|
753
|
+
# The ID of the file.
|
754
|
+
# @param [Boolean] include_deleted
|
755
|
+
# If set, all comments and replies, including deleted comments and replies (with
|
756
|
+
# content stripped) will be returned.
|
757
|
+
# @param [Fixnum] max_results
|
758
|
+
# The maximum number of discussions to include in the response, used for paging.
|
759
|
+
# @param [String] page_token
|
760
|
+
# The continuation token, used to page through large result sets. To get the
|
761
|
+
# next page of results, set this parameter to the value of "nextPageToken" from
|
762
|
+
# the previous response.
|
763
|
+
# @param [String] updated_min
|
764
|
+
# Only discussions that were updated after this timestamp will be returned.
|
765
|
+
# Formatted as an RFC 3339 timestamp.
|
766
|
+
# @param [String] fields
|
767
|
+
# Selector specifying which fields to include in a partial response.
|
768
|
+
# @param [String] quota_user
|
769
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
770
|
+
# characters.
|
771
|
+
# @param [String] user_ip
|
772
|
+
# Deprecated. Please use quotaUser instead.
|
773
|
+
# @param [Google::Apis::RequestOptions] options
|
774
|
+
# Request-specific options
|
775
|
+
#
|
776
|
+
# @yield [result, err] Result & error if block supplied
|
777
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentList] parsed result object
|
778
|
+
# @yieldparam err [StandardError] error object if request failed
|
779
|
+
#
|
780
|
+
# @return [Google::Apis::DriveV2::CommentList]
|
781
|
+
#
|
782
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
783
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
784
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
785
|
+
def list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
786
|
+
command = make_simple_command(:get, 'files/{fileId}/comments', options)
|
787
|
+
command.response_representation = Google::Apis::DriveV2::CommentList::Representation
|
788
|
+
command.response_class = Google::Apis::DriveV2::CommentList
|
789
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
790
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
791
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
792
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
793
|
+
command.query['updatedMin'] = updated_min unless updated_min.nil?
|
794
|
+
command.query['fields'] = fields unless fields.nil?
|
795
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
796
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
797
|
+
execute_or_queue_command(command, &block)
|
798
|
+
end
|
799
|
+
|
800
|
+
# Updates an existing comment.
|
801
|
+
# @param [String] file_id
|
802
|
+
# The ID of the file.
|
803
|
+
# @param [String] comment_id
|
804
|
+
# The ID of the comment.
|
805
|
+
# @param [Google::Apis::DriveV2::Comment] comment_object
|
806
|
+
# @param [String] fields
|
807
|
+
# Selector specifying which fields to include in a partial response.
|
808
|
+
# @param [String] quota_user
|
809
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
810
|
+
# characters.
|
811
|
+
# @param [String] user_ip
|
812
|
+
# Deprecated. Please use quotaUser instead.
|
813
|
+
# @param [Google::Apis::RequestOptions] options
|
814
|
+
# Request-specific options
|
815
|
+
#
|
816
|
+
# @yield [result, err] Result & error if block supplied
|
817
|
+
# @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
|
818
|
+
# @yieldparam err [StandardError] error object if request failed
|
819
|
+
#
|
820
|
+
# @return [Google::Apis::DriveV2::Comment]
|
821
|
+
#
|
822
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
823
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
824
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
825
|
+
def patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
826
|
+
command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', options)
|
827
|
+
command.request_representation = Google::Apis::DriveV2::Comment::Representation
|
828
|
+
command.request_object = comment_object
|
829
|
+
command.response_representation = Google::Apis::DriveV2::Comment::Representation
|
830
|
+
command.response_class = Google::Apis::DriveV2::Comment
|
831
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
832
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
833
|
+
command.query['fields'] = fields unless fields.nil?
|
834
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
835
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
836
|
+
execute_or_queue_command(command, &block)
|
837
|
+
end
|
838
|
+
|
839
|
+
# Updates an existing comment.
|
840
|
+
# @param [String] file_id
|
841
|
+
# The ID of the file.
|
842
|
+
# @param [String] comment_id
|
843
|
+
# The ID of the comment.
|
844
|
+
# @param [Google::Apis::DriveV2::Comment] comment_object
|
845
|
+
# @param [String] fields
|
846
|
+
# Selector specifying which fields to include in a partial response.
|
847
|
+
# @param [String] quota_user
|
848
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
849
|
+
# characters.
|
850
|
+
# @param [String] user_ip
|
851
|
+
# Deprecated. Please use quotaUser instead.
|
852
|
+
# @param [Google::Apis::RequestOptions] options
|
853
|
+
# Request-specific options
|
854
|
+
#
|
855
|
+
# @yield [result, err] Result & error if block supplied
|
856
|
+
# @yieldparam result [Google::Apis::DriveV2::Comment] parsed result object
|
857
|
+
# @yieldparam err [StandardError] error object if request failed
|
858
|
+
#
|
859
|
+
# @return [Google::Apis::DriveV2::Comment]
|
860
|
+
#
|
861
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
862
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
863
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
864
|
+
def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
865
|
+
command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}', options)
|
866
|
+
command.request_representation = Google::Apis::DriveV2::Comment::Representation
|
867
|
+
command.request_object = comment_object
|
868
|
+
command.response_representation = Google::Apis::DriveV2::Comment::Representation
|
869
|
+
command.response_class = Google::Apis::DriveV2::Comment
|
870
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
871
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
872
|
+
command.query['fields'] = fields unless fields.nil?
|
873
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
874
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
875
|
+
execute_or_queue_command(command, &block)
|
876
|
+
end
|
877
|
+
|
878
|
+
# Permanently deletes a shared drive for which the user is an organizer. The
|
879
|
+
# shared drive cannot contain any untrashed items.
|
880
|
+
# @param [String] drive_id
|
881
|
+
# The ID of the shared drive.
|
882
|
+
# @param [String] fields
|
883
|
+
# Selector specifying which fields to include in a partial response.
|
884
|
+
# @param [String] quota_user
|
885
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
886
|
+
# characters.
|
887
|
+
# @param [String] user_ip
|
888
|
+
# Deprecated. Please use quotaUser instead.
|
889
|
+
# @param [Google::Apis::RequestOptions] options
|
890
|
+
# Request-specific options
|
891
|
+
#
|
892
|
+
# @yield [result, err] Result & error if block supplied
|
893
|
+
# @yieldparam result [NilClass] No result returned for this method
|
894
|
+
# @yieldparam err [StandardError] error object if request failed
|
895
|
+
#
|
896
|
+
# @return [void]
|
897
|
+
#
|
898
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
899
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
900
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
901
|
+
def delete_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
902
|
+
command = make_simple_command(:delete, 'drives/{driveId}', options)
|
903
|
+
command.params['driveId'] = drive_id unless drive_id.nil?
|
904
|
+
command.query['fields'] = fields unless fields.nil?
|
905
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
906
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
907
|
+
execute_or_queue_command(command, &block)
|
908
|
+
end
|
909
|
+
|
910
|
+
# Gets a shared drive's metadata by ID.
|
911
|
+
# @param [String] drive_id
|
912
|
+
# The ID of the shared drive.
|
913
|
+
# @param [Boolean] use_domain_admin_access
|
914
|
+
# Issue the request as a domain administrator; if set to true, then the
|
915
|
+
# requester will be granted access if they are an administrator of the domain to
|
916
|
+
# which the shared drive belongs.
|
917
|
+
# @param [String] fields
|
918
|
+
# Selector specifying which fields to include in a partial response.
|
919
|
+
# @param [String] quota_user
|
920
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
921
|
+
# characters.
|
922
|
+
# @param [String] user_ip
|
923
|
+
# Deprecated. Please use quotaUser instead.
|
924
|
+
# @param [Google::Apis::RequestOptions] options
|
925
|
+
# Request-specific options
|
926
|
+
#
|
927
|
+
# @yield [result, err] Result & error if block supplied
|
928
|
+
# @yieldparam result [Google::Apis::DriveV2::Drive] parsed result object
|
929
|
+
# @yieldparam err [StandardError] error object if request failed
|
930
|
+
#
|
931
|
+
# @return [Google::Apis::DriveV2::Drive]
|
932
|
+
#
|
933
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
934
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
935
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
936
|
+
def get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
937
|
+
command = make_simple_command(:get, 'drives/{driveId}', options)
|
938
|
+
command.response_representation = Google::Apis::DriveV2::Drive::Representation
|
939
|
+
command.response_class = Google::Apis::DriveV2::Drive
|
940
|
+
command.params['driveId'] = drive_id unless drive_id.nil?
|
941
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
942
|
+
command.query['fields'] = fields unless fields.nil?
|
943
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
944
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
945
|
+
execute_or_queue_command(command, &block)
|
946
|
+
end
|
947
|
+
|
948
|
+
# Hides a shared drive from the default view.
|
949
|
+
# @param [String] drive_id
|
950
|
+
# The ID of the shared drive.
|
951
|
+
# @param [String] fields
|
952
|
+
# Selector specifying which fields to include in a partial response.
|
953
|
+
# @param [String] quota_user
|
954
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
955
|
+
# characters.
|
956
|
+
# @param [String] user_ip
|
957
|
+
# Deprecated. Please use quotaUser instead.
|
958
|
+
# @param [Google::Apis::RequestOptions] options
|
959
|
+
# Request-specific options
|
960
|
+
#
|
961
|
+
# @yield [result, err] Result & error if block supplied
|
962
|
+
# @yieldparam result [Google::Apis::DriveV2::Drive] parsed result object
|
963
|
+
# @yieldparam err [StandardError] error object if request failed
|
964
|
+
#
|
965
|
+
# @return [Google::Apis::DriveV2::Drive]
|
966
|
+
#
|
967
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
968
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
969
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
970
|
+
def hide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
971
|
+
command = make_simple_command(:post, 'drives/{driveId}/hide', options)
|
972
|
+
command.response_representation = Google::Apis::DriveV2::Drive::Representation
|
973
|
+
command.response_class = Google::Apis::DriveV2::Drive
|
974
|
+
command.params['driveId'] = drive_id unless drive_id.nil?
|
975
|
+
command.query['fields'] = fields unless fields.nil?
|
976
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
977
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
978
|
+
execute_or_queue_command(command, &block)
|
979
|
+
end
|
980
|
+
|
981
|
+
# Creates a new shared drive.
|
982
|
+
# @param [String] request_id
|
983
|
+
# An ID, such as a random UUID, which uniquely identifies this user's request
|
984
|
+
# for idempotent creation of a shared drive. A repeated request by the same user
|
985
|
+
# and with the same request ID will avoid creating duplicates by attempting to
|
986
|
+
# create the same shared drive. If the shared drive already exists a 409 error
|
987
|
+
# will be returned.
|
988
|
+
# @param [Google::Apis::DriveV2::Drive] drive_object
|
989
|
+
# @param [String] fields
|
990
|
+
# Selector specifying which fields to include in a partial response.
|
991
|
+
# @param [String] quota_user
|
992
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
993
|
+
# characters.
|
994
|
+
# @param [String] user_ip
|
995
|
+
# Deprecated. Please use quotaUser instead.
|
996
|
+
# @param [Google::Apis::RequestOptions] options
|
997
|
+
# Request-specific options
|
998
|
+
#
|
999
|
+
# @yield [result, err] Result & error if block supplied
|
1000
|
+
# @yieldparam result [Google::Apis::DriveV2::Drive] parsed result object
|
1001
|
+
# @yieldparam err [StandardError] error object if request failed
|
1002
|
+
#
|
1003
|
+
# @return [Google::Apis::DriveV2::Drive]
|
1004
|
+
#
|
1005
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1006
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1007
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1008
|
+
def insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1009
|
+
command = make_simple_command(:post, 'drives', options)
|
1010
|
+
command.request_representation = Google::Apis::DriveV2::Drive::Representation
|
1011
|
+
command.request_object = drive_object
|
1012
|
+
command.response_representation = Google::Apis::DriveV2::Drive::Representation
|
1013
|
+
command.response_class = Google::Apis::DriveV2::Drive
|
1014
|
+
command.query['requestId'] = request_id unless request_id.nil?
|
1015
|
+
command.query['fields'] = fields unless fields.nil?
|
1016
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1017
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1018
|
+
execute_or_queue_command(command, &block)
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
# Lists the user's shared drives.
|
1022
|
+
# @param [Fixnum] max_results
|
1023
|
+
# Maximum number of shared drives to return.
|
1024
|
+
# @param [String] page_token
|
1025
|
+
# Page token for shared drives.
|
1026
|
+
# @param [String] q
|
1027
|
+
# Query string for searching shared drives.
|
1028
|
+
# @param [Boolean] use_domain_admin_access
|
1029
|
+
# Issue the request as a domain administrator; if set to true, then all shared
|
1030
|
+
# drives of the domain in which the requester is an administrator are returned.
|
1031
|
+
# @param [String] fields
|
1032
|
+
# Selector specifying which fields to include in a partial response.
|
1033
|
+
# @param [String] quota_user
|
1034
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1035
|
+
# characters.
|
1036
|
+
# @param [String] user_ip
|
1037
|
+
# Deprecated. Please use quotaUser instead.
|
1038
|
+
# @param [Google::Apis::RequestOptions] options
|
1039
|
+
# Request-specific options
|
1040
|
+
#
|
1041
|
+
# @yield [result, err] Result & error if block supplied
|
1042
|
+
# @yieldparam result [Google::Apis::DriveV2::DriveList] parsed result object
|
1043
|
+
# @yieldparam err [StandardError] error object if request failed
|
1044
|
+
#
|
1045
|
+
# @return [Google::Apis::DriveV2::DriveList]
|
1046
|
+
#
|
1047
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1048
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1049
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1050
|
+
def list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1051
|
+
command = make_simple_command(:get, 'drives', options)
|
1052
|
+
command.response_representation = Google::Apis::DriveV2::DriveList::Representation
|
1053
|
+
command.response_class = Google::Apis::DriveV2::DriveList
|
1054
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
1055
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
1056
|
+
command.query['q'] = q unless q.nil?
|
1057
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
1058
|
+
command.query['fields'] = fields unless fields.nil?
|
1059
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1060
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1061
|
+
execute_or_queue_command(command, &block)
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
# Restores a shared drive to the default view.
|
1065
|
+
# @param [String] drive_id
|
1066
|
+
# The ID of the shared drive.
|
1067
|
+
# @param [String] fields
|
1068
|
+
# Selector specifying which fields to include in a partial response.
|
1069
|
+
# @param [String] quota_user
|
1070
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1071
|
+
# characters.
|
1072
|
+
# @param [String] user_ip
|
1073
|
+
# Deprecated. Please use quotaUser instead.
|
1074
|
+
# @param [Google::Apis::RequestOptions] options
|
1075
|
+
# Request-specific options
|
1076
|
+
#
|
1077
|
+
# @yield [result, err] Result & error if block supplied
|
1078
|
+
# @yieldparam result [Google::Apis::DriveV2::Drive] parsed result object
|
1079
|
+
# @yieldparam err [StandardError] error object if request failed
|
1080
|
+
#
|
1081
|
+
# @return [Google::Apis::DriveV2::Drive]
|
1082
|
+
#
|
1083
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1084
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1085
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1086
|
+
def unhide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1087
|
+
command = make_simple_command(:post, 'drives/{driveId}/unhide', options)
|
1088
|
+
command.response_representation = Google::Apis::DriveV2::Drive::Representation
|
1089
|
+
command.response_class = Google::Apis::DriveV2::Drive
|
1090
|
+
command.params['driveId'] = drive_id unless drive_id.nil?
|
1091
|
+
command.query['fields'] = fields unless fields.nil?
|
1092
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1093
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1094
|
+
execute_or_queue_command(command, &block)
|
1095
|
+
end
|
1096
|
+
|
1097
|
+
# Updates the metadata for a shared drive.
|
1098
|
+
# @param [String] drive_id
|
1099
|
+
# The ID of the shared drive.
|
1100
|
+
# @param [Google::Apis::DriveV2::Drive] drive_object
|
1101
|
+
# @param [Boolean] use_domain_admin_access
|
1102
|
+
# Issue the request as a domain administrator; if set to true, then the
|
1103
|
+
# requester will be granted access if they are an administrator of the domain to
|
1104
|
+
# which the shared drive belongs.
|
1105
|
+
# @param [String] fields
|
1106
|
+
# Selector specifying which fields to include in a partial response.
|
1107
|
+
# @param [String] quota_user
|
1108
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1109
|
+
# characters.
|
1110
|
+
# @param [String] user_ip
|
1111
|
+
# Deprecated. Please use quotaUser instead.
|
1112
|
+
# @param [Google::Apis::RequestOptions] options
|
1113
|
+
# Request-specific options
|
1114
|
+
#
|
1115
|
+
# @yield [result, err] Result & error if block supplied
|
1116
|
+
# @yieldparam result [Google::Apis::DriveV2::Drive] parsed result object
|
1117
|
+
# @yieldparam err [StandardError] error object if request failed
|
1118
|
+
#
|
1119
|
+
# @return [Google::Apis::DriveV2::Drive]
|
1120
|
+
#
|
1121
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1122
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1123
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1124
|
+
def update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1125
|
+
command = make_simple_command(:put, 'drives/{driveId}', options)
|
1126
|
+
command.request_representation = Google::Apis::DriveV2::Drive::Representation
|
1127
|
+
command.request_object = drive_object
|
1128
|
+
command.response_representation = Google::Apis::DriveV2::Drive::Representation
|
1129
|
+
command.response_class = Google::Apis::DriveV2::Drive
|
1130
|
+
command.params['driveId'] = drive_id unless drive_id.nil?
|
1131
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
1132
|
+
command.query['fields'] = fields unless fields.nil?
|
1133
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1134
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1135
|
+
execute_or_queue_command(command, &block)
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
# Creates a copy of the specified file. Folders cannot be copied.
|
1139
|
+
# @param [String] file_id
|
1140
|
+
# The ID of the file to copy.
|
1141
|
+
# @param [Google::Apis::DriveV2::File] file_object
|
1142
|
+
# @param [Boolean] convert
|
1143
|
+
# Whether to convert this file to the corresponding Docs Editors format.
|
1144
|
+
# @param [Boolean] enforce_single_parent
|
1145
|
+
# Deprecated. Copying files into multiple folders is no longer supported. Use
|
1146
|
+
# shortcuts instead.
|
1147
|
+
# @param [String] include_permissions_for_view
|
1148
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1149
|
+
# 'published' is supported.
|
1150
|
+
# @param [Boolean] ocr
|
1151
|
+
# Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
|
1152
|
+
# @param [String] ocr_language
|
1153
|
+
# If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
|
1154
|
+
# @param [Boolean] pinned
|
1155
|
+
# Whether to pin the head revision of the new copy. A file can have a maximum of
|
1156
|
+
# 200 pinned revisions.
|
1157
|
+
# @param [Boolean] supports_all_drives
|
1158
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1159
|
+
# @param [Boolean] supports_team_drives
|
1160
|
+
# Deprecated use supportsAllDrives instead.
|
1161
|
+
# @param [String] timed_text_language
|
1162
|
+
# The language of the timed text.
|
1163
|
+
# @param [String] timed_text_track_name
|
1164
|
+
# The timed text track name.
|
1165
|
+
# @param [String] visibility
|
1166
|
+
# The visibility of the new file. This parameter is only relevant when the
|
1167
|
+
# source is not a native Google Doc and convert=false.
|
1168
|
+
# @param [String] fields
|
1169
|
+
# Selector specifying which fields to include in a partial response.
|
1170
|
+
# @param [String] quota_user
|
1171
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1172
|
+
# characters.
|
1173
|
+
# @param [String] user_ip
|
1174
|
+
# Deprecated. Please use quotaUser instead.
|
1175
|
+
# @param [Google::Apis::RequestOptions] options
|
1176
|
+
# Request-specific options
|
1177
|
+
#
|
1178
|
+
# @yield [result, err] Result & error if block supplied
|
1179
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1180
|
+
# @yieldparam err [StandardError] error object if request failed
|
1181
|
+
#
|
1182
|
+
# @return [Google::Apis::DriveV2::File]
|
1183
|
+
#
|
1184
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1185
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1186
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1187
|
+
def copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1188
|
+
command = make_simple_command(:post, 'files/{fileId}/copy', options)
|
1189
|
+
command.request_representation = Google::Apis::DriveV2::File::Representation
|
1190
|
+
command.request_object = file_object
|
1191
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1192
|
+
command.response_class = Google::Apis::DriveV2::File
|
1193
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1194
|
+
command.query['convert'] = convert unless convert.nil?
|
1195
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1196
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1197
|
+
command.query['ocr'] = ocr unless ocr.nil?
|
1198
|
+
command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
|
1199
|
+
command.query['pinned'] = pinned unless pinned.nil?
|
1200
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1201
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1202
|
+
command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
|
1203
|
+
command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
|
1204
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
1205
|
+
command.query['fields'] = fields unless fields.nil?
|
1206
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1207
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1208
|
+
execute_or_queue_command(command, &block)
|
1209
|
+
end
|
1210
|
+
|
1211
|
+
# Permanently deletes a file by ID. Skips the trash. The currently authenticated
|
1212
|
+
# user must own the file or be an organizer on the parent for shared drive files.
|
1213
|
+
# @param [String] file_id
|
1214
|
+
# The ID of the file to delete.
|
1215
|
+
# @param [Boolean] enforce_single_parent
|
1216
|
+
# Deprecated. If an item is not in a shared drive and its last parent is deleted
|
1217
|
+
# but the item itself is not, the item will be placed under its owner's root.
|
1218
|
+
# @param [Boolean] supports_all_drives
|
1219
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1220
|
+
# @param [Boolean] supports_team_drives
|
1221
|
+
# Deprecated use supportsAllDrives instead.
|
1222
|
+
# @param [String] fields
|
1223
|
+
# Selector specifying which fields to include in a partial response.
|
1224
|
+
# @param [String] quota_user
|
1225
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1226
|
+
# characters.
|
1227
|
+
# @param [String] user_ip
|
1228
|
+
# Deprecated. Please use quotaUser instead.
|
1229
|
+
# @param [Google::Apis::RequestOptions] options
|
1230
|
+
# Request-specific options
|
1231
|
+
#
|
1232
|
+
# @yield [result, err] Result & error if block supplied
|
1233
|
+
# @yieldparam result [NilClass] No result returned for this method
|
1234
|
+
# @yieldparam err [StandardError] error object if request failed
|
1235
|
+
#
|
1236
|
+
# @return [void]
|
1237
|
+
#
|
1238
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1239
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1240
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1241
|
+
def delete_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1242
|
+
command = make_simple_command(:delete, 'files/{fileId}', options)
|
1243
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1244
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1245
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1246
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1247
|
+
command.query['fields'] = fields unless fields.nil?
|
1248
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1249
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1250
|
+
execute_or_queue_command(command, &block)
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
# Permanently deletes all of the user's trashed files.
|
1254
|
+
# @param [Boolean] enforce_single_parent
|
1255
|
+
# Deprecated. If an item is not in a shared drive and its last parent is deleted
|
1256
|
+
# but the item itself is not, the item will be placed under its owner's root.
|
1257
|
+
# @param [String] fields
|
1258
|
+
# Selector specifying which fields to include in a partial response.
|
1259
|
+
# @param [String] quota_user
|
1260
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1261
|
+
# characters.
|
1262
|
+
# @param [String] user_ip
|
1263
|
+
# Deprecated. Please use quotaUser instead.
|
1264
|
+
# @param [Google::Apis::RequestOptions] options
|
1265
|
+
# Request-specific options
|
1266
|
+
#
|
1267
|
+
# @yield [result, err] Result & error if block supplied
|
1268
|
+
# @yieldparam result [NilClass] No result returned for this method
|
1269
|
+
# @yieldparam err [StandardError] error object if request failed
|
1270
|
+
#
|
1271
|
+
# @return [void]
|
1272
|
+
#
|
1273
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1274
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1275
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1276
|
+
def empty_trash(enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1277
|
+
command = make_simple_command(:delete, 'files/trash', options)
|
1278
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1279
|
+
command.query['fields'] = fields unless fields.nil?
|
1280
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1281
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1282
|
+
execute_or_queue_command(command, &block)
|
1283
|
+
end
|
1284
|
+
|
1285
|
+
# Exports a Google Doc to the requested MIME type and returns the exported
|
1286
|
+
# content. Please note that the exported content is limited to 10MB.
|
1287
|
+
# @param [String] file_id
|
1288
|
+
# The ID of the file.
|
1289
|
+
# @param [String] mime_type
|
1290
|
+
# The MIME type of the format requested for this export.
|
1291
|
+
# @param [String] fields
|
1292
|
+
# Selector specifying which fields to include in a partial response.
|
1293
|
+
# @param [String] quota_user
|
1294
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1295
|
+
# characters.
|
1296
|
+
# @param [String] user_ip
|
1297
|
+
# Deprecated. Please use quotaUser instead.
|
1298
|
+
# @param [IO, String] download_dest
|
1299
|
+
# IO stream or filename to receive content download
|
1300
|
+
# @param [Google::Apis::RequestOptions] options
|
1301
|
+
# Request-specific options
|
1302
|
+
#
|
1303
|
+
# @yield [result, err] Result & error if block supplied
|
1304
|
+
# @yieldparam result [NilClass] No result returned for this method
|
1305
|
+
# @yieldparam err [StandardError] error object if request failed
|
1306
|
+
#
|
1307
|
+
# @return [void]
|
1308
|
+
#
|
1309
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1310
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1311
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1312
|
+
def export_file(file_id, mime_type, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
|
1313
|
+
if download_dest.nil?
|
1314
|
+
command = make_simple_command(:get, 'files/{fileId}/export', options)
|
1315
|
+
else
|
1316
|
+
command = make_download_command(:get, 'files/{fileId}/export', options)
|
1317
|
+
command.download_dest = download_dest
|
1318
|
+
end
|
1319
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1320
|
+
command.query['mimeType'] = mime_type unless mime_type.nil?
|
1321
|
+
command.query['fields'] = fields unless fields.nil?
|
1322
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1323
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1324
|
+
execute_or_queue_command(command, &block)
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
# Generates a set of file IDs which can be provided in insert or copy requests.
|
1328
|
+
# @param [Fixnum] max_results
|
1329
|
+
# Maximum number of IDs to return.
|
1330
|
+
# @param [String] space
|
1331
|
+
# The space in which the IDs can be used to create new files. Supported values
|
1332
|
+
# are 'drive' and 'appDataFolder'.
|
1333
|
+
# @param [String] fields
|
1334
|
+
# Selector specifying which fields to include in a partial response.
|
1335
|
+
# @param [String] quota_user
|
1336
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1337
|
+
# characters.
|
1338
|
+
# @param [String] user_ip
|
1339
|
+
# Deprecated. Please use quotaUser instead.
|
1340
|
+
# @param [Google::Apis::RequestOptions] options
|
1341
|
+
# Request-specific options
|
1342
|
+
#
|
1343
|
+
# @yield [result, err] Result & error if block supplied
|
1344
|
+
# @yieldparam result [Google::Apis::DriveV2::GeneratedIds] parsed result object
|
1345
|
+
# @yieldparam err [StandardError] error object if request failed
|
1346
|
+
#
|
1347
|
+
# @return [Google::Apis::DriveV2::GeneratedIds]
|
1348
|
+
#
|
1349
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1350
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1351
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1352
|
+
def generate_file_ids(max_results: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1353
|
+
command = make_simple_command(:get, 'files/generateIds', options)
|
1354
|
+
command.response_representation = Google::Apis::DriveV2::GeneratedIds::Representation
|
1355
|
+
command.response_class = Google::Apis::DriveV2::GeneratedIds
|
1356
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
1357
|
+
command.query['space'] = space unless space.nil?
|
1358
|
+
command.query['fields'] = fields unless fields.nil?
|
1359
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1360
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1361
|
+
execute_or_queue_command(command, &block)
|
1362
|
+
end
|
1363
|
+
|
1364
|
+
# Gets a file's metadata by ID.
|
1365
|
+
# @param [String] file_id
|
1366
|
+
# The ID for the file in question.
|
1367
|
+
# @param [Boolean] acknowledge_abuse
|
1368
|
+
# Whether the user is acknowledging the risk of downloading known malware or
|
1369
|
+
# other abusive files.
|
1370
|
+
# @param [String] include_permissions_for_view
|
1371
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1372
|
+
# 'published' is supported.
|
1373
|
+
# @param [String] projection
|
1374
|
+
# This parameter is deprecated and has no function.
|
1375
|
+
# @param [String] revision_id
|
1376
|
+
# Specifies the Revision ID that should be downloaded. Ignored unless alt=media
|
1377
|
+
# is specified.
|
1378
|
+
# @param [Boolean] supports_all_drives
|
1379
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1380
|
+
# @param [Boolean] supports_team_drives
|
1381
|
+
# Deprecated use supportsAllDrives instead.
|
1382
|
+
# @param [Boolean] update_viewed_date
|
1383
|
+
# Deprecated: Use files.update with modifiedDateBehavior=noChange,
|
1384
|
+
# updateViewedDate=true and an empty request body.
|
1385
|
+
# @param [String] fields
|
1386
|
+
# Selector specifying which fields to include in a partial response.
|
1387
|
+
# @param [String] quota_user
|
1388
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1389
|
+
# characters.
|
1390
|
+
# @param [String] user_ip
|
1391
|
+
# Deprecated. Please use quotaUser instead.
|
1392
|
+
# @param [IO, String] download_dest
|
1393
|
+
# IO stream or filename to receive content download
|
1394
|
+
# @param [Google::Apis::RequestOptions] options
|
1395
|
+
# Request-specific options
|
1396
|
+
#
|
1397
|
+
# @yield [result, err] Result & error if block supplied
|
1398
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1399
|
+
# @yieldparam err [StandardError] error object if request failed
|
1400
|
+
#
|
1401
|
+
# @return [Google::Apis::DriveV2::File]
|
1402
|
+
#
|
1403
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1404
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1405
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1406
|
+
def get_file(file_id, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
|
1407
|
+
if download_dest.nil?
|
1408
|
+
command = make_simple_command(:get, 'files/{fileId}', options)
|
1409
|
+
else
|
1410
|
+
command = make_download_command(:get, 'files/{fileId}', options)
|
1411
|
+
command.download_dest = download_dest
|
1412
|
+
end
|
1413
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1414
|
+
command.response_class = Google::Apis::DriveV2::File
|
1415
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1416
|
+
command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
|
1417
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1418
|
+
command.query['projection'] = projection unless projection.nil?
|
1419
|
+
command.query['revisionId'] = revision_id unless revision_id.nil?
|
1420
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1421
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1422
|
+
command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
|
1423
|
+
command.query['fields'] = fields unless fields.nil?
|
1424
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1425
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1426
|
+
execute_or_queue_command(command, &block)
|
1427
|
+
end
|
1428
|
+
|
1429
|
+
# Insert a new file.
|
1430
|
+
# @param [Google::Apis::DriveV2::File] file_object
|
1431
|
+
# @param [Boolean] convert
|
1432
|
+
# Whether to convert this file to the corresponding Docs Editors format.
|
1433
|
+
# @param [Boolean] enforce_single_parent
|
1434
|
+
# Deprecated. Creating files in multiple folders is no longer supported.
|
1435
|
+
# @param [String] include_permissions_for_view
|
1436
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1437
|
+
# 'published' is supported.
|
1438
|
+
# @param [Boolean] ocr
|
1439
|
+
# Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
|
1440
|
+
# @param [String] ocr_language
|
1441
|
+
# If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
|
1442
|
+
# @param [Boolean] pinned
|
1443
|
+
# Whether to pin the head revision of the uploaded file. A file can have a
|
1444
|
+
# maximum of 200 pinned revisions.
|
1445
|
+
# @param [Boolean] supports_all_drives
|
1446
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1447
|
+
# @param [Boolean] supports_team_drives
|
1448
|
+
# Deprecated use supportsAllDrives instead.
|
1449
|
+
# @param [String] timed_text_language
|
1450
|
+
# The language of the timed text.
|
1451
|
+
# @param [String] timed_text_track_name
|
1452
|
+
# The timed text track name.
|
1453
|
+
# @param [Boolean] use_content_as_indexable_text
|
1454
|
+
# Whether to use the content as indexable text.
|
1455
|
+
# @param [String] visibility
|
1456
|
+
# The visibility of the new file. This parameter is only relevant when convert=
|
1457
|
+
# false.
|
1458
|
+
# @param [String] fields
|
1459
|
+
# Selector specifying which fields to include in a partial response.
|
1460
|
+
# @param [String] quota_user
|
1461
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1462
|
+
# characters.
|
1463
|
+
# @param [String] user_ip
|
1464
|
+
# Deprecated. Please use quotaUser instead.
|
1465
|
+
# @param [IO, String] upload_source
|
1466
|
+
# IO stream or filename containing content to upload
|
1467
|
+
# @param [String] content_type
|
1468
|
+
# Content type of the uploaded content.
|
1469
|
+
# @param [Google::Apis::RequestOptions] options
|
1470
|
+
# Request-specific options
|
1471
|
+
#
|
1472
|
+
# @yield [result, err] Result & error if block supplied
|
1473
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1474
|
+
# @yieldparam err [StandardError] error object if request failed
|
1475
|
+
#
|
1476
|
+
# @return [Google::Apis::DriveV2::File]
|
1477
|
+
#
|
1478
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1479
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1480
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1481
|
+
def insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
|
1482
|
+
if upload_source.nil?
|
1483
|
+
command = make_simple_command(:post, 'files', options)
|
1484
|
+
else
|
1485
|
+
command = make_upload_command(:post, 'files', options)
|
1486
|
+
command.upload_source = upload_source
|
1487
|
+
command.upload_content_type = content_type
|
1488
|
+
end
|
1489
|
+
command.request_representation = Google::Apis::DriveV2::File::Representation
|
1490
|
+
command.request_object = file_object
|
1491
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1492
|
+
command.response_class = Google::Apis::DriveV2::File
|
1493
|
+
command.query['convert'] = convert unless convert.nil?
|
1494
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1495
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1496
|
+
command.query['ocr'] = ocr unless ocr.nil?
|
1497
|
+
command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
|
1498
|
+
command.query['pinned'] = pinned unless pinned.nil?
|
1499
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1500
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1501
|
+
command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
|
1502
|
+
command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
|
1503
|
+
command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
|
1504
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
1505
|
+
command.query['fields'] = fields unless fields.nil?
|
1506
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1507
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1508
|
+
execute_or_queue_command(command, &block)
|
1509
|
+
end
|
1510
|
+
|
1511
|
+
# Lists the user's files.
|
1512
|
+
# @param [String] corpora
|
1513
|
+
# Groupings of files to which the query applies. Supported groupings are: 'user'
|
1514
|
+
# (files created by, opened by, or shared directly with the user), 'drive' (
|
1515
|
+
# files in the specified shared drive as indicated by the 'driveId'), 'domain' (
|
1516
|
+
# files shared to the user's domain), and 'allDrives' (A combination of 'user'
|
1517
|
+
# and 'drive' for all drives where the user is a member). When able, use 'user'
|
1518
|
+
# or 'drive', instead of 'allDrives', for efficiency.
|
1519
|
+
# @param [String] corpus
|
1520
|
+
# The body of items (files/documents) to which the query applies. Deprecated:
|
1521
|
+
# use 'corpora' instead.
|
1522
|
+
# @param [String] drive_id
|
1523
|
+
# ID of the shared drive to search.
|
1524
|
+
# @param [Boolean] include_items_from_all_drives
|
1525
|
+
# Whether both My Drive and shared drive items should be included in results.
|
1526
|
+
# @param [String] include_permissions_for_view
|
1527
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1528
|
+
# 'published' is supported.
|
1529
|
+
# @param [Boolean] include_team_drive_items
|
1530
|
+
# Deprecated use includeItemsFromAllDrives instead.
|
1531
|
+
# @param [Fixnum] max_results
|
1532
|
+
# The maximum number of files to return per page. Partial or empty result pages
|
1533
|
+
# are possible even before the end of the files list has been reached.
|
1534
|
+
# @param [String] order_by
|
1535
|
+
# A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', '
|
1536
|
+
# lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', '
|
1537
|
+
# recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each
|
1538
|
+
# key sorts ascending by default, but may be reversed with the 'desc' modifier.
|
1539
|
+
# Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there
|
1540
|
+
# is a current limitation for users with approximately one million files in
|
1541
|
+
# which the requested sort order is ignored.
|
1542
|
+
# @param [String] page_token
|
1543
|
+
# Page token for files.
|
1544
|
+
# @param [String] projection
|
1545
|
+
# This parameter is deprecated and has no function.
|
1546
|
+
# @param [String] q
|
1547
|
+
# Query string for searching files.
|
1548
|
+
# @param [String] spaces
|
1549
|
+
# A comma-separated list of spaces to query. Supported values are 'drive', '
|
1550
|
+
# appDataFolder' and 'photos'.
|
1551
|
+
# @param [Boolean] supports_all_drives
|
1552
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1553
|
+
# @param [Boolean] supports_team_drives
|
1554
|
+
# Deprecated use supportsAllDrives instead.
|
1555
|
+
# @param [String] team_drive_id
|
1556
|
+
# Deprecated use driveId instead.
|
1557
|
+
# @param [String] fields
|
1558
|
+
# Selector specifying which fields to include in a partial response.
|
1559
|
+
# @param [String] quota_user
|
1560
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1561
|
+
# characters.
|
1562
|
+
# @param [String] user_ip
|
1563
|
+
# Deprecated. Please use quotaUser instead.
|
1564
|
+
# @param [Google::Apis::RequestOptions] options
|
1565
|
+
# Request-specific options
|
1566
|
+
#
|
1567
|
+
# @yield [result, err] Result & error if block supplied
|
1568
|
+
# @yieldparam result [Google::Apis::DriveV2::FileList] parsed result object
|
1569
|
+
# @yieldparam err [StandardError] error object if request failed
|
1570
|
+
#
|
1571
|
+
# @return [Google::Apis::DriveV2::FileList]
|
1572
|
+
#
|
1573
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1574
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1575
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1576
|
+
def list_files(corpora: nil, corpus: nil, drive_id: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_team_drive_items: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1577
|
+
command = make_simple_command(:get, 'files', options)
|
1578
|
+
command.response_representation = Google::Apis::DriveV2::FileList::Representation
|
1579
|
+
command.response_class = Google::Apis::DriveV2::FileList
|
1580
|
+
command.query['corpora'] = corpora unless corpora.nil?
|
1581
|
+
command.query['corpus'] = corpus unless corpus.nil?
|
1582
|
+
command.query['driveId'] = drive_id unless drive_id.nil?
|
1583
|
+
command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
|
1584
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1585
|
+
command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
|
1586
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
1587
|
+
command.query['orderBy'] = order_by unless order_by.nil?
|
1588
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
1589
|
+
command.query['projection'] = projection unless projection.nil?
|
1590
|
+
command.query['q'] = q unless q.nil?
|
1591
|
+
command.query['spaces'] = spaces unless spaces.nil?
|
1592
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1593
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1594
|
+
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
1595
|
+
command.query['fields'] = fields unless fields.nil?
|
1596
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1597
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1598
|
+
execute_or_queue_command(command, &block)
|
1599
|
+
end
|
1600
|
+
|
1601
|
+
# Updates file metadata and/or content. This method supports patch semantics.
|
1602
|
+
# @param [String] file_id
|
1603
|
+
# The ID of the file to update.
|
1604
|
+
# @param [Google::Apis::DriveV2::File] file_object
|
1605
|
+
# @param [String] add_parents
|
1606
|
+
# Comma-separated list of parent IDs to add.
|
1607
|
+
# @param [Boolean] convert
|
1608
|
+
# This parameter is deprecated and has no function.
|
1609
|
+
# @param [Boolean] enforce_single_parent
|
1610
|
+
# Deprecated. Adding files to multiple folders is no longer supported. Use
|
1611
|
+
# shortcuts instead.
|
1612
|
+
# @param [String] include_permissions_for_view
|
1613
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1614
|
+
# 'published' is supported.
|
1615
|
+
# @param [String] modified_date_behavior
|
1616
|
+
# Determines the behavior in which modifiedDate is updated. This overrides
|
1617
|
+
# setModifiedDate.
|
1618
|
+
# @param [Boolean] new_revision
|
1619
|
+
# Whether a blob upload should create a new revision. If false, the blob data in
|
1620
|
+
# the current head revision is replaced. If true or not set, a new blob is
|
1621
|
+
# created as head revision, and previous unpinned revisions are preserved for a
|
1622
|
+
# short period of time. Pinned revisions are stored indefinitely, using
|
1623
|
+
# additional storage quota, up to a maximum of 200 revisions. For details on how
|
1624
|
+
# revisions are retained, see the Drive Help Center. Note that this field is
|
1625
|
+
# ignored if there is no payload in the request.
|
1626
|
+
# @param [Boolean] ocr
|
1627
|
+
# Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
|
1628
|
+
# @param [String] ocr_language
|
1629
|
+
# If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
|
1630
|
+
# @param [Boolean] pinned
|
1631
|
+
# Whether to pin the new revision. A file can have a maximum of 200 pinned
|
1632
|
+
# revisions. Note that this field is ignored if there is no payload in the
|
1633
|
+
# request.
|
1634
|
+
# @param [String] remove_parents
|
1635
|
+
# Comma-separated list of parent IDs to remove.
|
1636
|
+
# @param [Boolean] set_modified_date
|
1637
|
+
# Whether to set the modified date using the value supplied in the request body.
|
1638
|
+
# Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow,
|
1639
|
+
# and false is equivalent to modifiedDateBehavior=now. To prevent any changes
|
1640
|
+
# to the modified date set modifiedDateBehavior=noChange.
|
1641
|
+
# @param [Boolean] supports_all_drives
|
1642
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1643
|
+
# @param [Boolean] supports_team_drives
|
1644
|
+
# Deprecated use supportsAllDrives instead.
|
1645
|
+
# @param [String] timed_text_language
|
1646
|
+
# The language of the timed text.
|
1647
|
+
# @param [String] timed_text_track_name
|
1648
|
+
# The timed text track name.
|
1649
|
+
# @param [Boolean] update_viewed_date
|
1650
|
+
# Whether to update the view date after successfully updating the file.
|
1651
|
+
# @param [Boolean] use_content_as_indexable_text
|
1652
|
+
# Whether to use the content as indexable text.
|
1653
|
+
# @param [String] fields
|
1654
|
+
# Selector specifying which fields to include in a partial response.
|
1655
|
+
# @param [String] quota_user
|
1656
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1657
|
+
# characters.
|
1658
|
+
# @param [String] user_ip
|
1659
|
+
# Deprecated. Please use quotaUser instead.
|
1660
|
+
# @param [Google::Apis::RequestOptions] options
|
1661
|
+
# Request-specific options
|
1662
|
+
#
|
1663
|
+
# @yield [result, err] Result & error if block supplied
|
1664
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1665
|
+
# @yieldparam err [StandardError] error object if request failed
|
1666
|
+
#
|
1667
|
+
# @return [Google::Apis::DriveV2::File]
|
1668
|
+
#
|
1669
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1670
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1671
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1672
|
+
def patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1673
|
+
command = make_simple_command(:patch, 'files/{fileId}', options)
|
1674
|
+
command.request_representation = Google::Apis::DriveV2::File::Representation
|
1675
|
+
command.request_object = file_object
|
1676
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1677
|
+
command.response_class = Google::Apis::DriveV2::File
|
1678
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1679
|
+
command.query['addParents'] = add_parents unless add_parents.nil?
|
1680
|
+
command.query['convert'] = convert unless convert.nil?
|
1681
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1682
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1683
|
+
command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
|
1684
|
+
command.query['newRevision'] = new_revision unless new_revision.nil?
|
1685
|
+
command.query['ocr'] = ocr unless ocr.nil?
|
1686
|
+
command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
|
1687
|
+
command.query['pinned'] = pinned unless pinned.nil?
|
1688
|
+
command.query['removeParents'] = remove_parents unless remove_parents.nil?
|
1689
|
+
command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
|
1690
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1691
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1692
|
+
command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
|
1693
|
+
command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
|
1694
|
+
command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
|
1695
|
+
command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
|
1696
|
+
command.query['fields'] = fields unless fields.nil?
|
1697
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1698
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1699
|
+
execute_or_queue_command(command, &block)
|
1700
|
+
end
|
1701
|
+
|
1702
|
+
# Set the file's updated time to the current server time.
|
1703
|
+
# @param [String] file_id
|
1704
|
+
# The ID of the file to update.
|
1705
|
+
# @param [String] include_permissions_for_view
|
1706
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1707
|
+
# 'published' is supported.
|
1708
|
+
# @param [Boolean] supports_all_drives
|
1709
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1710
|
+
# @param [Boolean] supports_team_drives
|
1711
|
+
# Deprecated use supportsAllDrives instead.
|
1712
|
+
# @param [String] fields
|
1713
|
+
# Selector specifying which fields to include in a partial response.
|
1714
|
+
# @param [String] quota_user
|
1715
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1716
|
+
# characters.
|
1717
|
+
# @param [String] user_ip
|
1718
|
+
# Deprecated. Please use quotaUser instead.
|
1719
|
+
# @param [Google::Apis::RequestOptions] options
|
1720
|
+
# Request-specific options
|
1721
|
+
#
|
1722
|
+
# @yield [result, err] Result & error if block supplied
|
1723
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1724
|
+
# @yieldparam err [StandardError] error object if request failed
|
1725
|
+
#
|
1726
|
+
# @return [Google::Apis::DriveV2::File]
|
1727
|
+
#
|
1728
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1729
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1730
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1731
|
+
def touch_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1732
|
+
command = make_simple_command(:post, 'files/{fileId}/touch', options)
|
1733
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1734
|
+
command.response_class = Google::Apis::DriveV2::File
|
1735
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1736
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1737
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1738
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1739
|
+
command.query['fields'] = fields unless fields.nil?
|
1740
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1741
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1742
|
+
execute_or_queue_command(command, &block)
|
1743
|
+
end
|
1744
|
+
|
1745
|
+
# Moves a file to the trash. The currently authenticated user must own the file
|
1746
|
+
# or be at least a fileOrganizer on the parent for shared drive files. Only the
|
1747
|
+
# owner may trash a file. The trashed item is excluded from all files.list
|
1748
|
+
# responses returned for any user who does not own the file. However, all users
|
1749
|
+
# with access to the file can see the trashed item metadata in an API response.
|
1750
|
+
# All users with access can copy, download, export, and share the file.
|
1751
|
+
# @param [String] file_id
|
1752
|
+
# The ID of the file to trash.
|
1753
|
+
# @param [String] include_permissions_for_view
|
1754
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1755
|
+
# 'published' is supported.
|
1756
|
+
# @param [Boolean] supports_all_drives
|
1757
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1758
|
+
# @param [Boolean] supports_team_drives
|
1759
|
+
# Deprecated use supportsAllDrives instead.
|
1760
|
+
# @param [String] fields
|
1761
|
+
# Selector specifying which fields to include in a partial response.
|
1762
|
+
# @param [String] quota_user
|
1763
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1764
|
+
# characters.
|
1765
|
+
# @param [String] user_ip
|
1766
|
+
# Deprecated. Please use quotaUser instead.
|
1767
|
+
# @param [Google::Apis::RequestOptions] options
|
1768
|
+
# Request-specific options
|
1769
|
+
#
|
1770
|
+
# @yield [result, err] Result & error if block supplied
|
1771
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1772
|
+
# @yieldparam err [StandardError] error object if request failed
|
1773
|
+
#
|
1774
|
+
# @return [Google::Apis::DriveV2::File]
|
1775
|
+
#
|
1776
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1777
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1778
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1779
|
+
def trash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1780
|
+
command = make_simple_command(:post, 'files/{fileId}/trash', options)
|
1781
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1782
|
+
command.response_class = Google::Apis::DriveV2::File
|
1783
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1784
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1785
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1786
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1787
|
+
command.query['fields'] = fields unless fields.nil?
|
1788
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1789
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1790
|
+
execute_or_queue_command(command, &block)
|
1791
|
+
end
|
1792
|
+
|
1793
|
+
# Restores a file from the trash. The currently authenticated user must own the
|
1794
|
+
# file or be at least a fileOrganizer on the parent for shared drive files. Only
|
1795
|
+
# the owner may untrash a file.
|
1796
|
+
# @param [String] file_id
|
1797
|
+
# The ID of the file to untrash.
|
1798
|
+
# @param [String] include_permissions_for_view
|
1799
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1800
|
+
# 'published' is supported.
|
1801
|
+
# @param [Boolean] supports_all_drives
|
1802
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1803
|
+
# @param [Boolean] supports_team_drives
|
1804
|
+
# Deprecated use supportsAllDrives instead.
|
1805
|
+
# @param [String] fields
|
1806
|
+
# Selector specifying which fields to include in a partial response.
|
1807
|
+
# @param [String] quota_user
|
1808
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1809
|
+
# characters.
|
1810
|
+
# @param [String] user_ip
|
1811
|
+
# Deprecated. Please use quotaUser instead.
|
1812
|
+
# @param [Google::Apis::RequestOptions] options
|
1813
|
+
# Request-specific options
|
1814
|
+
#
|
1815
|
+
# @yield [result, err] Result & error if block supplied
|
1816
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1817
|
+
# @yieldparam err [StandardError] error object if request failed
|
1818
|
+
#
|
1819
|
+
# @return [Google::Apis::DriveV2::File]
|
1820
|
+
#
|
1821
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1822
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1823
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1824
|
+
def untrash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1825
|
+
command = make_simple_command(:post, 'files/{fileId}/untrash', options)
|
1826
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1827
|
+
command.response_class = Google::Apis::DriveV2::File
|
1828
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1829
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1830
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1831
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1832
|
+
command.query['fields'] = fields unless fields.nil?
|
1833
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1834
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1835
|
+
execute_or_queue_command(command, &block)
|
1836
|
+
end
|
1837
|
+
|
1838
|
+
# Updates file metadata and/or content.
|
1839
|
+
# @param [String] file_id
|
1840
|
+
# The ID of the file to update.
|
1841
|
+
# @param [Google::Apis::DriveV2::File] file_object
|
1842
|
+
# @param [String] add_parents
|
1843
|
+
# Comma-separated list of parent IDs to add.
|
1844
|
+
# @param [Boolean] convert
|
1845
|
+
# This parameter is deprecated and has no function.
|
1846
|
+
# @param [Boolean] enforce_single_parent
|
1847
|
+
# Deprecated. Adding files to multiple folders is no longer supported. Use
|
1848
|
+
# shortcuts instead.
|
1849
|
+
# @param [String] include_permissions_for_view
|
1850
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1851
|
+
# 'published' is supported.
|
1852
|
+
# @param [String] modified_date_behavior
|
1853
|
+
# Determines the behavior in which modifiedDate is updated. This overrides
|
1854
|
+
# setModifiedDate.
|
1855
|
+
# @param [Boolean] new_revision
|
1856
|
+
# Whether a blob upload should create a new revision. If false, the blob data in
|
1857
|
+
# the current head revision is replaced. If true or not set, a new blob is
|
1858
|
+
# created as head revision, and previous unpinned revisions are preserved for a
|
1859
|
+
# short period of time. Pinned revisions are stored indefinitely, using
|
1860
|
+
# additional storage quota, up to a maximum of 200 revisions. For details on how
|
1861
|
+
# revisions are retained, see the Drive Help Center. Note that this field is
|
1862
|
+
# ignored if there is no payload in the request.
|
1863
|
+
# @param [Boolean] ocr
|
1864
|
+
# Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
|
1865
|
+
# @param [String] ocr_language
|
1866
|
+
# If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
|
1867
|
+
# @param [Boolean] pinned
|
1868
|
+
# Whether to pin the new revision. A file can have a maximum of 200 pinned
|
1869
|
+
# revisions. Note that this field is ignored if there is no payload in the
|
1870
|
+
# request.
|
1871
|
+
# @param [String] remove_parents
|
1872
|
+
# Comma-separated list of parent IDs to remove.
|
1873
|
+
# @param [Boolean] set_modified_date
|
1874
|
+
# Whether to set the modified date using the value supplied in the request body.
|
1875
|
+
# Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow,
|
1876
|
+
# and false is equivalent to modifiedDateBehavior=now. To prevent any changes
|
1877
|
+
# to the modified date set modifiedDateBehavior=noChange.
|
1878
|
+
# @param [Boolean] supports_all_drives
|
1879
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1880
|
+
# @param [Boolean] supports_team_drives
|
1881
|
+
# Deprecated use supportsAllDrives instead.
|
1882
|
+
# @param [String] timed_text_language
|
1883
|
+
# The language of the timed text.
|
1884
|
+
# @param [String] timed_text_track_name
|
1885
|
+
# The timed text track name.
|
1886
|
+
# @param [Boolean] update_viewed_date
|
1887
|
+
# Whether to update the view date after successfully updating the file.
|
1888
|
+
# @param [Boolean] use_content_as_indexable_text
|
1889
|
+
# Whether to use the content as indexable text.
|
1890
|
+
# @param [String] fields
|
1891
|
+
# Selector specifying which fields to include in a partial response.
|
1892
|
+
# @param [String] quota_user
|
1893
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1894
|
+
# characters.
|
1895
|
+
# @param [String] user_ip
|
1896
|
+
# Deprecated. Please use quotaUser instead.
|
1897
|
+
# @param [IO, String] upload_source
|
1898
|
+
# IO stream or filename containing content to upload
|
1899
|
+
# @param [String] content_type
|
1900
|
+
# Content type of the uploaded content.
|
1901
|
+
# @param [Google::Apis::RequestOptions] options
|
1902
|
+
# Request-specific options
|
1903
|
+
#
|
1904
|
+
# @yield [result, err] Result & error if block supplied
|
1905
|
+
# @yieldparam result [Google::Apis::DriveV2::File] parsed result object
|
1906
|
+
# @yieldparam err [StandardError] error object if request failed
|
1907
|
+
#
|
1908
|
+
# @return [Google::Apis::DriveV2::File]
|
1909
|
+
#
|
1910
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1911
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1912
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1913
|
+
def update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
|
1914
|
+
if upload_source.nil?
|
1915
|
+
command = make_simple_command(:put, 'files/{fileId}', options)
|
1916
|
+
else
|
1917
|
+
command = make_upload_command(:put, 'files/{fileId}', options)
|
1918
|
+
command.upload_source = upload_source
|
1919
|
+
command.upload_content_type = content_type
|
1920
|
+
end
|
1921
|
+
command.request_representation = Google::Apis::DriveV2::File::Representation
|
1922
|
+
command.request_object = file_object
|
1923
|
+
command.response_representation = Google::Apis::DriveV2::File::Representation
|
1924
|
+
command.response_class = Google::Apis::DriveV2::File
|
1925
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
1926
|
+
command.query['addParents'] = add_parents unless add_parents.nil?
|
1927
|
+
command.query['convert'] = convert unless convert.nil?
|
1928
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
1929
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
1930
|
+
command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
|
1931
|
+
command.query['newRevision'] = new_revision unless new_revision.nil?
|
1932
|
+
command.query['ocr'] = ocr unless ocr.nil?
|
1933
|
+
command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
|
1934
|
+
command.query['pinned'] = pinned unless pinned.nil?
|
1935
|
+
command.query['removeParents'] = remove_parents unless remove_parents.nil?
|
1936
|
+
command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
|
1937
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
1938
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
1939
|
+
command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
|
1940
|
+
command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
|
1941
|
+
command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
|
1942
|
+
command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
|
1943
|
+
command.query['fields'] = fields unless fields.nil?
|
1944
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1945
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1946
|
+
execute_or_queue_command(command, &block)
|
1947
|
+
end
|
1948
|
+
|
1949
|
+
# Subscribe to changes on a file
|
1950
|
+
# @param [String] file_id
|
1951
|
+
# The ID for the file in question.
|
1952
|
+
# @param [Google::Apis::DriveV2::Channel] channel_object
|
1953
|
+
# @param [Boolean] acknowledge_abuse
|
1954
|
+
# Whether the user is acknowledging the risk of downloading known malware or
|
1955
|
+
# other abusive files.
|
1956
|
+
# @param [String] include_permissions_for_view
|
1957
|
+
# Specifies which additional view's permissions to include in the response. Only
|
1958
|
+
# 'published' is supported.
|
1959
|
+
# @param [String] projection
|
1960
|
+
# This parameter is deprecated and has no function.
|
1961
|
+
# @param [String] revision_id
|
1962
|
+
# Specifies the Revision ID that should be downloaded. Ignored unless alt=media
|
1963
|
+
# is specified.
|
1964
|
+
# @param [Boolean] supports_all_drives
|
1965
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
1966
|
+
# @param [Boolean] supports_team_drives
|
1967
|
+
# Deprecated use supportsAllDrives instead.
|
1968
|
+
# @param [Boolean] update_viewed_date
|
1969
|
+
# Deprecated: Use files.update with modifiedDateBehavior=noChange,
|
1970
|
+
# updateViewedDate=true and an empty request body.
|
1971
|
+
# @param [String] fields
|
1972
|
+
# Selector specifying which fields to include in a partial response.
|
1973
|
+
# @param [String] quota_user
|
1974
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
1975
|
+
# characters.
|
1976
|
+
# @param [String] user_ip
|
1977
|
+
# Deprecated. Please use quotaUser instead.
|
1978
|
+
# @param [IO, String] download_dest
|
1979
|
+
# IO stream or filename to receive content download
|
1980
|
+
# @param [Google::Apis::RequestOptions] options
|
1981
|
+
# Request-specific options
|
1982
|
+
#
|
1983
|
+
# @yield [result, err] Result & error if block supplied
|
1984
|
+
# @yieldparam result [Google::Apis::DriveV2::Channel] parsed result object
|
1985
|
+
# @yieldparam err [StandardError] error object if request failed
|
1986
|
+
#
|
1987
|
+
# @return [Google::Apis::DriveV2::Channel]
|
1988
|
+
#
|
1989
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1990
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1991
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1992
|
+
def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
|
1993
|
+
if download_dest.nil?
|
1994
|
+
command = make_simple_command(:post, 'files/{fileId}/watch', options)
|
1995
|
+
else
|
1996
|
+
command = make_download_command(:post, 'files/{fileId}/watch', options)
|
1997
|
+
command.download_dest = download_dest
|
1998
|
+
end
|
1999
|
+
command.request_representation = Google::Apis::DriveV2::Channel::Representation
|
2000
|
+
command.request_object = channel_object
|
2001
|
+
command.response_representation = Google::Apis::DriveV2::Channel::Representation
|
2002
|
+
command.response_class = Google::Apis::DriveV2::Channel
|
2003
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2004
|
+
command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
|
2005
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
2006
|
+
command.query['projection'] = projection unless projection.nil?
|
2007
|
+
command.query['revisionId'] = revision_id unless revision_id.nil?
|
2008
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2009
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2010
|
+
command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
|
2011
|
+
command.query['fields'] = fields unless fields.nil?
|
2012
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2013
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2014
|
+
execute_or_queue_command(command, &block)
|
2015
|
+
end
|
2016
|
+
|
2017
|
+
# Removes a parent from a file.
|
2018
|
+
# @param [String] file_id
|
2019
|
+
# The ID of the file.
|
2020
|
+
# @param [String] parent_id
|
2021
|
+
# The ID of the parent.
|
2022
|
+
# @param [Boolean] enforce_single_parent
|
2023
|
+
# Deprecated. If an item is not in a shared drive and its last parent is deleted
|
2024
|
+
# but the item itself is not, the item will be placed under its owner's root.
|
2025
|
+
# @param [String] fields
|
2026
|
+
# Selector specifying which fields to include in a partial response.
|
2027
|
+
# @param [String] quota_user
|
2028
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2029
|
+
# characters.
|
2030
|
+
# @param [String] user_ip
|
2031
|
+
# Deprecated. Please use quotaUser instead.
|
2032
|
+
# @param [Google::Apis::RequestOptions] options
|
2033
|
+
# Request-specific options
|
2034
|
+
#
|
2035
|
+
# @yield [result, err] Result & error if block supplied
|
2036
|
+
# @yieldparam result [NilClass] No result returned for this method
|
2037
|
+
# @yieldparam err [StandardError] error object if request failed
|
2038
|
+
#
|
2039
|
+
# @return [void]
|
2040
|
+
#
|
2041
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2042
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2043
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2044
|
+
def delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2045
|
+
command = make_simple_command(:delete, 'files/{fileId}/parents/{parentId}', options)
|
2046
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2047
|
+
command.params['parentId'] = parent_id unless parent_id.nil?
|
2048
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
2049
|
+
command.query['fields'] = fields unless fields.nil?
|
2050
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2051
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2052
|
+
execute_or_queue_command(command, &block)
|
2053
|
+
end
|
2054
|
+
|
2055
|
+
# Gets a specific parent reference.
|
2056
|
+
# @param [String] file_id
|
2057
|
+
# The ID of the file.
|
2058
|
+
# @param [String] parent_id
|
2059
|
+
# The ID of the parent.
|
2060
|
+
# @param [String] fields
|
2061
|
+
# Selector specifying which fields to include in a partial response.
|
2062
|
+
# @param [String] quota_user
|
2063
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2064
|
+
# characters.
|
2065
|
+
# @param [String] user_ip
|
2066
|
+
# Deprecated. Please use quotaUser instead.
|
2067
|
+
# @param [Google::Apis::RequestOptions] options
|
2068
|
+
# Request-specific options
|
2069
|
+
#
|
2070
|
+
# @yield [result, err] Result & error if block supplied
|
2071
|
+
# @yieldparam result [Google::Apis::DriveV2::ParentReference] parsed result object
|
2072
|
+
# @yieldparam err [StandardError] error object if request failed
|
2073
|
+
#
|
2074
|
+
# @return [Google::Apis::DriveV2::ParentReference]
|
2075
|
+
#
|
2076
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2077
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2078
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2079
|
+
def get_parent(file_id, parent_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2080
|
+
command = make_simple_command(:get, 'files/{fileId}/parents/{parentId}', options)
|
2081
|
+
command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
|
2082
|
+
command.response_class = Google::Apis::DriveV2::ParentReference
|
2083
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2084
|
+
command.params['parentId'] = parent_id unless parent_id.nil?
|
2085
|
+
command.query['fields'] = fields unless fields.nil?
|
2086
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2087
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2088
|
+
execute_or_queue_command(command, &block)
|
2089
|
+
end
|
2090
|
+
|
2091
|
+
# Adds a parent folder for a file.
|
2092
|
+
# @param [String] file_id
|
2093
|
+
# The ID of the file.
|
2094
|
+
# @param [Google::Apis::DriveV2::ParentReference] parent_reference_object
|
2095
|
+
# @param [Boolean] enforce_single_parent
|
2096
|
+
# Deprecated. Adding files to multiple folders is no longer supported. Use
|
2097
|
+
# shortcuts instead.
|
2098
|
+
# @param [Boolean] supports_all_drives
|
2099
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2100
|
+
# @param [Boolean] supports_team_drives
|
2101
|
+
# Deprecated use supportsAllDrives instead.
|
2102
|
+
# @param [String] fields
|
2103
|
+
# Selector specifying which fields to include in a partial response.
|
2104
|
+
# @param [String] quota_user
|
2105
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2106
|
+
# characters.
|
2107
|
+
# @param [String] user_ip
|
2108
|
+
# Deprecated. Please use quotaUser instead.
|
2109
|
+
# @param [Google::Apis::RequestOptions] options
|
2110
|
+
# Request-specific options
|
2111
|
+
#
|
2112
|
+
# @yield [result, err] Result & error if block supplied
|
2113
|
+
# @yieldparam result [Google::Apis::DriveV2::ParentReference] parsed result object
|
2114
|
+
# @yieldparam err [StandardError] error object if request failed
|
2115
|
+
#
|
2116
|
+
# @return [Google::Apis::DriveV2::ParentReference]
|
2117
|
+
#
|
2118
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2119
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2120
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2121
|
+
def insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2122
|
+
command = make_simple_command(:post, 'files/{fileId}/parents', options)
|
2123
|
+
command.request_representation = Google::Apis::DriveV2::ParentReference::Representation
|
2124
|
+
command.request_object = parent_reference_object
|
2125
|
+
command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
|
2126
|
+
command.response_class = Google::Apis::DriveV2::ParentReference
|
2127
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2128
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
2129
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2130
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2131
|
+
command.query['fields'] = fields unless fields.nil?
|
2132
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2133
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2134
|
+
execute_or_queue_command(command, &block)
|
2135
|
+
end
|
2136
|
+
|
2137
|
+
# Lists a file's parents.
|
2138
|
+
# @param [String] file_id
|
2139
|
+
# The ID of the file.
|
2140
|
+
# @param [String] fields
|
2141
|
+
# Selector specifying which fields to include in a partial response.
|
2142
|
+
# @param [String] quota_user
|
2143
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2144
|
+
# characters.
|
2145
|
+
# @param [String] user_ip
|
2146
|
+
# Deprecated. Please use quotaUser instead.
|
2147
|
+
# @param [Google::Apis::RequestOptions] options
|
2148
|
+
# Request-specific options
|
2149
|
+
#
|
2150
|
+
# @yield [result, err] Result & error if block supplied
|
2151
|
+
# @yieldparam result [Google::Apis::DriveV2::ParentList] parsed result object
|
2152
|
+
# @yieldparam err [StandardError] error object if request failed
|
2153
|
+
#
|
2154
|
+
# @return [Google::Apis::DriveV2::ParentList]
|
2155
|
+
#
|
2156
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2157
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2158
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2159
|
+
def list_parents(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2160
|
+
command = make_simple_command(:get, 'files/{fileId}/parents', options)
|
2161
|
+
command.response_representation = Google::Apis::DriveV2::ParentList::Representation
|
2162
|
+
command.response_class = Google::Apis::DriveV2::ParentList
|
2163
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2164
|
+
command.query['fields'] = fields unless fields.nil?
|
2165
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2166
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2167
|
+
execute_or_queue_command(command, &block)
|
2168
|
+
end
|
2169
|
+
|
2170
|
+
# Deletes a permission from a file or shared drive.
|
2171
|
+
# @param [String] file_id
|
2172
|
+
# The ID for the file or shared drive.
|
2173
|
+
# @param [String] permission_id
|
2174
|
+
# The ID for the permission.
|
2175
|
+
# @param [Boolean] supports_all_drives
|
2176
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2177
|
+
# @param [Boolean] supports_team_drives
|
2178
|
+
# Deprecated use supportsAllDrives instead.
|
2179
|
+
# @param [Boolean] use_domain_admin_access
|
2180
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2181
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2182
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2183
|
+
# drive belongs.
|
2184
|
+
# @param [String] fields
|
2185
|
+
# Selector specifying which fields to include in a partial response.
|
2186
|
+
# @param [String] quota_user
|
2187
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2188
|
+
# characters.
|
2189
|
+
# @param [String] user_ip
|
2190
|
+
# Deprecated. Please use quotaUser instead.
|
2191
|
+
# @param [Google::Apis::RequestOptions] options
|
2192
|
+
# Request-specific options
|
2193
|
+
#
|
2194
|
+
# @yield [result, err] Result & error if block supplied
|
2195
|
+
# @yieldparam result [NilClass] No result returned for this method
|
2196
|
+
# @yieldparam err [StandardError] error object if request failed
|
2197
|
+
#
|
2198
|
+
# @return [void]
|
2199
|
+
#
|
2200
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2201
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2202
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2203
|
+
def delete_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2204
|
+
command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
|
2205
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2206
|
+
command.params['permissionId'] = permission_id unless permission_id.nil?
|
2207
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2208
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2209
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2210
|
+
command.query['fields'] = fields unless fields.nil?
|
2211
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2212
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2213
|
+
execute_or_queue_command(command, &block)
|
2214
|
+
end
|
2215
|
+
|
2216
|
+
# Gets a permission by ID.
|
2217
|
+
# @param [String] file_id
|
2218
|
+
# The ID for the file or shared drive.
|
2219
|
+
# @param [String] permission_id
|
2220
|
+
# The ID for the permission.
|
2221
|
+
# @param [Boolean] supports_all_drives
|
2222
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2223
|
+
# @param [Boolean] supports_team_drives
|
2224
|
+
# Deprecated use supportsAllDrives instead.
|
2225
|
+
# @param [Boolean] use_domain_admin_access
|
2226
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2227
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2228
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2229
|
+
# drive belongs.
|
2230
|
+
# @param [String] fields
|
2231
|
+
# Selector specifying which fields to include in a partial response.
|
2232
|
+
# @param [String] quota_user
|
2233
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2234
|
+
# characters.
|
2235
|
+
# @param [String] user_ip
|
2236
|
+
# Deprecated. Please use quotaUser instead.
|
2237
|
+
# @param [Google::Apis::RequestOptions] options
|
2238
|
+
# Request-specific options
|
2239
|
+
#
|
2240
|
+
# @yield [result, err] Result & error if block supplied
|
2241
|
+
# @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
|
2242
|
+
# @yieldparam err [StandardError] error object if request failed
|
2243
|
+
#
|
2244
|
+
# @return [Google::Apis::DriveV2::Permission]
|
2245
|
+
#
|
2246
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2247
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2248
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2249
|
+
def get_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2250
|
+
command = make_simple_command(:get, 'files/{fileId}/permissions/{permissionId}', options)
|
2251
|
+
command.response_representation = Google::Apis::DriveV2::Permission::Representation
|
2252
|
+
command.response_class = Google::Apis::DriveV2::Permission
|
2253
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2254
|
+
command.params['permissionId'] = permission_id unless permission_id.nil?
|
2255
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2256
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2257
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2258
|
+
command.query['fields'] = fields unless fields.nil?
|
2259
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2260
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2261
|
+
execute_or_queue_command(command, &block)
|
2262
|
+
end
|
2263
|
+
|
2264
|
+
# Returns the permission ID for an email address.
|
2265
|
+
# @param [String] email
|
2266
|
+
# The email address for which to return a permission ID
|
2267
|
+
# @param [String] fields
|
2268
|
+
# Selector specifying which fields to include in a partial response.
|
2269
|
+
# @param [String] quota_user
|
2270
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2271
|
+
# characters.
|
2272
|
+
# @param [String] user_ip
|
2273
|
+
# Deprecated. Please use quotaUser instead.
|
2274
|
+
# @param [Google::Apis::RequestOptions] options
|
2275
|
+
# Request-specific options
|
2276
|
+
#
|
2277
|
+
# @yield [result, err] Result & error if block supplied
|
2278
|
+
# @yieldparam result [Google::Apis::DriveV2::PermissionId] parsed result object
|
2279
|
+
# @yieldparam err [StandardError] error object if request failed
|
2280
|
+
#
|
2281
|
+
# @return [Google::Apis::DriveV2::PermissionId]
|
2282
|
+
#
|
2283
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2284
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2285
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2286
|
+
def get_permission_id_for_email(email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2287
|
+
command = make_simple_command(:get, 'permissionIds/{email}', options)
|
2288
|
+
command.response_representation = Google::Apis::DriveV2::PermissionId::Representation
|
2289
|
+
command.response_class = Google::Apis::DriveV2::PermissionId
|
2290
|
+
command.params['email'] = email unless email.nil?
|
2291
|
+
command.query['fields'] = fields unless fields.nil?
|
2292
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2293
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2294
|
+
execute_or_queue_command(command, &block)
|
2295
|
+
end
|
2296
|
+
|
2297
|
+
# Inserts a permission for a file or shared drive.
|
2298
|
+
# @param [String] file_id
|
2299
|
+
# The ID for the file or shared drive.
|
2300
|
+
# @param [Google::Apis::DriveV2::Permission] permission_object
|
2301
|
+
# @param [String] email_message
|
2302
|
+
# A plain text custom message to include in notification emails.
|
2303
|
+
# @param [Boolean] enforce_single_parent
|
2304
|
+
# Deprecated. See moveToNewOwnersRoot for details.
|
2305
|
+
# @param [Boolean] move_to_new_owners_root
|
2306
|
+
# This parameter will only take effect if the item is not in a shared drive and
|
2307
|
+
# the request is attempting to transfer the ownership of the item. If set to
|
2308
|
+
# true, the item will be moved to the new owner's My Drive root folder and all
|
2309
|
+
# prior parents removed. If set to false, parents are not changed.
|
2310
|
+
# @param [Boolean] send_notification_emails
|
2311
|
+
# Whether to send notification emails when sharing to users or groups. This
|
2312
|
+
# parameter is ignored and an email is sent if the role is owner.
|
2313
|
+
# @param [Boolean] supports_all_drives
|
2314
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2315
|
+
# @param [Boolean] supports_team_drives
|
2316
|
+
# Deprecated use supportsAllDrives instead.
|
2317
|
+
# @param [Boolean] use_domain_admin_access
|
2318
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2319
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2320
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2321
|
+
# drive belongs.
|
2322
|
+
# @param [String] fields
|
2323
|
+
# Selector specifying which fields to include in a partial response.
|
2324
|
+
# @param [String] quota_user
|
2325
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2326
|
+
# characters.
|
2327
|
+
# @param [String] user_ip
|
2328
|
+
# Deprecated. Please use quotaUser instead.
|
2329
|
+
# @param [Google::Apis::RequestOptions] options
|
2330
|
+
# Request-specific options
|
2331
|
+
#
|
2332
|
+
# @yield [result, err] Result & error if block supplied
|
2333
|
+
# @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
|
2334
|
+
# @yieldparam err [StandardError] error object if request failed
|
2335
|
+
#
|
2336
|
+
# @return [Google::Apis::DriveV2::Permission]
|
2337
|
+
#
|
2338
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2339
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2340
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2341
|
+
def insert_permission(file_id, permission_object = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2342
|
+
command = make_simple_command(:post, 'files/{fileId}/permissions', options)
|
2343
|
+
command.request_representation = Google::Apis::DriveV2::Permission::Representation
|
2344
|
+
command.request_object = permission_object
|
2345
|
+
command.response_representation = Google::Apis::DriveV2::Permission::Representation
|
2346
|
+
command.response_class = Google::Apis::DriveV2::Permission
|
2347
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2348
|
+
command.query['emailMessage'] = email_message unless email_message.nil?
|
2349
|
+
command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
|
2350
|
+
command.query['moveToNewOwnersRoot'] = move_to_new_owners_root unless move_to_new_owners_root.nil?
|
2351
|
+
command.query['sendNotificationEmails'] = send_notification_emails unless send_notification_emails.nil?
|
2352
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2353
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2354
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2355
|
+
command.query['fields'] = fields unless fields.nil?
|
2356
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2357
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2358
|
+
execute_or_queue_command(command, &block)
|
2359
|
+
end
|
2360
|
+
|
2361
|
+
# Lists a file's or shared drive's permissions.
|
2362
|
+
# @param [String] file_id
|
2363
|
+
# The ID for the file or shared drive.
|
2364
|
+
# @param [String] include_permissions_for_view
|
2365
|
+
# Specifies which additional view's permissions to include in the response. Only
|
2366
|
+
# 'published' is supported.
|
2367
|
+
# @param [Fixnum] max_results
|
2368
|
+
# The maximum number of permissions to return per page. When not set for files
|
2369
|
+
# in a shared drive, at most 100 results will be returned. When not set for
|
2370
|
+
# files that are not in a shared drive, the entire list will be returned.
|
2371
|
+
# @param [String] page_token
|
2372
|
+
# The token for continuing a previous list request on the next page. This should
|
2373
|
+
# be set to the value of 'nextPageToken' from the previous response.
|
2374
|
+
# @param [Boolean] supports_all_drives
|
2375
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2376
|
+
# @param [Boolean] supports_team_drives
|
2377
|
+
# Deprecated use supportsAllDrives instead.
|
2378
|
+
# @param [Boolean] use_domain_admin_access
|
2379
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2380
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2381
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2382
|
+
# drive belongs.
|
2383
|
+
# @param [String] fields
|
2384
|
+
# Selector specifying which fields to include in a partial response.
|
2385
|
+
# @param [String] quota_user
|
2386
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2387
|
+
# characters.
|
2388
|
+
# @param [String] user_ip
|
2389
|
+
# Deprecated. Please use quotaUser instead.
|
2390
|
+
# @param [Google::Apis::RequestOptions] options
|
2391
|
+
# Request-specific options
|
2392
|
+
#
|
2393
|
+
# @yield [result, err] Result & error if block supplied
|
2394
|
+
# @yieldparam result [Google::Apis::DriveV2::PermissionList] parsed result object
|
2395
|
+
# @yieldparam err [StandardError] error object if request failed
|
2396
|
+
#
|
2397
|
+
# @return [Google::Apis::DriveV2::PermissionList]
|
2398
|
+
#
|
2399
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2400
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2401
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2402
|
+
def list_permissions(file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2403
|
+
command = make_simple_command(:get, 'files/{fileId}/permissions', options)
|
2404
|
+
command.response_representation = Google::Apis::DriveV2::PermissionList::Representation
|
2405
|
+
command.response_class = Google::Apis::DriveV2::PermissionList
|
2406
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2407
|
+
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
|
2408
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
2409
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
2410
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2411
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2412
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2413
|
+
command.query['fields'] = fields unless fields.nil?
|
2414
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2415
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2416
|
+
execute_or_queue_command(command, &block)
|
2417
|
+
end
|
2418
|
+
|
2419
|
+
# Updates a permission using patch semantics.
|
2420
|
+
# @param [String] file_id
|
2421
|
+
# The ID for the file or shared drive.
|
2422
|
+
# @param [String] permission_id
|
2423
|
+
# The ID for the permission.
|
2424
|
+
# @param [Google::Apis::DriveV2::Permission] permission_object
|
2425
|
+
# @param [Boolean] remove_expiration
|
2426
|
+
# Whether to remove the expiration date.
|
2427
|
+
# @param [Boolean] supports_all_drives
|
2428
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2429
|
+
# @param [Boolean] supports_team_drives
|
2430
|
+
# Deprecated use supportsAllDrives instead.
|
2431
|
+
# @param [Boolean] transfer_ownership
|
2432
|
+
# Whether changing a role to 'owner' downgrades the current owners to writers.
|
2433
|
+
# Does nothing if the specified role is not 'owner'.
|
2434
|
+
# @param [Boolean] use_domain_admin_access
|
2435
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2436
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2437
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2438
|
+
# drive belongs.
|
2439
|
+
# @param [String] fields
|
2440
|
+
# Selector specifying which fields to include in a partial response.
|
2441
|
+
# @param [String] quota_user
|
2442
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2443
|
+
# characters.
|
2444
|
+
# @param [String] user_ip
|
2445
|
+
# Deprecated. Please use quotaUser instead.
|
2446
|
+
# @param [Google::Apis::RequestOptions] options
|
2447
|
+
# Request-specific options
|
2448
|
+
#
|
2449
|
+
# @yield [result, err] Result & error if block supplied
|
2450
|
+
# @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
|
2451
|
+
# @yieldparam err [StandardError] error object if request failed
|
2452
|
+
#
|
2453
|
+
# @return [Google::Apis::DriveV2::Permission]
|
2454
|
+
#
|
2455
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2456
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2457
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2458
|
+
def patch_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2459
|
+
command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
|
2460
|
+
command.request_representation = Google::Apis::DriveV2::Permission::Representation
|
2461
|
+
command.request_object = permission_object
|
2462
|
+
command.response_representation = Google::Apis::DriveV2::Permission::Representation
|
2463
|
+
command.response_class = Google::Apis::DriveV2::Permission
|
2464
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2465
|
+
command.params['permissionId'] = permission_id unless permission_id.nil?
|
2466
|
+
command.query['removeExpiration'] = remove_expiration unless remove_expiration.nil?
|
2467
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2468
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2469
|
+
command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
|
2470
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2471
|
+
command.query['fields'] = fields unless fields.nil?
|
2472
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2473
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2474
|
+
execute_or_queue_command(command, &block)
|
2475
|
+
end
|
2476
|
+
|
2477
|
+
# Updates a permission.
|
2478
|
+
# @param [String] file_id
|
2479
|
+
# The ID for the file or shared drive.
|
2480
|
+
# @param [String] permission_id
|
2481
|
+
# The ID for the permission.
|
2482
|
+
# @param [Google::Apis::DriveV2::Permission] permission_object
|
2483
|
+
# @param [Boolean] remove_expiration
|
2484
|
+
# Whether to remove the expiration date.
|
2485
|
+
# @param [Boolean] supports_all_drives
|
2486
|
+
# Whether the requesting application supports both My Drives and shared drives.
|
2487
|
+
# @param [Boolean] supports_team_drives
|
2488
|
+
# Deprecated use supportsAllDrives instead.
|
2489
|
+
# @param [Boolean] transfer_ownership
|
2490
|
+
# Whether changing a role to 'owner' downgrades the current owners to writers.
|
2491
|
+
# Does nothing if the specified role is not 'owner'.
|
2492
|
+
# @param [Boolean] use_domain_admin_access
|
2493
|
+
# Issue the request as a domain administrator; if set to true, then the
|
2494
|
+
# requester will be granted access if the file ID parameter refers to a shared
|
2495
|
+
# drive and the requester is an administrator of the domain to which the shared
|
2496
|
+
# drive belongs.
|
2497
|
+
# @param [String] fields
|
2498
|
+
# Selector specifying which fields to include in a partial response.
|
2499
|
+
# @param [String] quota_user
|
2500
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2501
|
+
# characters.
|
2502
|
+
# @param [String] user_ip
|
2503
|
+
# Deprecated. Please use quotaUser instead.
|
2504
|
+
# @param [Google::Apis::RequestOptions] options
|
2505
|
+
# Request-specific options
|
2506
|
+
#
|
2507
|
+
# @yield [result, err] Result & error if block supplied
|
2508
|
+
# @yieldparam result [Google::Apis::DriveV2::Permission] parsed result object
|
2509
|
+
# @yieldparam err [StandardError] error object if request failed
|
2510
|
+
#
|
2511
|
+
# @return [Google::Apis::DriveV2::Permission]
|
2512
|
+
#
|
2513
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2514
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2515
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2516
|
+
def update_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2517
|
+
command = make_simple_command(:put, 'files/{fileId}/permissions/{permissionId}', options)
|
2518
|
+
command.request_representation = Google::Apis::DriveV2::Permission::Representation
|
2519
|
+
command.request_object = permission_object
|
2520
|
+
command.response_representation = Google::Apis::DriveV2::Permission::Representation
|
2521
|
+
command.response_class = Google::Apis::DriveV2::Permission
|
2522
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2523
|
+
command.params['permissionId'] = permission_id unless permission_id.nil?
|
2524
|
+
command.query['removeExpiration'] = remove_expiration unless remove_expiration.nil?
|
2525
|
+
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
|
2526
|
+
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
|
2527
|
+
command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
|
2528
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
2529
|
+
command.query['fields'] = fields unless fields.nil?
|
2530
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2531
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2532
|
+
execute_or_queue_command(command, &block)
|
2533
|
+
end
|
2534
|
+
|
2535
|
+
# Deletes a property.
|
2536
|
+
# @param [String] file_id
|
2537
|
+
# The ID of the file.
|
2538
|
+
# @param [String] property_key
|
2539
|
+
# The key of the property.
|
2540
|
+
# @param [String] visibility
|
2541
|
+
# The visibility of the property.
|
2542
|
+
# @param [String] fields
|
2543
|
+
# Selector specifying which fields to include in a partial response.
|
2544
|
+
# @param [String] quota_user
|
2545
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2546
|
+
# characters.
|
2547
|
+
# @param [String] user_ip
|
2548
|
+
# Deprecated. Please use quotaUser instead.
|
2549
|
+
# @param [Google::Apis::RequestOptions] options
|
2550
|
+
# Request-specific options
|
2551
|
+
#
|
2552
|
+
# @yield [result, err] Result & error if block supplied
|
2553
|
+
# @yieldparam result [NilClass] No result returned for this method
|
2554
|
+
# @yieldparam err [StandardError] error object if request failed
|
2555
|
+
#
|
2556
|
+
# @return [void]
|
2557
|
+
#
|
2558
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2559
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2560
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2561
|
+
def delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2562
|
+
command = make_simple_command(:delete, 'files/{fileId}/properties/{propertyKey}', options)
|
2563
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2564
|
+
command.params['propertyKey'] = property_key unless property_key.nil?
|
2565
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
2566
|
+
command.query['fields'] = fields unless fields.nil?
|
2567
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2568
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2569
|
+
execute_or_queue_command(command, &block)
|
2570
|
+
end
|
2571
|
+
|
2572
|
+
# Gets a property by its key.
|
2573
|
+
# @param [String] file_id
|
2574
|
+
# The ID of the file.
|
2575
|
+
# @param [String] property_key
|
2576
|
+
# The key of the property.
|
2577
|
+
# @param [String] visibility
|
2578
|
+
# The visibility of the property.
|
2579
|
+
# @param [String] fields
|
2580
|
+
# Selector specifying which fields to include in a partial response.
|
2581
|
+
# @param [String] quota_user
|
2582
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2583
|
+
# characters.
|
2584
|
+
# @param [String] user_ip
|
2585
|
+
# Deprecated. Please use quotaUser instead.
|
2586
|
+
# @param [Google::Apis::RequestOptions] options
|
2587
|
+
# Request-specific options
|
2588
|
+
#
|
2589
|
+
# @yield [result, err] Result & error if block supplied
|
2590
|
+
# @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
|
2591
|
+
# @yieldparam err [StandardError] error object if request failed
|
2592
|
+
#
|
2593
|
+
# @return [Google::Apis::DriveV2::Property]
|
2594
|
+
#
|
2595
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2596
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2597
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2598
|
+
def get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2599
|
+
command = make_simple_command(:get, 'files/{fileId}/properties/{propertyKey}', options)
|
2600
|
+
command.response_representation = Google::Apis::DriveV2::Property::Representation
|
2601
|
+
command.response_class = Google::Apis::DriveV2::Property
|
2602
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2603
|
+
command.params['propertyKey'] = property_key unless property_key.nil?
|
2604
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
2605
|
+
command.query['fields'] = fields unless fields.nil?
|
2606
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2607
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2608
|
+
execute_or_queue_command(command, &block)
|
2609
|
+
end
|
2610
|
+
|
2611
|
+
# Adds a property to a file, or updates it if it already exists.
|
2612
|
+
# @param [String] file_id
|
2613
|
+
# The ID of the file.
|
2614
|
+
# @param [Google::Apis::DriveV2::Property] property_object
|
2615
|
+
# @param [String] fields
|
2616
|
+
# Selector specifying which fields to include in a partial response.
|
2617
|
+
# @param [String] quota_user
|
2618
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2619
|
+
# characters.
|
2620
|
+
# @param [String] user_ip
|
2621
|
+
# Deprecated. Please use quotaUser instead.
|
2622
|
+
# @param [Google::Apis::RequestOptions] options
|
2623
|
+
# Request-specific options
|
2624
|
+
#
|
2625
|
+
# @yield [result, err] Result & error if block supplied
|
2626
|
+
# @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
|
2627
|
+
# @yieldparam err [StandardError] error object if request failed
|
2628
|
+
#
|
2629
|
+
# @return [Google::Apis::DriveV2::Property]
|
2630
|
+
#
|
2631
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2632
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2633
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2634
|
+
def insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2635
|
+
command = make_simple_command(:post, 'files/{fileId}/properties', options)
|
2636
|
+
command.request_representation = Google::Apis::DriveV2::Property::Representation
|
2637
|
+
command.request_object = property_object
|
2638
|
+
command.response_representation = Google::Apis::DriveV2::Property::Representation
|
2639
|
+
command.response_class = Google::Apis::DriveV2::Property
|
2640
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2641
|
+
command.query['fields'] = fields unless fields.nil?
|
2642
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2643
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2644
|
+
execute_or_queue_command(command, &block)
|
2645
|
+
end
|
2646
|
+
|
2647
|
+
# Lists a file's properties.
|
2648
|
+
# @param [String] file_id
|
2649
|
+
# The ID of the file.
|
2650
|
+
# @param [String] fields
|
2651
|
+
# Selector specifying which fields to include in a partial response.
|
2652
|
+
# @param [String] quota_user
|
2653
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2654
|
+
# characters.
|
2655
|
+
# @param [String] user_ip
|
2656
|
+
# Deprecated. Please use quotaUser instead.
|
2657
|
+
# @param [Google::Apis::RequestOptions] options
|
2658
|
+
# Request-specific options
|
2659
|
+
#
|
2660
|
+
# @yield [result, err] Result & error if block supplied
|
2661
|
+
# @yieldparam result [Google::Apis::DriveV2::PropertyList] parsed result object
|
2662
|
+
# @yieldparam err [StandardError] error object if request failed
|
2663
|
+
#
|
2664
|
+
# @return [Google::Apis::DriveV2::PropertyList]
|
2665
|
+
#
|
2666
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2667
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2668
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2669
|
+
def list_properties(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2670
|
+
command = make_simple_command(:get, 'files/{fileId}/properties', options)
|
2671
|
+
command.response_representation = Google::Apis::DriveV2::PropertyList::Representation
|
2672
|
+
command.response_class = Google::Apis::DriveV2::PropertyList
|
2673
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2674
|
+
command.query['fields'] = fields unless fields.nil?
|
2675
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2676
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2677
|
+
execute_or_queue_command(command, &block)
|
2678
|
+
end
|
2679
|
+
|
2680
|
+
# Updates a property.
|
2681
|
+
# @param [String] file_id
|
2682
|
+
# The ID of the file.
|
2683
|
+
# @param [String] property_key
|
2684
|
+
# The key of the property.
|
2685
|
+
# @param [Google::Apis::DriveV2::Property] property_object
|
2686
|
+
# @param [String] visibility
|
2687
|
+
# The visibility of the property. Allowed values are PRIVATE and PUBLIC. (
|
2688
|
+
# Default: PRIVATE)
|
2689
|
+
# @param [String] fields
|
2690
|
+
# Selector specifying which fields to include in a partial response.
|
2691
|
+
# @param [String] quota_user
|
2692
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2693
|
+
# characters.
|
2694
|
+
# @param [String] user_ip
|
2695
|
+
# Deprecated. Please use quotaUser instead.
|
2696
|
+
# @param [Google::Apis::RequestOptions] options
|
2697
|
+
# Request-specific options
|
2698
|
+
#
|
2699
|
+
# @yield [result, err] Result & error if block supplied
|
2700
|
+
# @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
|
2701
|
+
# @yieldparam err [StandardError] error object if request failed
|
2702
|
+
#
|
2703
|
+
# @return [Google::Apis::DriveV2::Property]
|
2704
|
+
#
|
2705
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2706
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2707
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2708
|
+
def patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2709
|
+
command = make_simple_command(:patch, 'files/{fileId}/properties/{propertyKey}', options)
|
2710
|
+
command.request_representation = Google::Apis::DriveV2::Property::Representation
|
2711
|
+
command.request_object = property_object
|
2712
|
+
command.response_representation = Google::Apis::DriveV2::Property::Representation
|
2713
|
+
command.response_class = Google::Apis::DriveV2::Property
|
2714
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2715
|
+
command.params['propertyKey'] = property_key unless property_key.nil?
|
2716
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
2717
|
+
command.query['fields'] = fields unless fields.nil?
|
2718
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2719
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2720
|
+
execute_or_queue_command(command, &block)
|
2721
|
+
end
|
2722
|
+
|
2723
|
+
# Updates a property.
|
2724
|
+
# @param [String] file_id
|
2725
|
+
# The ID of the file.
|
2726
|
+
# @param [String] property_key
|
2727
|
+
# The key of the property.
|
2728
|
+
# @param [Google::Apis::DriveV2::Property] property_object
|
2729
|
+
# @param [String] visibility
|
2730
|
+
# The visibility of the property. Allowed values are PRIVATE and PUBLIC. (
|
2731
|
+
# Default: PRIVATE)
|
2732
|
+
# @param [String] fields
|
2733
|
+
# Selector specifying which fields to include in a partial response.
|
2734
|
+
# @param [String] quota_user
|
2735
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2736
|
+
# characters.
|
2737
|
+
# @param [String] user_ip
|
2738
|
+
# Deprecated. Please use quotaUser instead.
|
2739
|
+
# @param [Google::Apis::RequestOptions] options
|
2740
|
+
# Request-specific options
|
2741
|
+
#
|
2742
|
+
# @yield [result, err] Result & error if block supplied
|
2743
|
+
# @yieldparam result [Google::Apis::DriveV2::Property] parsed result object
|
2744
|
+
# @yieldparam err [StandardError] error object if request failed
|
2745
|
+
#
|
2746
|
+
# @return [Google::Apis::DriveV2::Property]
|
2747
|
+
#
|
2748
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2749
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2750
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2751
|
+
def update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2752
|
+
command = make_simple_command(:put, 'files/{fileId}/properties/{propertyKey}', options)
|
2753
|
+
command.request_representation = Google::Apis::DriveV2::Property::Representation
|
2754
|
+
command.request_object = property_object
|
2755
|
+
command.response_representation = Google::Apis::DriveV2::Property::Representation
|
2756
|
+
command.response_class = Google::Apis::DriveV2::Property
|
2757
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2758
|
+
command.params['propertyKey'] = property_key unless property_key.nil?
|
2759
|
+
command.query['visibility'] = visibility unless visibility.nil?
|
2760
|
+
command.query['fields'] = fields unless fields.nil?
|
2761
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2762
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2763
|
+
execute_or_queue_command(command, &block)
|
2764
|
+
end
|
2765
|
+
|
2766
|
+
# Deletes a reply.
|
2767
|
+
# @param [String] file_id
|
2768
|
+
# The ID of the file.
|
2769
|
+
# @param [String] comment_id
|
2770
|
+
# The ID of the comment.
|
2771
|
+
# @param [String] reply_id
|
2772
|
+
# The ID of the reply.
|
2773
|
+
# @param [String] fields
|
2774
|
+
# Selector specifying which fields to include in a partial response.
|
2775
|
+
# @param [String] quota_user
|
2776
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2777
|
+
# characters.
|
2778
|
+
# @param [String] user_ip
|
2779
|
+
# Deprecated. Please use quotaUser instead.
|
2780
|
+
# @param [Google::Apis::RequestOptions] options
|
2781
|
+
# Request-specific options
|
2782
|
+
#
|
2783
|
+
# @yield [result, err] Result & error if block supplied
|
2784
|
+
# @yieldparam result [NilClass] No result returned for this method
|
2785
|
+
# @yieldparam err [StandardError] error object if request failed
|
2786
|
+
#
|
2787
|
+
# @return [void]
|
2788
|
+
#
|
2789
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2790
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2791
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2792
|
+
def delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2793
|
+
command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
|
2794
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2795
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
2796
|
+
command.params['replyId'] = reply_id unless reply_id.nil?
|
2797
|
+
command.query['fields'] = fields unless fields.nil?
|
2798
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2799
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2800
|
+
execute_or_queue_command(command, &block)
|
2801
|
+
end
|
2802
|
+
|
2803
|
+
# Gets a reply.
|
2804
|
+
# @param [String] file_id
|
2805
|
+
# The ID of the file.
|
2806
|
+
# @param [String] comment_id
|
2807
|
+
# The ID of the comment.
|
2808
|
+
# @param [String] reply_id
|
2809
|
+
# The ID of the reply.
|
2810
|
+
# @param [Boolean] include_deleted
|
2811
|
+
# If set, this will succeed when retrieving a deleted reply.
|
2812
|
+
# @param [String] fields
|
2813
|
+
# Selector specifying which fields to include in a partial response.
|
2814
|
+
# @param [String] quota_user
|
2815
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2816
|
+
# characters.
|
2817
|
+
# @param [String] user_ip
|
2818
|
+
# Deprecated. Please use quotaUser instead.
|
2819
|
+
# @param [Google::Apis::RequestOptions] options
|
2820
|
+
# Request-specific options
|
2821
|
+
#
|
2822
|
+
# @yield [result, err] Result & error if block supplied
|
2823
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
|
2824
|
+
# @yieldparam err [StandardError] error object if request failed
|
2825
|
+
#
|
2826
|
+
# @return [Google::Apis::DriveV2::CommentReply]
|
2827
|
+
#
|
2828
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2829
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2830
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2831
|
+
def get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2832
|
+
command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
|
2833
|
+
command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
|
2834
|
+
command.response_class = Google::Apis::DriveV2::CommentReply
|
2835
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2836
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
2837
|
+
command.params['replyId'] = reply_id unless reply_id.nil?
|
2838
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
2839
|
+
command.query['fields'] = fields unless fields.nil?
|
2840
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2841
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2842
|
+
execute_or_queue_command(command, &block)
|
2843
|
+
end
|
2844
|
+
|
2845
|
+
# Creates a new reply to the given comment.
|
2846
|
+
# @param [String] file_id
|
2847
|
+
# The ID of the file.
|
2848
|
+
# @param [String] comment_id
|
2849
|
+
# The ID of the comment.
|
2850
|
+
# @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
|
2851
|
+
# @param [String] fields
|
2852
|
+
# Selector specifying which fields to include in a partial response.
|
2853
|
+
# @param [String] quota_user
|
2854
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2855
|
+
# characters.
|
2856
|
+
# @param [String] user_ip
|
2857
|
+
# Deprecated. Please use quotaUser instead.
|
2858
|
+
# @param [Google::Apis::RequestOptions] options
|
2859
|
+
# Request-specific options
|
2860
|
+
#
|
2861
|
+
# @yield [result, err] Result & error if block supplied
|
2862
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
|
2863
|
+
# @yieldparam err [StandardError] error object if request failed
|
2864
|
+
#
|
2865
|
+
# @return [Google::Apis::DriveV2::CommentReply]
|
2866
|
+
#
|
2867
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2868
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2869
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2870
|
+
def insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2871
|
+
command = make_simple_command(:post, 'files/{fileId}/comments/{commentId}/replies', options)
|
2872
|
+
command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
|
2873
|
+
command.request_object = comment_reply_object
|
2874
|
+
command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
|
2875
|
+
command.response_class = Google::Apis::DriveV2::CommentReply
|
2876
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2877
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
2878
|
+
command.query['fields'] = fields unless fields.nil?
|
2879
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2880
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2881
|
+
execute_or_queue_command(command, &block)
|
2882
|
+
end
|
2883
|
+
|
2884
|
+
# Lists all of the replies to a comment.
|
2885
|
+
# @param [String] file_id
|
2886
|
+
# The ID of the file.
|
2887
|
+
# @param [String] comment_id
|
2888
|
+
# The ID of the comment.
|
2889
|
+
# @param [Boolean] include_deleted
|
2890
|
+
# If set, all replies, including deleted replies (with content stripped) will be
|
2891
|
+
# returned.
|
2892
|
+
# @param [Fixnum] max_results
|
2893
|
+
# The maximum number of replies to include in the response, used for paging.
|
2894
|
+
# @param [String] page_token
|
2895
|
+
# The continuation token, used to page through large result sets. To get the
|
2896
|
+
# next page of results, set this parameter to the value of "nextPageToken" from
|
2897
|
+
# the previous response.
|
2898
|
+
# @param [String] fields
|
2899
|
+
# Selector specifying which fields to include in a partial response.
|
2900
|
+
# @param [String] quota_user
|
2901
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2902
|
+
# characters.
|
2903
|
+
# @param [String] user_ip
|
2904
|
+
# Deprecated. Please use quotaUser instead.
|
2905
|
+
# @param [Google::Apis::RequestOptions] options
|
2906
|
+
# Request-specific options
|
2907
|
+
#
|
2908
|
+
# @yield [result, err] Result & error if block supplied
|
2909
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentReplyList] parsed result object
|
2910
|
+
# @yieldparam err [StandardError] error object if request failed
|
2911
|
+
#
|
2912
|
+
# @return [Google::Apis::DriveV2::CommentReplyList]
|
2913
|
+
#
|
2914
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2915
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2916
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2917
|
+
def list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2918
|
+
command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies', options)
|
2919
|
+
command.response_representation = Google::Apis::DriveV2::CommentReplyList::Representation
|
2920
|
+
command.response_class = Google::Apis::DriveV2::CommentReplyList
|
2921
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2922
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
2923
|
+
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
|
2924
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
2925
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
2926
|
+
command.query['fields'] = fields unless fields.nil?
|
2927
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2928
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2929
|
+
execute_or_queue_command(command, &block)
|
2930
|
+
end
|
2931
|
+
|
2932
|
+
# Updates an existing reply.
|
2933
|
+
# @param [String] file_id
|
2934
|
+
# The ID of the file.
|
2935
|
+
# @param [String] comment_id
|
2936
|
+
# The ID of the comment.
|
2937
|
+
# @param [String] reply_id
|
2938
|
+
# The ID of the reply.
|
2939
|
+
# @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
|
2940
|
+
# @param [String] fields
|
2941
|
+
# Selector specifying which fields to include in a partial response.
|
2942
|
+
# @param [String] quota_user
|
2943
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2944
|
+
# characters.
|
2945
|
+
# @param [String] user_ip
|
2946
|
+
# Deprecated. Please use quotaUser instead.
|
2947
|
+
# @param [Google::Apis::RequestOptions] options
|
2948
|
+
# Request-specific options
|
2949
|
+
#
|
2950
|
+
# @yield [result, err] Result & error if block supplied
|
2951
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
|
2952
|
+
# @yieldparam err [StandardError] error object if request failed
|
2953
|
+
#
|
2954
|
+
# @return [Google::Apis::DriveV2::CommentReply]
|
2955
|
+
#
|
2956
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2957
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
2958
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
2959
|
+
def patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
2960
|
+
command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
|
2961
|
+
command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
|
2962
|
+
command.request_object = comment_reply_object
|
2963
|
+
command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
|
2964
|
+
command.response_class = Google::Apis::DriveV2::CommentReply
|
2965
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
2966
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
2967
|
+
command.params['replyId'] = reply_id unless reply_id.nil?
|
2968
|
+
command.query['fields'] = fields unless fields.nil?
|
2969
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2970
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2971
|
+
execute_or_queue_command(command, &block)
|
2972
|
+
end
|
2973
|
+
|
2974
|
+
# Updates an existing reply.
|
2975
|
+
# @param [String] file_id
|
2976
|
+
# The ID of the file.
|
2977
|
+
# @param [String] comment_id
|
2978
|
+
# The ID of the comment.
|
2979
|
+
# @param [String] reply_id
|
2980
|
+
# The ID of the reply.
|
2981
|
+
# @param [Google::Apis::DriveV2::CommentReply] comment_reply_object
|
2982
|
+
# @param [String] fields
|
2983
|
+
# Selector specifying which fields to include in a partial response.
|
2984
|
+
# @param [String] quota_user
|
2985
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
2986
|
+
# characters.
|
2987
|
+
# @param [String] user_ip
|
2988
|
+
# Deprecated. Please use quotaUser instead.
|
2989
|
+
# @param [Google::Apis::RequestOptions] options
|
2990
|
+
# Request-specific options
|
2991
|
+
#
|
2992
|
+
# @yield [result, err] Result & error if block supplied
|
2993
|
+
# @yieldparam result [Google::Apis::DriveV2::CommentReply] parsed result object
|
2994
|
+
# @yieldparam err [StandardError] error object if request failed
|
2995
|
+
#
|
2996
|
+
# @return [Google::Apis::DriveV2::CommentReply]
|
2997
|
+
#
|
2998
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
2999
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3000
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3001
|
+
def update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3002
|
+
command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
|
3003
|
+
command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
|
3004
|
+
command.request_object = comment_reply_object
|
3005
|
+
command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
|
3006
|
+
command.response_class = Google::Apis::DriveV2::CommentReply
|
3007
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3008
|
+
command.params['commentId'] = comment_id unless comment_id.nil?
|
3009
|
+
command.params['replyId'] = reply_id unless reply_id.nil?
|
3010
|
+
command.query['fields'] = fields unless fields.nil?
|
3011
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3012
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3013
|
+
execute_or_queue_command(command, &block)
|
3014
|
+
end
|
3015
|
+
|
3016
|
+
# Permanently deletes a file version. You can only delete revisions for files
|
3017
|
+
# with binary content, like images or videos. Revisions for other files, like
|
3018
|
+
# Google Docs or Sheets, and the last remaining file version can't be deleted.
|
3019
|
+
# @param [String] file_id
|
3020
|
+
# The ID of the file.
|
3021
|
+
# @param [String] revision_id
|
3022
|
+
# The ID of the revision.
|
3023
|
+
# @param [String] fields
|
3024
|
+
# Selector specifying which fields to include in a partial response.
|
3025
|
+
# @param [String] quota_user
|
3026
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3027
|
+
# characters.
|
3028
|
+
# @param [String] user_ip
|
3029
|
+
# Deprecated. Please use quotaUser instead.
|
3030
|
+
# @param [Google::Apis::RequestOptions] options
|
3031
|
+
# Request-specific options
|
3032
|
+
#
|
3033
|
+
# @yield [result, err] Result & error if block supplied
|
3034
|
+
# @yieldparam result [NilClass] No result returned for this method
|
3035
|
+
# @yieldparam err [StandardError] error object if request failed
|
3036
|
+
#
|
3037
|
+
# @return [void]
|
3038
|
+
#
|
3039
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3040
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3041
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3042
|
+
def delete_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3043
|
+
command = make_simple_command(:delete, 'files/{fileId}/revisions/{revisionId}', options)
|
3044
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3045
|
+
command.params['revisionId'] = revision_id unless revision_id.nil?
|
3046
|
+
command.query['fields'] = fields unless fields.nil?
|
3047
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3048
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3049
|
+
execute_or_queue_command(command, &block)
|
3050
|
+
end
|
3051
|
+
|
3052
|
+
# Gets a specific revision.
|
3053
|
+
# @param [String] file_id
|
3054
|
+
# The ID of the file.
|
3055
|
+
# @param [String] revision_id
|
3056
|
+
# The ID of the revision.
|
3057
|
+
# @param [String] fields
|
3058
|
+
# Selector specifying which fields to include in a partial response.
|
3059
|
+
# @param [String] quota_user
|
3060
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3061
|
+
# characters.
|
3062
|
+
# @param [String] user_ip
|
3063
|
+
# Deprecated. Please use quotaUser instead.
|
3064
|
+
# @param [Google::Apis::RequestOptions] options
|
3065
|
+
# Request-specific options
|
3066
|
+
#
|
3067
|
+
# @yield [result, err] Result & error if block supplied
|
3068
|
+
# @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
|
3069
|
+
# @yieldparam err [StandardError] error object if request failed
|
3070
|
+
#
|
3071
|
+
# @return [Google::Apis::DriveV2::Revision]
|
3072
|
+
#
|
3073
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3074
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3075
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3076
|
+
def get_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3077
|
+
command = make_simple_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
|
3078
|
+
command.response_representation = Google::Apis::DriveV2::Revision::Representation
|
3079
|
+
command.response_class = Google::Apis::DriveV2::Revision
|
3080
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3081
|
+
command.params['revisionId'] = revision_id unless revision_id.nil?
|
3082
|
+
command.query['fields'] = fields unless fields.nil?
|
3083
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3084
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3085
|
+
execute_or_queue_command(command, &block)
|
3086
|
+
end
|
3087
|
+
|
3088
|
+
# Lists a file's revisions.
|
3089
|
+
# @param [String] file_id
|
3090
|
+
# The ID of the file.
|
3091
|
+
# @param [Fixnum] max_results
|
3092
|
+
# Maximum number of revisions to return.
|
3093
|
+
# @param [String] page_token
|
3094
|
+
# Page token for revisions. To get the next page of results, set this parameter
|
3095
|
+
# to the value of "nextPageToken" from the previous response.
|
3096
|
+
# @param [String] fields
|
3097
|
+
# Selector specifying which fields to include in a partial response.
|
3098
|
+
# @param [String] quota_user
|
3099
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3100
|
+
# characters.
|
3101
|
+
# @param [String] user_ip
|
3102
|
+
# Deprecated. Please use quotaUser instead.
|
3103
|
+
# @param [Google::Apis::RequestOptions] options
|
3104
|
+
# Request-specific options
|
3105
|
+
#
|
3106
|
+
# @yield [result, err] Result & error if block supplied
|
3107
|
+
# @yieldparam result [Google::Apis::DriveV2::RevisionList] parsed result object
|
3108
|
+
# @yieldparam err [StandardError] error object if request failed
|
3109
|
+
#
|
3110
|
+
# @return [Google::Apis::DriveV2::RevisionList]
|
3111
|
+
#
|
3112
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3113
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3114
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3115
|
+
def list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3116
|
+
command = make_simple_command(:get, 'files/{fileId}/revisions', options)
|
3117
|
+
command.response_representation = Google::Apis::DriveV2::RevisionList::Representation
|
3118
|
+
command.response_class = Google::Apis::DriveV2::RevisionList
|
3119
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3120
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
3121
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
3122
|
+
command.query['fields'] = fields unless fields.nil?
|
3123
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3124
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3125
|
+
execute_or_queue_command(command, &block)
|
3126
|
+
end
|
3127
|
+
|
3128
|
+
# Updates a revision.
|
3129
|
+
# @param [String] file_id
|
3130
|
+
# The ID for the file.
|
3131
|
+
# @param [String] revision_id
|
3132
|
+
# The ID for the revision.
|
3133
|
+
# @param [Google::Apis::DriveV2::Revision] revision_object
|
3134
|
+
# @param [String] fields
|
3135
|
+
# Selector specifying which fields to include in a partial response.
|
3136
|
+
# @param [String] quota_user
|
3137
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3138
|
+
# characters.
|
3139
|
+
# @param [String] user_ip
|
3140
|
+
# Deprecated. Please use quotaUser instead.
|
3141
|
+
# @param [Google::Apis::RequestOptions] options
|
3142
|
+
# Request-specific options
|
3143
|
+
#
|
3144
|
+
# @yield [result, err] Result & error if block supplied
|
3145
|
+
# @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
|
3146
|
+
# @yieldparam err [StandardError] error object if request failed
|
3147
|
+
#
|
3148
|
+
# @return [Google::Apis::DriveV2::Revision]
|
3149
|
+
#
|
3150
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3151
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3152
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3153
|
+
def patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3154
|
+
command = make_simple_command(:patch, 'files/{fileId}/revisions/{revisionId}', options)
|
3155
|
+
command.request_representation = Google::Apis::DriveV2::Revision::Representation
|
3156
|
+
command.request_object = revision_object
|
3157
|
+
command.response_representation = Google::Apis::DriveV2::Revision::Representation
|
3158
|
+
command.response_class = Google::Apis::DriveV2::Revision
|
3159
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3160
|
+
command.params['revisionId'] = revision_id unless revision_id.nil?
|
3161
|
+
command.query['fields'] = fields unless fields.nil?
|
3162
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3163
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3164
|
+
execute_or_queue_command(command, &block)
|
3165
|
+
end
|
3166
|
+
|
3167
|
+
# Updates a revision.
|
3168
|
+
# @param [String] file_id
|
3169
|
+
# The ID for the file.
|
3170
|
+
# @param [String] revision_id
|
3171
|
+
# The ID for the revision.
|
3172
|
+
# @param [Google::Apis::DriveV2::Revision] revision_object
|
3173
|
+
# @param [String] fields
|
3174
|
+
# Selector specifying which fields to include in a partial response.
|
3175
|
+
# @param [String] quota_user
|
3176
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3177
|
+
# characters.
|
3178
|
+
# @param [String] user_ip
|
3179
|
+
# Deprecated. Please use quotaUser instead.
|
3180
|
+
# @param [Google::Apis::RequestOptions] options
|
3181
|
+
# Request-specific options
|
3182
|
+
#
|
3183
|
+
# @yield [result, err] Result & error if block supplied
|
3184
|
+
# @yieldparam result [Google::Apis::DriveV2::Revision] parsed result object
|
3185
|
+
# @yieldparam err [StandardError] error object if request failed
|
3186
|
+
#
|
3187
|
+
# @return [Google::Apis::DriveV2::Revision]
|
3188
|
+
#
|
3189
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3190
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3191
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3192
|
+
def update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3193
|
+
command = make_simple_command(:put, 'files/{fileId}/revisions/{revisionId}', options)
|
3194
|
+
command.request_representation = Google::Apis::DriveV2::Revision::Representation
|
3195
|
+
command.request_object = revision_object
|
3196
|
+
command.response_representation = Google::Apis::DriveV2::Revision::Representation
|
3197
|
+
command.response_class = Google::Apis::DriveV2::Revision
|
3198
|
+
command.params['fileId'] = file_id unless file_id.nil?
|
3199
|
+
command.params['revisionId'] = revision_id unless revision_id.nil?
|
3200
|
+
command.query['fields'] = fields unless fields.nil?
|
3201
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3202
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3203
|
+
execute_or_queue_command(command, &block)
|
3204
|
+
end
|
3205
|
+
|
3206
|
+
# Deprecated use drives.delete instead.
|
3207
|
+
# @param [String] team_drive_id
|
3208
|
+
# The ID of the Team Drive
|
3209
|
+
# @param [String] fields
|
3210
|
+
# Selector specifying which fields to include in a partial response.
|
3211
|
+
# @param [String] quota_user
|
3212
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3213
|
+
# characters.
|
3214
|
+
# @param [String] user_ip
|
3215
|
+
# Deprecated. Please use quotaUser instead.
|
3216
|
+
# @param [Google::Apis::RequestOptions] options
|
3217
|
+
# Request-specific options
|
3218
|
+
#
|
3219
|
+
# @yield [result, err] Result & error if block supplied
|
3220
|
+
# @yieldparam result [NilClass] No result returned for this method
|
3221
|
+
# @yieldparam err [StandardError] error object if request failed
|
3222
|
+
#
|
3223
|
+
# @return [void]
|
3224
|
+
#
|
3225
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3226
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3227
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3228
|
+
def delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3229
|
+
command = make_simple_command(:delete, 'teamdrives/{teamDriveId}', options)
|
3230
|
+
command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
3231
|
+
command.query['fields'] = fields unless fields.nil?
|
3232
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3233
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3234
|
+
execute_or_queue_command(command, &block)
|
3235
|
+
end
|
3236
|
+
|
3237
|
+
# Deprecated use drives.get instead.
|
3238
|
+
# @param [String] team_drive_id
|
3239
|
+
# The ID of the Team Drive
|
3240
|
+
# @param [Boolean] use_domain_admin_access
|
3241
|
+
# Issue the request as a domain administrator; if set to true, then the
|
3242
|
+
# requester will be granted access if they are an administrator of the domain to
|
3243
|
+
# which the Team Drive belongs.
|
3244
|
+
# @param [String] fields
|
3245
|
+
# Selector specifying which fields to include in a partial response.
|
3246
|
+
# @param [String] quota_user
|
3247
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3248
|
+
# characters.
|
3249
|
+
# @param [String] user_ip
|
3250
|
+
# Deprecated. Please use quotaUser instead.
|
3251
|
+
# @param [Google::Apis::RequestOptions] options
|
3252
|
+
# Request-specific options
|
3253
|
+
#
|
3254
|
+
# @yield [result, err] Result & error if block supplied
|
3255
|
+
# @yieldparam result [Google::Apis::DriveV2::TeamDrive] parsed result object
|
3256
|
+
# @yieldparam err [StandardError] error object if request failed
|
3257
|
+
#
|
3258
|
+
# @return [Google::Apis::DriveV2::TeamDrive]
|
3259
|
+
#
|
3260
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3261
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3262
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3263
|
+
def get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3264
|
+
command = make_simple_command(:get, 'teamdrives/{teamDriveId}', options)
|
3265
|
+
command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
|
3266
|
+
command.response_class = Google::Apis::DriveV2::TeamDrive
|
3267
|
+
command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
3268
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
3269
|
+
command.query['fields'] = fields unless fields.nil?
|
3270
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3271
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3272
|
+
execute_or_queue_command(command, &block)
|
3273
|
+
end
|
3274
|
+
|
3275
|
+
# Deprecated use drives.insert instead.
|
3276
|
+
# @param [String] request_id
|
3277
|
+
# An ID, such as a random UUID, which uniquely identifies this user's request
|
3278
|
+
# for idempotent creation of a Team Drive. A repeated request by the same user
|
3279
|
+
# and with the same request ID will avoid creating duplicates by attempting to
|
3280
|
+
# create the same Team Drive. If the Team Drive already exists a 409 error will
|
3281
|
+
# be returned.
|
3282
|
+
# @param [Google::Apis::DriveV2::TeamDrive] team_drive_object
|
3283
|
+
# @param [String] fields
|
3284
|
+
# Selector specifying which fields to include in a partial response.
|
3285
|
+
# @param [String] quota_user
|
3286
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3287
|
+
# characters.
|
3288
|
+
# @param [String] user_ip
|
3289
|
+
# Deprecated. Please use quotaUser instead.
|
3290
|
+
# @param [Google::Apis::RequestOptions] options
|
3291
|
+
# Request-specific options
|
3292
|
+
#
|
3293
|
+
# @yield [result, err] Result & error if block supplied
|
3294
|
+
# @yieldparam result [Google::Apis::DriveV2::TeamDrive] parsed result object
|
3295
|
+
# @yieldparam err [StandardError] error object if request failed
|
3296
|
+
#
|
3297
|
+
# @return [Google::Apis::DriveV2::TeamDrive]
|
3298
|
+
#
|
3299
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3300
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3301
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3302
|
+
def insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3303
|
+
command = make_simple_command(:post, 'teamdrives', options)
|
3304
|
+
command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation
|
3305
|
+
command.request_object = team_drive_object
|
3306
|
+
command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
|
3307
|
+
command.response_class = Google::Apis::DriveV2::TeamDrive
|
3308
|
+
command.query['requestId'] = request_id unless request_id.nil?
|
3309
|
+
command.query['fields'] = fields unless fields.nil?
|
3310
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3311
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3312
|
+
execute_or_queue_command(command, &block)
|
3313
|
+
end
|
3314
|
+
|
3315
|
+
# Deprecated use drives.list instead.
|
3316
|
+
# @param [Fixnum] max_results
|
3317
|
+
# Maximum number of Team Drives to return.
|
3318
|
+
# @param [String] page_token
|
3319
|
+
# Page token for Team Drives.
|
3320
|
+
# @param [String] q
|
3321
|
+
# Query string for searching Team Drives.
|
3322
|
+
# @param [Boolean] use_domain_admin_access
|
3323
|
+
# Issue the request as a domain administrator; if set to true, then all Team
|
3324
|
+
# Drives of the domain in which the requester is an administrator are returned.
|
3325
|
+
# @param [String] fields
|
3326
|
+
# Selector specifying which fields to include in a partial response.
|
3327
|
+
# @param [String] quota_user
|
3328
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3329
|
+
# characters.
|
3330
|
+
# @param [String] user_ip
|
3331
|
+
# Deprecated. Please use quotaUser instead.
|
3332
|
+
# @param [Google::Apis::RequestOptions] options
|
3333
|
+
# Request-specific options
|
3334
|
+
#
|
3335
|
+
# @yield [result, err] Result & error if block supplied
|
3336
|
+
# @yieldparam result [Google::Apis::DriveV2::TeamDriveList] parsed result object
|
3337
|
+
# @yieldparam err [StandardError] error object if request failed
|
3338
|
+
#
|
3339
|
+
# @return [Google::Apis::DriveV2::TeamDriveList]
|
3340
|
+
#
|
3341
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3342
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3343
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3344
|
+
def list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3345
|
+
command = make_simple_command(:get, 'teamdrives', options)
|
3346
|
+
command.response_representation = Google::Apis::DriveV2::TeamDriveList::Representation
|
3347
|
+
command.response_class = Google::Apis::DriveV2::TeamDriveList
|
3348
|
+
command.query['maxResults'] = max_results unless max_results.nil?
|
3349
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
3350
|
+
command.query['q'] = q unless q.nil?
|
3351
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
3352
|
+
command.query['fields'] = fields unless fields.nil?
|
3353
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3354
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3355
|
+
execute_or_queue_command(command, &block)
|
3356
|
+
end
|
3357
|
+
|
3358
|
+
# Deprecated use drives.update instead.
|
3359
|
+
# @param [String] team_drive_id
|
3360
|
+
# The ID of the Team Drive
|
3361
|
+
# @param [Google::Apis::DriveV2::TeamDrive] team_drive_object
|
3362
|
+
# @param [Boolean] use_domain_admin_access
|
3363
|
+
# Issue the request as a domain administrator; if set to true, then the
|
3364
|
+
# requester will be granted access if they are an administrator of the domain to
|
3365
|
+
# which the Team Drive belongs.
|
3366
|
+
# @param [String] fields
|
3367
|
+
# Selector specifying which fields to include in a partial response.
|
3368
|
+
# @param [String] quota_user
|
3369
|
+
# An opaque string that represents a user for quota purposes. Must not exceed 40
|
3370
|
+
# characters.
|
3371
|
+
# @param [String] user_ip
|
3372
|
+
# Deprecated. Please use quotaUser instead.
|
3373
|
+
# @param [Google::Apis::RequestOptions] options
|
3374
|
+
# Request-specific options
|
3375
|
+
#
|
3376
|
+
# @yield [result, err] Result & error if block supplied
|
3377
|
+
# @yieldparam result [Google::Apis::DriveV2::TeamDrive] parsed result object
|
3378
|
+
# @yieldparam err [StandardError] error object if request failed
|
3379
|
+
#
|
3380
|
+
# @return [Google::Apis::DriveV2::TeamDrive]
|
3381
|
+
#
|
3382
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
3383
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
3384
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
3385
|
+
def update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
3386
|
+
command = make_simple_command(:put, 'teamdrives/{teamDriveId}', options)
|
3387
|
+
command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation
|
3388
|
+
command.request_object = team_drive_object
|
3389
|
+
command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
|
3390
|
+
command.response_class = Google::Apis::DriveV2::TeamDrive
|
3391
|
+
command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
|
3392
|
+
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
|
3393
|
+
command.query['fields'] = fields unless fields.nil?
|
3394
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3395
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3396
|
+
execute_or_queue_command(command, &block)
|
3397
|
+
end
|
3398
|
+
|
3399
|
+
protected
|
3400
|
+
|
3401
|
+
def apply_command_defaults(command)
|
3402
|
+
command.query['key'] = key unless key.nil?
|
3403
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
3404
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
3405
|
+
end
|
3406
|
+
end
|
3407
|
+
end
|
3408
|
+
end
|
3409
|
+
end
|