Class: Google::Apis::SheetsV4::ProtectedRange
- Inherits:
-
Object
- Object
- Google::Apis::SheetsV4::ProtectedRange
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/sheets_v4/classes.rb,
lib/google/apis/sheets_v4/representations.rb,
lib/google/apis/sheets_v4/representations.rb
Overview
A protected range.
Instance Attribute Summary collapse
-
#description ⇒ String
The description of this protected range.
-
#editors ⇒ Google::Apis::SheetsV4::Editors
The editors of a protected range.
-
#named_range_id ⇒ String
The named range this protected range is backed by, if any.
-
#protected_range_id ⇒ Fixnum
The ID of the protected range.
-
#range ⇒ Google::Apis::SheetsV4::GridRange
A range on a sheet.
-
#requesting_user_can_edit ⇒ Boolean
(also: #requesting_user_can_edit?)
True if the user who requested this protected range can edit the protected area.
-
#table_id ⇒ String
The table this protected range is backed by, if any.
-
#unprotected_ranges ⇒ Array<Google::Apis::SheetsV4::GridRange>
The list of unprotected ranges within a protected sheet.
-
#warning_only ⇒ Boolean
(also: #warning_only?)
True if this protected range will show a warning when editing.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ProtectedRange
constructor
A new instance of ProtectedRange.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ ProtectedRange
Returns a new instance of ProtectedRange.
7985 7986 7987 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7985 def initialize(**args) update!(**args) end |
Instance Attribute Details
#description ⇒ String
The description of this protected range.
Corresponds to the JSON property description
7919 7920 7921 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7919 def description @description end |
#editors ⇒ Google::Apis::SheetsV4::Editors
The editors of a protected range.
Corresponds to the JSON property editors
7924 7925 7926 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7924 def editors @editors end |
#named_range_id ⇒ String
The named range this protected range is backed by, if any. When writing, only
one of range or named_range_id or table_id may be set.
Corresponds to the JSON property namedRangeId
7930 7931 7932 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7930 def named_range_id @named_range_id end |
#protected_range_id ⇒ Fixnum
The ID of the protected range. This field is read-only.
Corresponds to the JSON property protectedRangeId
7935 7936 7937 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7935 def protected_range_id @protected_range_id end |
#range ⇒ Google::Apis::SheetsV4::GridRange
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
7952 7953 7954 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7952 def range @range end |
#requesting_user_can_edit ⇒ Boolean Also known as: requesting_user_can_edit?
True if the user who requested this protected range can edit the protected
area. This field is read-only.
Corresponds to the JSON property requestingUserCanEdit
7958 7959 7960 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7958 def requesting_user_can_edit @requesting_user_can_edit end |
#table_id ⇒ String
The table this protected range is backed by, if any. When writing, only one of
range or named_range_id or table_id may be set.
Corresponds to the JSON property tableId
7965 7966 7967 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7965 def table_id @table_id end |
#unprotected_ranges ⇒ Array<Google::Apis::SheetsV4::GridRange>
The list of unprotected ranges within a protected sheet. Unprotected ranges
are only supported on protected sheets.
Corresponds to the JSON property unprotectedRanges
7971 7972 7973 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7971 def unprotected_ranges @unprotected_ranges end |
#warning_only ⇒ Boolean Also known as: warning_only?
True if this protected range will show a warning when editing. Warning-based
protection means that every user can edit data in the protected range, except
editing will prompt a warning asking the user to confirm the edit. When
writing: if this field is true, then editors are ignored. Additionally, if
this field is changed from true to false and the editors field is not set (
nor included in the field mask), then the editors will be set to all the
editors in the document.
Corresponds to the JSON property warningOnly
7982 7983 7984 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7982 def warning_only @warning_only end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 7990 def update!(**args) @description = args[:description] if args.key?(:description) @editors = args[:editors] if args.key?(:editors) @named_range_id = args[:named_range_id] if args.key?(:named_range_id) @protected_range_id = args[:protected_range_id] if args.key?(:protected_range_id) @range = args[:range] if args.key?(:range) @requesting_user_can_edit = args[:requesting_user_can_edit] if args.key?(:requesting_user_can_edit) @table_id = args[:table_id] if args.key?(:table_id) @unprotected_ranges = args[:unprotected_ranges] if args.key?(:unprotected_ranges) @warning_only = args[:warning_only] if args.key?(:warning_only) end |