-
Notifications
You must be signed in to change notification settings - Fork 867
/
classes.rb
3038 lines (2570 loc) · 135 KB
/
classes.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 2015 Google Inc.
#
# 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 'date'
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
# Information about the user, the user's Drive, and system capabilities.
class About
include Google::Apis::Core::Hashable
# Whether the user has installed the requesting app.
# Corresponds to the JSON property `appInstalled`
# @return [Boolean]
attr_accessor :app_installed
alias_method :app_installed?, :app_installed
# Whether the user can create shared drives.
# Corresponds to the JSON property `canCreateDrives`
# @return [Boolean]
attr_accessor :can_create_drives
alias_method :can_create_drives?, :can_create_drives
# Deprecated - use canCreateDrives instead.
# Corresponds to the JSON property `canCreateTeamDrives`
# @return [Boolean]
attr_accessor :can_create_team_drives
alias_method :can_create_team_drives?, :can_create_team_drives
# A list of themes that are supported for shared drives.
# Corresponds to the JSON property `driveThemes`
# @return [Array<Google::Apis::DriveV3::About::DriveTheme>]
attr_accessor :drive_themes
# A map of source MIME type to possible targets for all supported exports.
# Corresponds to the JSON property `exportFormats`
# @return [Hash<String,Array<String>>]
attr_accessor :export_formats
# The currently supported folder colors as RGB hex strings.
# Corresponds to the JSON property `folderColorPalette`
# @return [Array<String>]
attr_accessor :folder_color_palette
# A map of source MIME type to possible targets for all supported imports.
# Corresponds to the JSON property `importFormats`
# @return [Hash<String,Array<String>>]
attr_accessor :import_formats
# Identifies what kind of resource this is. Value: the fixed string "drive#about"
# .
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# A map of maximum import sizes by MIME type, in bytes.
# Corresponds to the JSON property `maxImportSizes`
# @return [Hash<String,Fixnum>]
attr_accessor :max_import_sizes
# The maximum upload size in bytes.
# Corresponds to the JSON property `maxUploadSize`
# @return [Fixnum]
attr_accessor :max_upload_size
# The user's storage quota limits and usage. All fields are measured in bytes.
# Corresponds to the JSON property `storageQuota`
# @return [Google::Apis::DriveV3::About::StorageQuota]
attr_accessor :storage_quota
# Deprecated - use driveThemes instead.
# Corresponds to the JSON property `teamDriveThemes`
# @return [Array<Google::Apis::DriveV3::About::TeamDriveTheme>]
attr_accessor :team_drive_themes
# Information about a Drive user.
# Corresponds to the JSON property `user`
# @return [Google::Apis::DriveV3::User]
attr_accessor :user
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@app_installed = args[:app_installed] if args.key?(:app_installed)
@can_create_drives = args[:can_create_drives] if args.key?(:can_create_drives)
@can_create_team_drives = args[:can_create_team_drives] if args.key?(:can_create_team_drives)
@drive_themes = args[:drive_themes] if args.key?(:drive_themes)
@export_formats = args[:export_formats] if args.key?(:export_formats)
@folder_color_palette = args[:folder_color_palette] if args.key?(:folder_color_palette)
@import_formats = args[:import_formats] if args.key?(:import_formats)
@kind = args[:kind] if args.key?(:kind)
@max_import_sizes = args[:max_import_sizes] if args.key?(:max_import_sizes)
@max_upload_size = args[:max_upload_size] if args.key?(:max_upload_size)
@storage_quota = args[:storage_quota] if args.key?(:storage_quota)
@team_drive_themes = args[:team_drive_themes] if args.key?(:team_drive_themes)
@user = args[:user] if args.key?(:user)
end
#
class DriveTheme
include Google::Apis::Core::Hashable
# A link to this theme's background image.
# Corresponds to the JSON property `backgroundImageLink`
# @return [String]
attr_accessor :background_image_link
# The color of this theme as an RGB hex string.
# Corresponds to the JSON property `colorRgb`
# @return [String]
attr_accessor :color_rgb
# The ID of the theme.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@background_image_link = args[:background_image_link] if args.key?(:background_image_link)
@color_rgb = args[:color_rgb] if args.key?(:color_rgb)
@id = args[:id] if args.key?(:id)
end
end
# The user's storage quota limits and usage. All fields are measured in bytes.
class StorageQuota
include Google::Apis::Core::Hashable
# The usage limit, if applicable. This will not be present if the user has
# unlimited storage.
# Corresponds to the JSON property `limit`
# @return [Fixnum]
attr_accessor :limit
# The total usage across all services.
# Corresponds to the JSON property `usage`
# @return [Fixnum]
attr_accessor :usage
# The usage by all files in Google Drive.
# Corresponds to the JSON property `usageInDrive`
# @return [Fixnum]
attr_accessor :usage_in_drive
# The usage by trashed files in Google Drive.
# Corresponds to the JSON property `usageInDriveTrash`
# @return [Fixnum]
attr_accessor :usage_in_drive_trash
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@limit = args[:limit] if args.key?(:limit)
@usage = args[:usage] if args.key?(:usage)
@usage_in_drive = args[:usage_in_drive] if args.key?(:usage_in_drive)
@usage_in_drive_trash = args[:usage_in_drive_trash] if args.key?(:usage_in_drive_trash)
end
end
#
class TeamDriveTheme
include Google::Apis::Core::Hashable
# Deprecated - use driveThemes/backgroundImageLink instead.
# Corresponds to the JSON property `backgroundImageLink`
# @return [String]
attr_accessor :background_image_link
# Deprecated - use driveThemes/colorRgb instead.
# Corresponds to the JSON property `colorRgb`
# @return [String]
attr_accessor :color_rgb
# Deprecated - use driveThemes/id instead.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@background_image_link = args[:background_image_link] if args.key?(:background_image_link)
@color_rgb = args[:color_rgb] if args.key?(:color_rgb)
@id = args[:id] if args.key?(:id)
end
end
end
# A change to a file or shared drive.
class Change
include Google::Apis::Core::Hashable
# The type of the change. Possible values are file and drive.
# Corresponds to the JSON property `changeType`
# @return [String]
attr_accessor :change_type
# Representation of a shared drive.
# Corresponds to the JSON property `drive`
# @return [Google::Apis::DriveV3::Drive]
attr_accessor :drive
# The ID of the shared drive associated with this change.
# Corresponds to the JSON property `driveId`
# @return [String]
attr_accessor :drive_id
# The metadata for a file.
# Corresponds to the JSON property `file`
# @return [Google::Apis::DriveV3::File]
attr_accessor :file
# The ID of the file which has changed.
# Corresponds to the JSON property `fileId`
# @return [String]
attr_accessor :file_id
# Identifies what kind of resource this is. Value: the fixed string "drive#
# change".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Whether the file or shared drive has been removed from this list of changes,
# for example by deletion or loss of access.
# Corresponds to the JSON property `removed`
# @return [Boolean]
attr_accessor :removed
alias_method :removed?, :removed
# Deprecated: use the drive collection instead.
# Corresponds to the JSON property `teamDrive`
# @return [Google::Apis::DriveV3::TeamDrive]
attr_accessor :team_drive
# Deprecated - use driveId instead.
# Corresponds to the JSON property `teamDriveId`
# @return [String]
attr_accessor :team_drive_id
# The time of this change (RFC 3339 date-time).
# Corresponds to the JSON property `time`
# @return [DateTime]
attr_accessor :time
# Deprecated - use changeType instead.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@change_type = args[:change_type] if args.key?(:change_type)
@drive = args[:drive] if args.key?(:drive)
@drive_id = args[:drive_id] if args.key?(:drive_id)
@file = args[:file] if args.key?(:file)
@file_id = args[:file_id] if args.key?(:file_id)
@kind = args[:kind] if args.key?(:kind)
@removed = args[:removed] if args.key?(:removed)
@team_drive = args[:team_drive] if args.key?(:team_drive)
@team_drive_id = args[:team_drive_id] if args.key?(:team_drive_id)
@time = args[:time] if args.key?(:time)
@type = args[:type] if args.key?(:type)
end
end
# A list of changes for a user.
class ChangeList
include Google::Apis::Core::Hashable
# The list of changes. If nextPageToken is populated, then this list may be
# incomplete and an additional page of results should be fetched.
# Corresponds to the JSON property `changes`
# @return [Array<Google::Apis::DriveV3::Change>]
attr_accessor :changes
# Identifies what kind of resource this is. Value: the fixed string "drive#
# changeList".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The starting page token for future changes. This will be present only if the
# end of the current changes list has been reached.
# Corresponds to the JSON property `newStartPageToken`
# @return [String]
attr_accessor :new_start_page_token
# The page token for the next page of changes. This will be absent if the end of
# the changes list has been reached. If the token is rejected for any reason, it
# should be discarded, and pagination should be restarted from the first page of
# results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@changes = args[:changes] if args.key?(:changes)
@kind = args[:kind] if args.key?(:kind)
@new_start_page_token = args[:new_start_page_token] if args.key?(:new_start_page_token)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# An notification channel used to watch for resource changes.
class Channel
include Google::Apis::Core::Hashable
# The address where notifications are delivered for this channel.
# Corresponds to the JSON property `address`
# @return [String]
attr_accessor :address
# Date and time of notification channel expiration, expressed as a Unix
# timestamp, in milliseconds. Optional.
# Corresponds to the JSON property `expiration`
# @return [Fixnum]
attr_accessor :expiration
# A UUID or similar unique string that identifies this channel.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies this as a notification channel used to watch for changes to a
# resource, which is "api#channel".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Additional parameters controlling delivery channel behavior. Optional.
# Corresponds to the JSON property `params`
# @return [Hash<String,String>]
attr_accessor :params
# A Boolean value to indicate whether payload is wanted. Optional.
# Corresponds to the JSON property `payload`
# @return [Boolean]
attr_accessor :payload
alias_method :payload?, :payload
# An opaque ID that identifies the resource being watched on this channel.
# Stable across different API versions.
# Corresponds to the JSON property `resourceId`
# @return [String]
attr_accessor :resource_id
# A version-specific identifier for the watched resource.
# Corresponds to the JSON property `resourceUri`
# @return [String]
attr_accessor :resource_uri
# An arbitrary string delivered to the target address with each notification
# delivered over this channel. Optional.
# Corresponds to the JSON property `token`
# @return [String]
attr_accessor :token
# The type of delivery mechanism used for this channel.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@address = args[:address] if args.key?(:address)
@expiration = args[:expiration] if args.key?(:expiration)
@id = args[:id] if args.key?(:id)
@kind = args[:kind] if args.key?(:kind)
@params = args[:params] if args.key?(:params)
@payload = args[:payload] if args.key?(:payload)
@resource_id = args[:resource_id] if args.key?(:resource_id)
@resource_uri = args[:resource_uri] if args.key?(:resource_uri)
@token = args[:token] if args.key?(:token)
@type = args[:type] if args.key?(:type)
end
end
# A comment on a file.
class Comment
include Google::Apis::Core::Hashable
# A region of the document represented as a JSON string. See anchor
# documentation for details on how to define and interpret anchor properties.
# Corresponds to the JSON property `anchor`
# @return [String]
attr_accessor :anchor
# Information about a Drive user.
# Corresponds to the JSON property `author`
# @return [Google::Apis::DriveV3::User]
attr_accessor :author
# The plain text content of the comment. This field is used for setting the
# content, while htmlContent should be displayed.
# Corresponds to the JSON property `content`
# @return [String]
attr_accessor :content
# The time at which the comment was created (RFC 3339 date-time).
# Corresponds to the JSON property `createdTime`
# @return [DateTime]
attr_accessor :created_time
# Whether the comment has been deleted. A deleted comment has no content.
# Corresponds to the JSON property `deleted`
# @return [Boolean]
attr_accessor :deleted
alias_method :deleted?, :deleted
# The content of the comment with HTML formatting.
# Corresponds to the JSON property `htmlContent`
# @return [String]
attr_accessor :html_content
# The ID of the comment.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies what kind of resource this is. Value: the fixed string "drive#
# comment".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The last time the comment or any of its replies was modified (RFC 3339 date-
# time).
# Corresponds to the JSON property `modifiedTime`
# @return [DateTime]
attr_accessor :modified_time
# The file content to which the comment refers, typically within the anchor
# region. For a text file, for example, this would be the text at the location
# of the comment.
# Corresponds to the JSON property `quotedFileContent`
# @return [Google::Apis::DriveV3::Comment::QuotedFileContent]
attr_accessor :quoted_file_content
# The full list of replies to the comment in chronological order.
# Corresponds to the JSON property `replies`
# @return [Array<Google::Apis::DriveV3::Reply>]
attr_accessor :replies
# Whether the comment has been resolved by one of its replies.
# Corresponds to the JSON property `resolved`
# @return [Boolean]
attr_accessor :resolved
alias_method :resolved?, :resolved
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@anchor = args[:anchor] if args.key?(:anchor)
@author = args[:author] if args.key?(:author)
@content = args[:content] if args.key?(:content)
@created_time = args[:created_time] if args.key?(:created_time)
@deleted = args[:deleted] if args.key?(:deleted)
@html_content = args[:html_content] if args.key?(:html_content)
@id = args[:id] if args.key?(:id)
@kind = args[:kind] if args.key?(:kind)
@modified_time = args[:modified_time] if args.key?(:modified_time)
@quoted_file_content = args[:quoted_file_content] if args.key?(:quoted_file_content)
@replies = args[:replies] if args.key?(:replies)
@resolved = args[:resolved] if args.key?(:resolved)
end
# The file content to which the comment refers, typically within the anchor
# region. For a text file, for example, this would be the text at the location
# of the comment.
class QuotedFileContent
include Google::Apis::Core::Hashable
# The MIME type of the quoted content.
# Corresponds to the JSON property `mimeType`
# @return [String]
attr_accessor :mime_type
# The quoted content itself. This is interpreted as plain text if set through
# the API.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@mime_type = args[:mime_type] if args.key?(:mime_type)
@value = args[:value] if args.key?(:value)
end
end
end
# A list of comments on a file.
class CommentList
include Google::Apis::Core::Hashable
# The list of comments. If nextPageToken is populated, then this list may be
# incomplete and an additional page of results should be fetched.
# Corresponds to the JSON property `comments`
# @return [Array<Google::Apis::DriveV3::Comment>]
attr_accessor :comments
# Identifies what kind of resource this is. Value: the fixed string "drive#
# commentList".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The page token for the next page of comments. This will be absent if the end
# of the comments list has been reached. If the token is rejected for any reason,
# it should be discarded, and pagination should be restarted from the first
# page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@comments = args[:comments] if args.key?(:comments)
@kind = args[:kind] if args.key?(:kind)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# A restriction for accessing the content of the file.
class ContentRestriction
include Google::Apis::Core::Hashable
# Whether the content of the file is read-only. If a file is read-only, a new
# revision of the file may not be added, comments may not be added or modified,
# and the title of the file may not be modified.
# Corresponds to the JSON property `readOnly`
# @return [Boolean]
attr_accessor :read_only
alias_method :read_only?, :read_only
# Reason for why the content of the file is restricted. This is only mutable on
# requests that also set readOnly=true.
# Corresponds to the JSON property `reason`
# @return [String]
attr_accessor :reason
# Information about a Drive user.
# Corresponds to the JSON property `restrictingUser`
# @return [Google::Apis::DriveV3::User]
attr_accessor :restricting_user
# The time at which the content restriction was set (formatted RFC 3339
# timestamp). Only populated if readOnly is true.
# Corresponds to the JSON property `restrictionTime`
# @return [DateTime]
attr_accessor :restriction_time
# The type of the content restriction. Currently the only possible value is
# globalContentRestriction.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@read_only = args[:read_only] if args.key?(:read_only)
@reason = args[:reason] if args.key?(:reason)
@restricting_user = args[:restricting_user] if args.key?(:restricting_user)
@restriction_time = args[:restriction_time] if args.key?(:restriction_time)
@type = args[:type] if args.key?(:type)
end
end
# Representation of a shared drive.
class Drive
include Google::Apis::Core::Hashable
# An image file and cropping parameters from which a background image for this
# shared drive is set. This is a write only field; it can only be set on drive.
# drives.update requests that don't set themeId. When specified, all fields of
# the backgroundImageFile must be set.
# Corresponds to the JSON property `backgroundImageFile`
# @return [Google::Apis::DriveV3::Drive::BackgroundImageFile]
attr_accessor :background_image_file
# A short-lived link to this shared drive's background image.
# Corresponds to the JSON property `backgroundImageLink`
# @return [String]
attr_accessor :background_image_link
# Capabilities the current user has on this shared drive.
# Corresponds to the JSON property `capabilities`
# @return [Google::Apis::DriveV3::Drive::Capabilities]
attr_accessor :capabilities
# The color of this shared drive as an RGB hex string. It can only be set on a
# drive.drives.update request that does not set themeId.
# Corresponds to the JSON property `colorRgb`
# @return [String]
attr_accessor :color_rgb
# The time at which the shared drive was created (RFC 3339 date-time).
# Corresponds to the JSON property `createdTime`
# @return [DateTime]
attr_accessor :created_time
# Whether the shared drive is hidden from default view.
# Corresponds to the JSON property `hidden`
# @return [Boolean]
attr_accessor :hidden
alias_method :hidden?, :hidden
# The ID of this shared drive which is also the ID of the top level folder of
# this shared drive.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies what kind of resource this is. Value: the fixed string "drive#drive"
# .
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The name of this shared drive.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# A set of restrictions that apply to this shared drive or items inside this
# shared drive.
# Corresponds to the JSON property `restrictions`
# @return [Google::Apis::DriveV3::Drive::Restrictions]
attr_accessor :restrictions
# The ID of the theme from which the background image and color will be set. The
# set of possible driveThemes can be retrieved from a drive.about.get response.
# When not specified on a drive.drives.create request, a random theme is chosen
# from which the background image and color are set. This is a write-only field;
# it can only be set on requests that don't set colorRgb or backgroundImageFile.
# Corresponds to the JSON property `themeId`
# @return [String]
attr_accessor :theme_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@background_image_file = args[:background_image_file] if args.key?(:background_image_file)
@background_image_link = args[:background_image_link] if args.key?(:background_image_link)
@capabilities = args[:capabilities] if args.key?(:capabilities)
@color_rgb = args[:color_rgb] if args.key?(:color_rgb)
@created_time = args[:created_time] if args.key?(:created_time)
@hidden = args[:hidden] if args.key?(:hidden)
@id = args[:id] if args.key?(:id)
@kind = args[:kind] if args.key?(:kind)
@name = args[:name] if args.key?(:name)
@restrictions = args[:restrictions] if args.key?(:restrictions)
@theme_id = args[:theme_id] if args.key?(:theme_id)
end
# An image file and cropping parameters from which a background image for this
# shared drive is set. This is a write only field; it can only be set on drive.
# drives.update requests that don't set themeId. When specified, all fields of
# the backgroundImageFile must be set.
class BackgroundImageFile
include Google::Apis::Core::Hashable
# The ID of an image file in Google Drive to use for the background image.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# The width of the cropped image in the closed range of 0 to 1. This value
# represents the width of the cropped image divided by the width of the entire
# image. The height is computed by applying a width to height aspect ratio of 80
# to 9. The resulting image must be at least 1280 pixels wide and 144 pixels
# high.
# Corresponds to the JSON property `width`
# @return [Float]
attr_accessor :width
# The X coordinate of the upper left corner of the cropping area in the
# background image. This is a value in the closed range of 0 to 1. This value
# represents the horizontal distance from the left side of the entire image to
# the left side of the cropping area divided by the width of the entire image.
# Corresponds to the JSON property `xCoordinate`
# @return [Float]
attr_accessor :x_coordinate
# The Y coordinate of the upper left corner of the cropping area in the
# background image. This is a value in the closed range of 0 to 1. This value
# represents the vertical distance from the top side of the entire image to the
# top side of the cropping area divided by the height of the entire image.
# Corresponds to the JSON property `yCoordinate`
# @return [Float]
attr_accessor :y_coordinate
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] if args.key?(:id)
@width = args[:width] if args.key?(:width)
@x_coordinate = args[:x_coordinate] if args.key?(:x_coordinate)
@y_coordinate = args[:y_coordinate] if args.key?(:y_coordinate)
end
end
# Capabilities the current user has on this shared drive.
class Capabilities
include Google::Apis::Core::Hashable
# Whether the current user can add children to folders in this shared drive.
# Corresponds to the JSON property `canAddChildren`
# @return [Boolean]
attr_accessor :can_add_children
alias_method :can_add_children?, :can_add_children
# Whether the current user can change the copyRequiresWriterPermission
# restriction of this shared drive.
# Corresponds to the JSON property `canChangeCopyRequiresWriterPermissionRestriction`
# @return [Boolean]
attr_accessor :can_change_copy_requires_writer_permission_restriction
alias_method :can_change_copy_requires_writer_permission_restriction?, :can_change_copy_requires_writer_permission_restriction
# Whether the current user can change the domainUsersOnly restriction of this
# shared drive.
# Corresponds to the JSON property `canChangeDomainUsersOnlyRestriction`
# @return [Boolean]
attr_accessor :can_change_domain_users_only_restriction
alias_method :can_change_domain_users_only_restriction?, :can_change_domain_users_only_restriction
# Whether the current user can change the background of this shared drive.
# Corresponds to the JSON property `canChangeDriveBackground`
# @return [Boolean]
attr_accessor :can_change_drive_background
alias_method :can_change_drive_background?, :can_change_drive_background
# Whether the current user can change the driveMembersOnly restriction of this
# shared drive.
# Corresponds to the JSON property `canChangeDriveMembersOnlyRestriction`
# @return [Boolean]
attr_accessor :can_change_drive_members_only_restriction
alias_method :can_change_drive_members_only_restriction?, :can_change_drive_members_only_restriction
# Whether the current user can comment on files in this shared drive.
# Corresponds to the JSON property `canComment`
# @return [Boolean]
attr_accessor :can_comment
alias_method :can_comment?, :can_comment
# Whether the current user can copy files in this shared drive.
# Corresponds to the JSON property `canCopy`
# @return [Boolean]
attr_accessor :can_copy
alias_method :can_copy?, :can_copy
# Whether the current user can delete children from folders in this shared drive.
# Corresponds to the JSON property `canDeleteChildren`
# @return [Boolean]
attr_accessor :can_delete_children
alias_method :can_delete_children?, :can_delete_children
# Whether the current user can delete this shared drive. Attempting to delete
# the shared drive may still fail if there are untrashed items inside the shared
# drive.
# Corresponds to the JSON property `canDeleteDrive`
# @return [Boolean]
attr_accessor :can_delete_drive
alias_method :can_delete_drive?, :can_delete_drive
# Whether the current user can download files in this shared drive.
# Corresponds to the JSON property `canDownload`
# @return [Boolean]
attr_accessor :can_download
alias_method :can_download?, :can_download
# Whether the current user can edit files in this shared drive
# Corresponds to the JSON property `canEdit`
# @return [Boolean]
attr_accessor :can_edit
alias_method :can_edit?, :can_edit
# Whether the current user can list the children of folders in this shared drive.
# Corresponds to the JSON property `canListChildren`
# @return [Boolean]
attr_accessor :can_list_children
alias_method :can_list_children?, :can_list_children
# Whether the current user can add members to this shared drive or remove them
# or change their role.
# Corresponds to the JSON property `canManageMembers`
# @return [Boolean]
attr_accessor :can_manage_members
alias_method :can_manage_members?, :can_manage_members
# Whether the current user can read the revisions resource of files in this
# shared drive.
# Corresponds to the JSON property `canReadRevisions`
# @return [Boolean]
attr_accessor :can_read_revisions
alias_method :can_read_revisions?, :can_read_revisions
# Whether the current user can rename files or folders in this shared drive.
# Corresponds to the JSON property `canRename`
# @return [Boolean]
attr_accessor :can_rename
alias_method :can_rename?, :can_rename
# Whether the current user can rename this shared drive.
# Corresponds to the JSON property `canRenameDrive`
# @return [Boolean]
attr_accessor :can_rename_drive
alias_method :can_rename_drive?, :can_rename_drive
# Whether the current user can share files or folders in this shared drive.
# Corresponds to the JSON property `canShare`
# @return [Boolean]
attr_accessor :can_share
alias_method :can_share?, :can_share
# Whether the current user can trash children from folders in this shared drive.
# Corresponds to the JSON property `canTrashChildren`
# @return [Boolean]
attr_accessor :can_trash_children
alias_method :can_trash_children?, :can_trash_children
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@can_add_children = args[:can_add_children] if args.key?(:can_add_children)
@can_change_copy_requires_writer_permission_restriction = args[:can_change_copy_requires_writer_permission_restriction] if args.key?(:can_change_copy_requires_writer_permission_restriction)
@can_change_domain_users_only_restriction = args[:can_change_domain_users_only_restriction] if args.key?(:can_change_domain_users_only_restriction)
@can_change_drive_background = args[:can_change_drive_background] if args.key?(:can_change_drive_background)
@can_change_drive_members_only_restriction = args[:can_change_drive_members_only_restriction] if args.key?(:can_change_drive_members_only_restriction)
@can_comment = args[:can_comment] if args.key?(:can_comment)
@can_copy = args[:can_copy] if args.key?(:can_copy)
@can_delete_children = args[:can_delete_children] if args.key?(:can_delete_children)
@can_delete_drive = args[:can_delete_drive] if args.key?(:can_delete_drive)
@can_download = args[:can_download] if args.key?(:can_download)
@can_edit = args[:can_edit] if args.key?(:can_edit)
@can_list_children = args[:can_list_children] if args.key?(:can_list_children)
@can_manage_members = args[:can_manage_members] if args.key?(:can_manage_members)
@can_read_revisions = args[:can_read_revisions] if args.key?(:can_read_revisions)
@can_rename = args[:can_rename] if args.key?(:can_rename)
@can_rename_drive = args[:can_rename_drive] if args.key?(:can_rename_drive)
@can_share = args[:can_share] if args.key?(:can_share)
@can_trash_children = args[:can_trash_children] if args.key?(:can_trash_children)
end
end
# A set of restrictions that apply to this shared drive or items inside this
# shared drive.
class Restrictions
include Google::Apis::Core::Hashable
# Whether administrative privileges on this shared drive are required to modify
# restrictions.
# Corresponds to the JSON property `adminManagedRestrictions`
# @return [Boolean]
attr_accessor :admin_managed_restrictions
alias_method :admin_managed_restrictions?, :admin_managed_restrictions
# Whether the options to copy, print, or download files inside this shared drive,
# should be disabled for readers and commenters. When this restriction is set
# to true, it will override the similarly named field to true for any file
# inside this shared drive.
# Corresponds to the JSON property `copyRequiresWriterPermission`
# @return [Boolean]
attr_accessor :copy_requires_writer_permission
alias_method :copy_requires_writer_permission?, :copy_requires_writer_permission
# Whether access to this shared drive and items inside this shared drive is
# restricted to users of the domain to which this shared drive belongs. This
# restriction may be overridden by other sharing policies controlled outside of
# this shared drive.
# Corresponds to the JSON property `domainUsersOnly`
# @return [Boolean]
attr_accessor :domain_users_only
alias_method :domain_users_only?, :domain_users_only
# Whether access to items inside this shared drive is restricted to its members.
# Corresponds to the JSON property `driveMembersOnly`
# @return [Boolean]
attr_accessor :drive_members_only
alias_method :drive_members_only?, :drive_members_only
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@admin_managed_restrictions = args[:admin_managed_restrictions] if args.key?(:admin_managed_restrictions)
@copy_requires_writer_permission = args[:copy_requires_writer_permission] if args.key?(:copy_requires_writer_permission)
@domain_users_only = args[:domain_users_only] if args.key?(:domain_users_only)
@drive_members_only = args[:drive_members_only] if args.key?(:drive_members_only)
end
end
end
# A list of shared drives.
class DriveList
include Google::Apis::Core::Hashable
# The list of shared drives. If nextPageToken is populated, then this list may
# be incomplete and an additional page of results should be fetched.
# Corresponds to the JSON property `drives`
# @return [Array<Google::Apis::DriveV3::Drive>]
attr_accessor :drives
# Identifies what kind of resource this is. Value: the fixed string "drive#
# driveList".
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# The page token for the next page of shared drives. This will be absent if the
# end of the list has been reached. If the token is rejected for any reason, it
# should be discarded, and pagination should be restarted from the first page of
# results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@drives = args[:drives] if args.key?(:drives)
@kind = args[:kind] if args.key?(:kind)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end