-
Notifications
You must be signed in to change notification settings - Fork 877
/
Copy pathclasses.rb
11513 lines (9851 loc) · 551 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 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 '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 SheetsV4
# Adds a new banded range to the spreadsheet.
class AddBandingRequest
include Google::Apis::Core::Hashable
# A banded (alternating colors) range in a sheet.
# Corresponds to the JSON property `bandedRange`
# @return [Google::Apis::SheetsV4::BandedRange]
attr_accessor :banded_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@banded_range = args[:banded_range] if args.key?(:banded_range)
end
end
# The result of adding a banded range.
class AddBandingResponse
include Google::Apis::Core::Hashable
# A banded (alternating colors) range in a sheet.
# Corresponds to the JSON property `bandedRange`
# @return [Google::Apis::SheetsV4::BandedRange]
attr_accessor :banded_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@banded_range = args[:banded_range] if args.key?(:banded_range)
end
end
# Adds a chart to a sheet in the spreadsheet.
class AddChartRequest
include Google::Apis::Core::Hashable
# A chart embedded in a sheet.
# Corresponds to the JSON property `chart`
# @return [Google::Apis::SheetsV4::EmbeddedChart]
attr_accessor :chart
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@chart = args[:chart] if args.key?(:chart)
end
end
# The result of adding a chart to a spreadsheet.
class AddChartResponse
include Google::Apis::Core::Hashable
# A chart embedded in a sheet.
# Corresponds to the JSON property `chart`
# @return [Google::Apis::SheetsV4::EmbeddedChart]
attr_accessor :chart
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@chart = args[:chart] if args.key?(:chart)
end
end
# Adds a new conditional format rule at the given index. All subsequent rules'
# indexes are incremented.
class AddConditionalFormatRuleRequest
include Google::Apis::Core::Hashable
# The zero-based index where the rule should be inserted.
# Corresponds to the JSON property `index`
# @return [Fixnum]
attr_accessor :index
# A rule describing a conditional format.
# Corresponds to the JSON property `rule`
# @return [Google::Apis::SheetsV4::ConditionalFormatRule]
attr_accessor :rule
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@index = args[:index] if args.key?(:index)
@rule = args[:rule] if args.key?(:rule)
end
end
# Adds a data source. After the data source is added successfully, an associated
# DATA_SOURCE sheet is created and an execution is triggered to refresh the
# sheet to read data from the data source. The request requires an additional `
# bigquery.readonly` OAuth scope if you are adding a BigQuery data source.
class AddDataSourceRequest
include Google::Apis::Core::Hashable
# Information about an external data source in the spreadsheet.
# Corresponds to the JSON property `dataSource`
# @return [Google::Apis::SheetsV4::DataSource]
attr_accessor :data_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@data_source = args[:data_source] if args.key?(:data_source)
end
end
# The result of adding a data source.
class AddDataSourceResponse
include Google::Apis::Core::Hashable
# The data execution status. A data execution is created to sync a data source
# object with the latest data from a DataSource. It is usually scheduled to run
# at background, you can check its state to tell if an execution completes There
# are several scenarios where a data execution is triggered to run: * Adding a
# data source creates an associated data source sheet as well as a data
# execution to sync the data from the data source to the sheet. * Updating a
# data source creates a data execution to refresh the associated data source
# sheet similarly. * You can send refresh request to explicitly refresh one or
# multiple data source objects.
# Corresponds to the JSON property `dataExecutionStatus`
# @return [Google::Apis::SheetsV4::DataExecutionStatus]
attr_accessor :data_execution_status
# Information about an external data source in the spreadsheet.
# Corresponds to the JSON property `dataSource`
# @return [Google::Apis::SheetsV4::DataSource]
attr_accessor :data_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@data_execution_status = args[:data_execution_status] if args.key?(:data_execution_status)
@data_source = args[:data_source] if args.key?(:data_source)
end
end
# Creates a group over the specified range. If the requested range is a superset
# of the range of an existing group G, then the depth of G is incremented and
# this new group G' has the depth of that group. For example, a group [C:D,
# depth 1] + [B:E] results in groups [B:E, depth 1] and [C:D, depth 2]. If the
# requested range is a subset of the range of an existing group G, then the
# depth of the new group G' becomes one greater than the depth of G. For example,
# a group [B:E, depth 1] + [C:D] results in groups [B:E, depth 1] and [C:D,
# depth 2]. If the requested range starts before and ends within, or starts
# within and ends after, the range of an existing group G, then the range of the
# existing group G becomes the union of the ranges, and the new group G' has
# depth one greater than the depth of G and range as the intersection of the
# ranges. For example, a group [B:D, depth 1] + [C:E] results in groups [B:E,
# depth 1] and [C:D, depth 2].
class AddDimensionGroupRequest
include Google::Apis::Core::Hashable
# A range along a single dimension on a sheet. All indexes are zero-based.
# Indexes are half open: the start index is inclusive and the end index is
# exclusive. Missing indexes indicate the range is unbounded on that side.
# Corresponds to the JSON property `range`
# @return [Google::Apis::SheetsV4::DimensionRange]
attr_accessor :range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@range = args[:range] if args.key?(:range)
end
end
# The result of adding a group.
class AddDimensionGroupResponse
include Google::Apis::Core::Hashable
# All groups of a dimension after adding a group to that dimension.
# Corresponds to the JSON property `dimensionGroups`
# @return [Array<Google::Apis::SheetsV4::DimensionGroup>]
attr_accessor :dimension_groups
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimension_groups = args[:dimension_groups] if args.key?(:dimension_groups)
end
end
# Adds a filter view.
class AddFilterViewRequest
include Google::Apis::Core::Hashable
# A filter view.
# Corresponds to the JSON property `filter`
# @return [Google::Apis::SheetsV4::FilterView]
attr_accessor :filter
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@filter = args[:filter] if args.key?(:filter)
end
end
# The result of adding a filter view.
class AddFilterViewResponse
include Google::Apis::Core::Hashable
# A filter view.
# Corresponds to the JSON property `filter`
# @return [Google::Apis::SheetsV4::FilterView]
attr_accessor :filter
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@filter = args[:filter] if args.key?(:filter)
end
end
# Adds a named range to the spreadsheet.
class AddNamedRangeRequest
include Google::Apis::Core::Hashable
# A named range.
# Corresponds to the JSON property `namedRange`
# @return [Google::Apis::SheetsV4::NamedRange]
attr_accessor :named_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@named_range = args[:named_range] if args.key?(:named_range)
end
end
# The result of adding a named range.
class AddNamedRangeResponse
include Google::Apis::Core::Hashable
# A named range.
# Corresponds to the JSON property `namedRange`
# @return [Google::Apis::SheetsV4::NamedRange]
attr_accessor :named_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@named_range = args[:named_range] if args.key?(:named_range)
end
end
# Adds a new protected range.
class AddProtectedRangeRequest
include Google::Apis::Core::Hashable
# A protected range.
# Corresponds to the JSON property `protectedRange`
# @return [Google::Apis::SheetsV4::ProtectedRange]
attr_accessor :protected_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@protected_range = args[:protected_range] if args.key?(:protected_range)
end
end
# The result of adding a new protected range.
class AddProtectedRangeResponse
include Google::Apis::Core::Hashable
# A protected range.
# Corresponds to the JSON property `protectedRange`
# @return [Google::Apis::SheetsV4::ProtectedRange]
attr_accessor :protected_range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@protected_range = args[:protected_range] if args.key?(:protected_range)
end
end
# Adds a new sheet. When a sheet is added at a given index, all subsequent
# sheets' indexes are incremented. To add an object sheet, use AddChartRequest
# instead and specify EmbeddedObjectPosition.sheetId or EmbeddedObjectPosition.
# newSheet.
class AddSheetRequest
include Google::Apis::Core::Hashable
# Properties of a sheet.
# Corresponds to the JSON property `properties`
# @return [Google::Apis::SheetsV4::SheetProperties]
attr_accessor :properties
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@properties = args[:properties] if args.key?(:properties)
end
end
# The result of adding a sheet.
class AddSheetResponse
include Google::Apis::Core::Hashable
# Properties of a sheet.
# Corresponds to the JSON property `properties`
# @return [Google::Apis::SheetsV4::SheetProperties]
attr_accessor :properties
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@properties = args[:properties] if args.key?(:properties)
end
end
# Adds a slicer to a sheet in the spreadsheet.
class AddSlicerRequest
include Google::Apis::Core::Hashable
# A slicer in a sheet.
# Corresponds to the JSON property `slicer`
# @return [Google::Apis::SheetsV4::Slicer]
attr_accessor :slicer
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@slicer = args[:slicer] if args.key?(:slicer)
end
end
# The result of adding a slicer to a spreadsheet.
class AddSlicerResponse
include Google::Apis::Core::Hashable
# A slicer in a sheet.
# Corresponds to the JSON property `slicer`
# @return [Google::Apis::SheetsV4::Slicer]
attr_accessor :slicer
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@slicer = args[:slicer] if args.key?(:slicer)
end
end
# Adds new cells after the last row with data in a sheet, inserting new rows
# into the sheet if necessary.
class AppendCellsRequest
include Google::Apis::Core::Hashable
# The fields of CellData that should be updated. At least one field must be
# specified. The root is the CellData; 'row.values.' should not be specified. A
# single `"*"` can be used as short-hand for listing every field.
# Corresponds to the JSON property `fields`
# @return [String]
attr_accessor :fields
# The data to append.
# Corresponds to the JSON property `rows`
# @return [Array<Google::Apis::SheetsV4::RowData>]
attr_accessor :rows
# The sheet ID to append the data to.
# Corresponds to the JSON property `sheetId`
# @return [Fixnum]
attr_accessor :sheet_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@fields = args[:fields] if args.key?(:fields)
@rows = args[:rows] if args.key?(:rows)
@sheet_id = args[:sheet_id] if args.key?(:sheet_id)
end
end
# Appends rows or columns to the end of a sheet.
class AppendDimensionRequest
include Google::Apis::Core::Hashable
# Whether rows or columns should be appended.
# Corresponds to the JSON property `dimension`
# @return [String]
attr_accessor :dimension
# The number of rows or columns to append.
# Corresponds to the JSON property `length`
# @return [Fixnum]
attr_accessor :length
# The sheet to append rows or columns to.
# Corresponds to the JSON property `sheetId`
# @return [Fixnum]
attr_accessor :sheet_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dimension = args[:dimension] if args.key?(:dimension)
@length = args[:length] if args.key?(:length)
@sheet_id = args[:sheet_id] if args.key?(:sheet_id)
end
end
# The response when updating a range of values in a spreadsheet.
class AppendValuesResponse
include Google::Apis::Core::Hashable
# The spreadsheet the updates were applied to.
# Corresponds to the JSON property `spreadsheetId`
# @return [String]
attr_accessor :spreadsheet_id
# The range (in A1 notation) of the table that values are being appended to (
# before the values were appended). Empty if no table was found.
# Corresponds to the JSON property `tableRange`
# @return [String]
attr_accessor :table_range
# The response when updating a range of values in a spreadsheet.
# Corresponds to the JSON property `updates`
# @return [Google::Apis::SheetsV4::UpdateValuesResponse]
attr_accessor :updates
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@spreadsheet_id = args[:spreadsheet_id] if args.key?(:spreadsheet_id)
@table_range = args[:table_range] if args.key?(:table_range)
@updates = args[:updates] if args.key?(:updates)
end
end
# Fills in more data based on existing data.
class AutoFillRequest
include Google::Apis::Core::Hashable
# A range on a sheet. All indexes are zero-based. Indexes are half open, i.e.
# the start index is inclusive and the end index is exclusive -- [start_index,
# end_index). Missing indexes indicate the range is unbounded on that side. For
# example, if `"Sheet1"` is sheet ID 123456, then: `Sheet1!A1:A1 == sheet_id:
# 123456, start_row_index: 0, end_row_index: 1, start_column_index: 0,
# end_column_index: 1` `Sheet1!A3:B4 == sheet_id: 123456, start_row_index: 2,
# end_row_index: 4, start_column_index: 0, end_column_index: 2` `Sheet1!A:B ==
# sheet_id: 123456, start_column_index: 0, end_column_index: 2` `Sheet1!A5:B ==
# sheet_id: 123456, start_row_index: 4, start_column_index: 0, end_column_index:
# 2` `Sheet1 == sheet_id: 123456` The start index must always be less than or
# equal to the end index. If the start index equals the end index, then the
# range is empty. Empty ranges are typically not meaningful and are usually
# rendered in the UI as `#REF!`.
# Corresponds to the JSON property `range`
# @return [Google::Apis::SheetsV4::GridRange]
attr_accessor :range
# A combination of a source range and how to extend that source.
# Corresponds to the JSON property `sourceAndDestination`
# @return [Google::Apis::SheetsV4::SourceAndDestination]
attr_accessor :source_and_destination
# True if we should generate data with the "alternate" series. This differs
# based on the type and amount of source data.
# Corresponds to the JSON property `useAlternateSeries`
# @return [Boolean]
attr_accessor :use_alternate_series
alias_method :use_alternate_series?, :use_alternate_series
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@range = args[:range] if args.key?(:range)
@source_and_destination = args[:source_and_destination] if args.key?(:source_and_destination)
@use_alternate_series = args[:use_alternate_series] if args.key?(:use_alternate_series)
end
end
# Automatically resizes one or more dimensions based on the contents of the
# cells in that dimension.
class AutoResizeDimensionsRequest
include Google::Apis::Core::Hashable
# A range along a single dimension on a DATA_SOURCE sheet.
# Corresponds to the JSON property `dataSourceSheetDimensions`
# @return [Google::Apis::SheetsV4::DataSourceSheetDimensionRange]
attr_accessor :data_source_sheet_dimensions
# A range along a single dimension on a sheet. All indexes are zero-based.
# Indexes are half open: the start index is inclusive and the end index is
# exclusive. Missing indexes indicate the range is unbounded on that side.
# Corresponds to the JSON property `dimensions`
# @return [Google::Apis::SheetsV4::DimensionRange]
attr_accessor :dimensions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@data_source_sheet_dimensions = args[:data_source_sheet_dimensions] if args.key?(:data_source_sheet_dimensions)
@dimensions = args[:dimensions] if args.key?(:dimensions)
end
end
# A banded (alternating colors) range in a sheet.
class BandedRange
include Google::Apis::Core::Hashable
# The ID of the banded range.
# Corresponds to the JSON property `bandedRangeId`
# @return [Fixnum]
attr_accessor :banded_range_id
# Properties referring a single dimension (either row or column). If both
# BandedRange.row_properties and BandedRange.column_properties are set, the fill
# colors are applied to cells according to the following rules: * header_color
# and footer_color take priority over band colors. * first_band_color takes
# priority over second_band_color. * row_properties takes priority over
# column_properties. For example, the first row color takes priority over the
# first column color, but the first column color takes priority over the second
# row color. Similarly, the row header takes priority over the column header in
# the top left cell, but the column header takes priority over the first row
# color if the row header is not set.
# Corresponds to the JSON property `columnProperties`
# @return [Google::Apis::SheetsV4::BandingProperties]
attr_accessor :column_properties
# A range on a sheet. All indexes are zero-based. Indexes are half open, i.e.
# the start index is inclusive and the end index is exclusive -- [start_index,
# end_index). Missing indexes indicate the range is unbounded on that side. For
# example, if `"Sheet1"` is sheet ID 123456, then: `Sheet1!A1:A1 == sheet_id:
# 123456, start_row_index: 0, end_row_index: 1, start_column_index: 0,
# end_column_index: 1` `Sheet1!A3:B4 == sheet_id: 123456, start_row_index: 2,
# end_row_index: 4, start_column_index: 0, end_column_index: 2` `Sheet1!A:B ==
# sheet_id: 123456, start_column_index: 0, end_column_index: 2` `Sheet1!A5:B ==
# sheet_id: 123456, start_row_index: 4, start_column_index: 0, end_column_index:
# 2` `Sheet1 == sheet_id: 123456` The start index must always be less than or
# equal to the end index. If the start index equals the end index, then the
# range is empty. Empty ranges are typically not meaningful and are usually
# rendered in the UI as `#REF!`.
# Corresponds to the JSON property `range`
# @return [Google::Apis::SheetsV4::GridRange]
attr_accessor :range
# Properties referring a single dimension (either row or column). If both
# BandedRange.row_properties and BandedRange.column_properties are set, the fill
# colors are applied to cells according to the following rules: * header_color
# and footer_color take priority over band colors. * first_band_color takes
# priority over second_band_color. * row_properties takes priority over
# column_properties. For example, the first row color takes priority over the
# first column color, but the first column color takes priority over the second
# row color. Similarly, the row header takes priority over the column header in
# the top left cell, but the column header takes priority over the first row
# color if the row header is not set.
# Corresponds to the JSON property `rowProperties`
# @return [Google::Apis::SheetsV4::BandingProperties]
attr_accessor :row_properties
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@banded_range_id = args[:banded_range_id] if args.key?(:banded_range_id)
@column_properties = args[:column_properties] if args.key?(:column_properties)
@range = args[:range] if args.key?(:range)
@row_properties = args[:row_properties] if args.key?(:row_properties)
end
end
# Properties referring a single dimension (either row or column). If both
# BandedRange.row_properties and BandedRange.column_properties are set, the fill
# colors are applied to cells according to the following rules: * header_color
# and footer_color take priority over band colors. * first_band_color takes
# priority over second_band_color. * row_properties takes priority over
# column_properties. For example, the first row color takes priority over the
# first column color, but the first column color takes priority over the second
# row color. Similarly, the row header takes priority over the column header in
# the top left cell, but the column header takes priority over the first row
# color if the row header is not set.
class BandingProperties
include Google::Apis::Core::Hashable
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
# / ...
# Corresponds to the JSON property `firstBandColor`
# @return [Google::Apis::SheetsV4::Color]
attr_accessor :first_band_color
# A color value.
# Corresponds to the JSON property `firstBandColorStyle`
# @return [Google::Apis::SheetsV4::ColorStyle]
attr_accessor :first_band_color_style
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
# / ...
# Corresponds to the JSON property `footerColor`
# @return [Google::Apis::SheetsV4::Color]
attr_accessor :footer_color
# A color value.
# Corresponds to the JSON property `footerColorStyle`
# @return [Google::Apis::SheetsV4::ColorStyle]
attr_accessor :footer_color_style
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
# / ...
# Corresponds to the JSON property `headerColor`
# @return [Google::Apis::SheetsV4::Color]
attr_accessor :header_color
# A color value.
# Corresponds to the JSON property `headerColorStyle`
# @return [Google::Apis::SheetsV4::ColorStyle]
attr_accessor :header_color_style
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
# / ...
# Corresponds to the JSON property `secondBandColor`
# @return [Google::Apis::SheetsV4::Color]
attr_accessor :second_band_color
# A color value.
# Corresponds to the JSON property `secondBandColorStyle`
# @return [Google::Apis::SheetsV4::ColorStyle]
attr_accessor :second_band_color_style
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@first_band_color = args[:first_band_color] if args.key?(:first_band_color)
@first_band_color_style = args[:first_band_color_style] if args.key?(:first_band_color_style)
@footer_color = args[:footer_color] if args.key?(:footer_color)
@footer_color_style = args[:footer_color_style] if args.key?(:footer_color_style)
@header_color = args[:header_color] if args.key?(:header_color)
@header_color_style = args[:header_color_style] if args.key?(:header_color_style)
@second_band_color = args[:second_band_color] if args.key?(:second_band_color)
@second_band_color_style = args[:second_band_color_style] if args.key?(:second_band_color_style)
end
end
# Formatting options for baseline value.
class BaselineValueFormat
include Google::Apis::Core::Hashable
# The comparison type of key value with baseline value.
# Corresponds to the JSON property `comparisonType`
# @return [String]
attr_accessor :comparison_type
# Description which is appended after the baseline value. This field is optional.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
# / ...
# Corresponds to the JSON property `negativeColor`
# @return [Google::Apis::SheetsV4::Color]
attr_accessor :negative_color
# A color value.
# Corresponds to the JSON property `negativeColorStyle`
# @return [Google::Apis::SheetsV4::ColorStyle]
attr_accessor :negative_color_style
# Position settings for text.
# Corresponds to the JSON property `position`
# @return [Google::Apis::SheetsV4::TextPosition]
attr_accessor :position
# Represents a color in the RGBA color space. This representation is designed
# for simplicity of conversion to and from color representations in various
# languages over compactness. For example, the fields of this representation can
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
# method in iOS; and, with just a little work, it can be easily formatted into a
# CSS `rgba()` string in JavaScript. This reference page doesn't have
# information about the absolute color space that should be used to interpret
# the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default,
# applications should assume the sRGB color space. When color equality needs to
# be decided, implementations, unless documented otherwise, treat two colors as
# equal if all their red, green, blue, and alpha values each differ by at most `
# 1e-5`. Example (Java): import com.google.type.Color; // ... public static java.
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();