-
Notifications
You must be signed in to change notification settings - Fork 876
/
Copy pathservice.rb
2624 lines (2559 loc) · 162 KB
/
service.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module DriveV3
# Google Drive API
#
# The Google Drive API allows clients to access resources from Google Drive.
#
# @example
# require 'google/apis/drive_v3'
#
# Drive = Google::Apis::DriveV3 # Alias the module
# service = Drive::DriveService.new
#
# @see https://developers.google.com/drive/
class DriveService < Google::Apis::Core::BaseService
DEFAULT_ENDPOINT_TEMPLATE = "https://www.$UNIVERSE_DOMAIN$/"
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
attr_accessor :quota_user
def initialize
super(DEFAULT_ENDPOINT_TEMPLATE, 'drive/v3/',
client_name: 'google-apis-drive_v3',
client_version: Google::Apis::DriveV3::GEM_VERSION)
@batch_path = 'batch/drive/v3'
end
# Gets information about the user, the user's Drive, and system capabilities.
# For more information, see [Return user info](https://developers.google.com/
# drive/api/guides/user-info). Required: The `fields` parameter must be set. To
# return the exact fields you need, see [Return specific fields](https://
# developers.google.com/drive/api/guides/fields-parameter).
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::About] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::About]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_about(fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'about', options)
command.response_representation = Google::Apis::DriveV3::About::Representation
command.response_class = Google::Apis::DriveV3::About
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Retrieves an AccessProposal by ID.
# @param [String] file_id
# Required. The id of the item the request is on.
# @param [String] proposal_id
# Required. The id of the access proposal to resolve.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::AccessProposal] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::AccessProposal]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_accessproposal(file_id, proposal_id, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'files/{fileId}/accessproposals/{proposalId}', options)
command.response_representation = Google::Apis::DriveV3::AccessProposal::Representation
command.response_class = Google::Apis::DriveV3::AccessProposal
command.params['fileId'] = file_id unless file_id.nil?
command.params['proposalId'] = proposal_id unless proposal_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# List the AccessProposals on a file. Note: Only approvers are able to list
# AccessProposals on a file. If the user is not an approver, returns a 403.
# @param [String] file_id
# Required. The id of the item the request is on.
# @param [Fixnum] page_size
# Optional. The number of results per page
# @param [String] page_token
# Optional. The continuation token on the list of access requests.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::ListAccessProposalsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::ListAccessProposalsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_accessproposals(file_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'files/{fileId}/accessproposals', options)
command.response_representation = Google::Apis::DriveV3::ListAccessProposalsResponse::Representation
command.response_class = Google::Apis::DriveV3::ListAccessProposalsResponse
command.params['fileId'] = file_id unless file_id.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Used to approve or deny an Access Proposal.
# @param [String] file_id
# Required. The id of the item the request is on.
# @param [String] proposal_id
# Required. The id of the access proposal to resolve.
# @param [Google::Apis::DriveV3::ResolveAccessProposalRequest] resolve_access_proposal_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def resolve_accessproposal_access_proposal(file_id, proposal_id, resolve_access_proposal_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'files/{fileId}/accessproposals/{proposalId}:resolve', options)
command.request_representation = Google::Apis::DriveV3::ResolveAccessProposalRequest::Representation
command.request_object = resolve_access_proposal_request_object
command.params['fileId'] = file_id unless file_id.nil?
command.params['proposalId'] = proposal_id unless proposal_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets a specific app. For more information, see [Return user info](https://
# developers.google.com/drive/api/guides/user-info).
# @param [String] app_id
# The ID of the app.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::App] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::App]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_app(app_id, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'apps/{appId}', options)
command.response_representation = Google::Apis::DriveV3::App::Representation
command.response_class = Google::Apis::DriveV3::App
command.params['appId'] = app_id unless app_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists a user's installed apps. For more information, see [Return user info](
# https://developers.google.com/drive/api/guides/user-info).
# @param [String] app_filter_extensions
# A comma-separated list of file extensions to limit returned results. All
# results within the given app query scope which can open any of the given file
# extensions are included in the response. If `appFilterMimeTypes` are provided
# as well, the result is a union of the two resulting app lists.
# @param [String] app_filter_mime_types
# A comma-separated list of file extensions to limit returned results. All
# results within the given app query scope which can open any of the given MIME
# types will be included in the response. If `appFilterExtensions` are provided
# as well, the result is a union of the two resulting app lists.
# @param [String] language_code
# A language or locale code, as defined by BCP 47, with some extensions from
# Unicode's LDML format (http://www.unicode.org/reports/tr35/).
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::AppList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::AppList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'apps', options)
command.response_representation = Google::Apis::DriveV3::AppList::Representation
command.response_class = Google::Apis::DriveV3::AppList
command.query['appFilterExtensions'] = app_filter_extensions unless app_filter_extensions.nil?
command.query['appFilterMimeTypes'] = app_filter_mime_types unless app_filter_mime_types.nil?
command.query['languageCode'] = language_code unless language_code.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the starting pageToken for listing future changes. For more information,
# see [Retrieve changes](https://developers.google.com/drive/api/guides/manage-
# changes).
# @param [String] drive_id
# The ID of the shared drive for which the starting pageToken for listing future
# changes from that shared drive will be returned.
# @param [Boolean] supports_all_drives
# Whether the requesting application supports both My Drives and shared drives.
# @param [Boolean] supports_team_drives
# Deprecated: Use `supportsAllDrives` instead.
# @param [String] team_drive_id
# Deprecated: Use `driveId` instead.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::StartPageToken] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::StartPageToken]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_changes_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'changes/startPageToken', options)
command.response_representation = Google::Apis::DriveV3::StartPageToken::Representation
command.response_class = Google::Apis::DriveV3::StartPageToken
command.query['driveId'] = drive_id unless drive_id.nil?
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists the changes for a user or shared drive. For more information, see [
# Retrieve changes](https://developers.google.com/drive/api/guides/manage-
# changes).
# @param [String] page_token
# The token for continuing a previous list request on the next page. This should
# be set to the value of 'nextPageToken' from the previous response or to the
# response from the getStartPageToken method.
# @param [String] drive_id
# The shared drive from which changes will be returned. If specified the change
# IDs will be reflective of the shared drive; use the combined drive ID and
# change ID as an identifier.
# @param [Boolean] include_corpus_removals
# Whether changes should include the file resource if the file is still
# accessible by the user at the time of the request, even when a file was
# removed from the list of changes and there will be no further change entries
# for this file.
# @param [Boolean] include_items_from_all_drives
# Whether both My Drive and shared drive items should be included in results.
# @param [String] include_labels
# A comma-separated list of IDs of labels to include in the `labelInfo` part of
# the response.
# @param [String] include_permissions_for_view
# Specifies which additional view's permissions to include in the response. Only
# 'published' is supported.
# @param [Boolean] include_removed
# Whether to include changes indicating that items have been removed from the
# list of changes, for example by deletion or loss of access.
# @param [Boolean] include_team_drive_items
# Deprecated: Use `includeItemsFromAllDrives` instead.
# @param [Fixnum] page_size
# The maximum number of changes to return per page.
# @param [Boolean] restrict_to_my_drive
# Whether to restrict the results to changes inside the My Drive hierarchy. This
# omits changes to files such as those in the Application Data folder or shared
# files which have not been added to My Drive.
# @param [String] spaces
# A comma-separated list of spaces to query within the corpora. Supported values
# are 'drive' and 'appDataFolder'.
# @param [Boolean] supports_all_drives
# Whether the requesting application supports both My Drives and shared drives.
# @param [Boolean] supports_team_drives
# Deprecated: Use `supportsAllDrives` instead.
# @param [String] team_drive_id
# Deprecated: Use `driveId` instead.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::ChangeList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::ChangeList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_changes(page_token, drive_id: nil, include_corpus_removals: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'changes', options)
command.response_representation = Google::Apis::DriveV3::ChangeList::Representation
command.response_class = Google::Apis::DriveV3::ChangeList
command.query['driveId'] = drive_id unless drive_id.nil?
command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
command.query['includeLabels'] = include_labels unless include_labels.nil?
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
command.query['includeRemoved'] = include_removed unless include_removed.nil?
command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
command.query['spaces'] = spaces unless spaces.nil?
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Subscribes to changes for a user. For more information, see [Notifications for
# resource changes](https://developers.google.com/drive/api/guides/push).
# @param [String] page_token
# The token for continuing a previous list request on the next page. This should
# be set to the value of 'nextPageToken' from the previous response or to the
# response from the getStartPageToken method.
# @param [Google::Apis::DriveV3::Channel] channel_object
# @param [String] drive_id
# The shared drive from which changes will be returned. If specified the change
# IDs will be reflective of the shared drive; use the combined drive ID and
# change ID as an identifier.
# @param [Boolean] include_corpus_removals
# Whether changes should include the file resource if the file is still
# accessible by the user at the time of the request, even when a file was
# removed from the list of changes and there will be no further change entries
# for this file.
# @param [Boolean] include_items_from_all_drives
# Whether both My Drive and shared drive items should be included in results.
# @param [String] include_labels
# A comma-separated list of IDs of labels to include in the `labelInfo` part of
# the response.
# @param [String] include_permissions_for_view
# Specifies which additional view's permissions to include in the response. Only
# 'published' is supported.
# @param [Boolean] include_removed
# Whether to include changes indicating that items have been removed from the
# list of changes, for example by deletion or loss of access.
# @param [Boolean] include_team_drive_items
# Deprecated: Use `includeItemsFromAllDrives` instead.
# @param [Fixnum] page_size
# The maximum number of changes to return per page.
# @param [Boolean] restrict_to_my_drive
# Whether to restrict the results to changes inside the My Drive hierarchy. This
# omits changes to files such as those in the Application Data folder or shared
# files which have not been added to My Drive.
# @param [String] spaces
# A comma-separated list of spaces to query within the corpora. Supported values
# are 'drive' and 'appDataFolder'.
# @param [Boolean] supports_all_drives
# Whether the requesting application supports both My Drives and shared drives.
# @param [Boolean] supports_team_drives
# Deprecated: Use `supportsAllDrives` instead.
# @param [String] team_drive_id
# Deprecated: Use `driveId` instead.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Channel] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Channel]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def watch_change(page_token, channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'changes/watch', options)
command.request_representation = Google::Apis::DriveV3::Channel::Representation
command.request_object = channel_object
command.response_representation = Google::Apis::DriveV3::Channel::Representation
command.response_class = Google::Apis::DriveV3::Channel
command.query['driveId'] = drive_id unless drive_id.nil?
command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
command.query['includeLabels'] = include_labels unless include_labels.nil?
command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
command.query['includeRemoved'] = include_removed unless include_removed.nil?
command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
command.query['spaces'] = spaces unless spaces.nil?
command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Stops watching resources through this channel. For more information, see [
# Notifications for resource changes](https://developers.google.com/drive/api/
# guides/push).
# @param [Google::Apis::DriveV3::Channel] channel_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'channels/stop', options)
command.request_representation = Google::Apis::DriveV3::Channel::Representation
command.request_object = channel_object
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a comment on a file. For more information, see [Manage comments and
# replies](https://developers.google.com/drive/api/guides/manage-comments).
# Required: The `fields` parameter must be set. To return the exact fields you
# need, see [Return specific fields](https://developers.google.com/drive/api/
# guides/fields-parameter).
# @param [String] file_id
# The ID of the file.
# @param [Google::Apis::DriveV3::Comment] comment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Comment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'files/{fileId}/comments', options)
command.request_representation = Google::Apis::DriveV3::Comment::Representation
command.request_object = comment_object
command.response_representation = Google::Apis::DriveV3::Comment::Representation
command.response_class = Google::Apis::DriveV3::Comment
command.params['fileId'] = file_id unless file_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a comment. For more information, see [Manage comments and replies](
# https://developers.google.com/drive/api/guides/manage-comments). Required: The
# `fields` parameter must be set. To return the exact fields you need, see [
# Return specific fields](https://developers.google.com/drive/api/guides/fields-
# parameter).
# @param [String] file_id
# The ID of the file.
# @param [String] comment_id
# The ID of the comment.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', options)
command.params['fileId'] = file_id unless file_id.nil?
command.params['commentId'] = comment_id unless comment_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets a comment by ID. For more information, see [Manage comments and replies](
# https://developers.google.com/drive/api/guides/manage-comments). Required: The
# `fields` parameter must be set. To return the exact fields you need, see [
# Return specific fields](https://developers.google.com/drive/api/guides/fields-
# parameter).
# @param [String] file_id
# The ID of the file.
# @param [String] comment_id
# The ID of the comment.
# @param [Boolean] include_deleted
# Whether to return deleted comments. Deleted comments will not include their
# original content.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Comment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', options)
command.response_representation = Google::Apis::DriveV3::Comment::Representation
command.response_class = Google::Apis::DriveV3::Comment
command.params['fileId'] = file_id unless file_id.nil?
command.params['commentId'] = comment_id unless comment_id.nil?
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists a file's comments. For more information, see [Manage comments and
# replies](https://developers.google.com/drive/api/guides/manage-comments).
# Required: The `fields` parameter must be set. To return the exact fields you
# need, see [Return specific fields](https://developers.google.com/drive/api/
# guides/fields-parameter).
# @param [String] file_id
# The ID of the file.
# @param [Boolean] include_deleted
# Whether to include deleted comments. Deleted comments will not include their
# original content.
# @param [Fixnum] page_size
# The maximum number of comments to return per page.
# @param [String] page_token
# The token for continuing a previous list request on the next page. This should
# be set to the value of 'nextPageToken' from the previous response.
# @param [String] start_modified_time
# The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-
# time).
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::CommentList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::CommentList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_comments(file_id, include_deleted: nil, page_size: nil, page_token: nil, start_modified_time: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'files/{fileId}/comments', options)
command.response_representation = Google::Apis::DriveV3::CommentList::Representation
command.response_class = Google::Apis::DriveV3::CommentList
command.params['fileId'] = file_id unless file_id.nil?
command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['startModifiedTime'] = start_modified_time unless start_modified_time.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Updates a comment with patch semantics. For more information, see [Manage
# comments and replies](https://developers.google.com/drive/api/guides/manage-
# comments). Required: The `fields` parameter must be set. To return the exact
# fields you need, see [Return specific fields](https://developers.google.com/
# drive/api/guides/fields-parameter).
# @param [String] file_id
# The ID of the file.
# @param [String] comment_id
# The ID of the comment.
# @param [Google::Apis::DriveV3::Comment] comment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Comment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Comment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', options)
command.request_representation = Google::Apis::DriveV3::Comment::Representation
command.request_object = comment_object
command.response_representation = Google::Apis::DriveV3::Comment::Representation
command.response_class = Google::Apis::DriveV3::Comment
command.params['fileId'] = file_id unless file_id.nil?
command.params['commentId'] = comment_id unless comment_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a shared drive.
# @param [String] request_id
# Required. An ID, such as a random UUID, which uniquely identifies this user's
# request for idempotent creation of a shared drive. A repeated request by the
# same user and with the same request ID will avoid creating duplicates by
# attempting to create the same shared drive. If the shared drive already exists
# a 409 error will be returned.
# @param [Google::Apis::DriveV3::Drive] drive_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Drive] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Drive]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'drives', options)
command.request_representation = Google::Apis::DriveV3::Drive::Representation
command.request_object = drive_object
command.response_representation = Google::Apis::DriveV3::Drive::Representation
command.response_class = Google::Apis::DriveV3::Drive
command.query['requestId'] = request_id unless request_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Permanently deletes a shared drive for which the user is an `organizer`. The
# shared drive cannot contain any untrashed items.
# @param [String] drive_id
# The ID of the shared drive.
# @param [Boolean] allow_item_deletion
# Whether any items inside the shared drive should also be deleted. This option
# is only supported when `useDomainAdminAccess` is also set to `true`.
# @param [Boolean] use_domain_admin_access
# Issue the request as a domain administrator; if set to true, then the
# requester will be granted access if they are an administrator of the domain to
# which the shared drive belongs.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_drive(drive_id, allow_item_deletion: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'drives/{driveId}', options)
command.params['driveId'] = drive_id unless drive_id.nil?
command.query['allowItemDeletion'] = allow_item_deletion unless allow_item_deletion.nil?
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets a shared drive's metadata by ID.
# @param [String] drive_id
# The ID of the shared drive.
# @param [Boolean] use_domain_admin_access
# Issue the request as a domain administrator; if set to true, then the
# requester will be granted access if they are an administrator of the domain to
# which the shared drive belongs.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Drive] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Drive]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'drives/{driveId}', options)
command.response_representation = Google::Apis::DriveV3::Drive::Representation
command.response_class = Google::Apis::DriveV3::Drive
command.params['driveId'] = drive_id unless drive_id.nil?
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Hides a shared drive from the default view.
# @param [String] drive_id
# The ID of the shared drive.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Drive] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Drive]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def hide_drive(drive_id, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'drives/{driveId}/hide', options)
command.response_representation = Google::Apis::DriveV3::Drive::Representation
command.response_class = Google::Apis::DriveV3::Drive
command.params['driveId'] = drive_id unless drive_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists the user's shared drives. This method accepts the `q` parameter, which
# is a search query combining one or more search terms. For more information,
# see the [Search for shared drives](/drive/api/guides/search-shareddrives)
# guide.
# @param [Fixnum] page_size
# Maximum number of shared drives to return per page.
# @param [String] page_token
# Page token for shared drives.
# @param [String] q
# Query string for searching shared drives.
# @param [Boolean] use_domain_admin_access
# Issue the request as a domain administrator; if set to true, then all shared
# drives of the domain in which the requester is an administrator are returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::DriveList] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::DriveList]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_drives(page_size: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'drives', options)
command.response_representation = Google::Apis::DriveV3::DriveList::Representation
command.response_class = Google::Apis::DriveV3::DriveList
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['q'] = q unless q.nil?
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Restores a shared drive to the default view.
# @param [String] drive_id
# The ID of the shared drive.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Drive] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Drive]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def unhide_drive(drive_id, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'drives/{driveId}/unhide', options)
command.response_representation = Google::Apis::DriveV3::Drive::Representation
command.response_class = Google::Apis::DriveV3::Drive
command.params['driveId'] = drive_id unless drive_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Updates the metadata for a shared drive.
# @param [String] drive_id
# The ID of the shared drive.
# @param [Google::Apis::DriveV3::Drive] drive_object
# @param [Boolean] use_domain_admin_access
# Issue the request as a domain administrator; if set to true, then the
# requester will be granted access if they are an administrator of the domain to
# which the shared drive belongs.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::Drive] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::DriveV3::Drive]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'drives/{driveId}', options)
command.request_representation = Google::Apis::DriveV3::Drive::Representation
command.request_object = drive_object
command.response_representation = Google::Apis::DriveV3::Drive::Representation
command.response_class = Google::Apis::DriveV3::Drive
command.params['driveId'] = drive_id unless drive_id.nil?
command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a copy of a file and applies any requested updates with patch
# semantics.
# @param [String] file_id
# The ID of the file.
# @param [Google::Apis::DriveV3::File] file_object
# @param [Boolean] enforce_single_parent
# Deprecated. Copying files into multiple folders is no longer supported. Use
# shortcuts instead.
# @param [Boolean] ignore_default_visibility
# Whether to ignore the domain's default visibility settings for the created
# file. Domain administrators can choose to make all uploaded files visible to
# the domain by default; this parameter bypasses that behavior for the request.
# Permissions are still inherited from parent folders.
# @param [String] include_labels
# A comma-separated list of IDs of labels to include in the `labelInfo` part of
# the response.
# @param [String] include_permissions_for_view
# Specifies which additional view's permissions to include in the response. Only
# 'published' is supported.
# @param [Boolean] keep_revision_forever
# Whether to set the 'keepForever' field in the new head revision. This is only
# applicable to files with binary content in Google Drive. Only 200 revisions
# for the file can be kept forever. If the limit is reached, try deleting pinned
# revisions.
# @param [String] ocr_language
# A language hint for OCR processing during image import (ISO 639-1 code).
# @param [Boolean] supports_all_drives
# Whether the requesting application supports both My Drives and shared drives.
# @param [Boolean] supports_team_drives
# Deprecated: Use `supportsAllDrives` instead.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::DriveV3::File] parsed result object
# @yieldparam err [StandardError] error object if request failed
#