Class: Google::Apis::SheetsV4::ProtectedRange

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/sheets_v4/classes.rb,
generated/google/apis/sheets_v4/representations.rb,
generated/google/apis/sheets_v4/representations.rb

Overview

A protected range.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ProtectedRange

Returns a new instance of ProtectedRange.



2945
2946
2947
# File 'generated/google/apis/sheets_v4/classes.rb', line 2945

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

The description of this protected range. Corresponds to the JSON property description

Returns:

  • (String)


2878
2879
2880
# File 'generated/google/apis/sheets_v4/classes.rb', line 2878

def description
  @description
end

#editorsGoogle::Apis::SheetsV4::Editors

The editors of a protected range. Corresponds to the JSON property editors



2898
2899
2900
# File 'generated/google/apis/sheets_v4/classes.rb', line 2898

def editors
  @editors
end

#named_range_idString

The named range this protected range is backed by, if any. When writing, only one of range or named_range_id may be set. Corresponds to the JSON property namedRangeId

Returns:

  • (String)


2885
2886
2887
# File 'generated/google/apis/sheets_v4/classes.rb', line 2885

def named_range_id
  @named_range_id
end

#protected_range_idFixnum

The ID of the protected range. This field is read-only. Corresponds to the JSON property protectedRangeId

Returns:

  • (Fixnum)


2904
2905
2906
# File 'generated/google/apis/sheets_v4/classes.rb', line 2904

def protected_range_id
  @protected_range_id
end

#rangeGoogle::Apis::SheetsV4::GridRange

A range on a sheet. All indexes are zero-based. Indexes are half open, e.g 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 0, then: Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, end_row_index: 1, start_column_index: 0, end_column_index: 1 Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, end_row_index: 4, start_column_index: 0, end_column_index: 2 Sheet1!A:B == sheet_id: 0, start_column_index: 0, end_column_index: 2 Sheet1!A5:B == sheet_id: 0, start_row_index: 4, start_column_index: 0, end_column_index: 2 Sheet1 == sheet_id:0 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



2943
2944
2945
# File 'generated/google/apis/sheets_v4/classes.rb', line 2943

def range
  @range
end

#requesting_user_can_editBoolean 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

Returns:

  • (Boolean)


2892
2893
2894
# File 'generated/google/apis/sheets_v4/classes.rb', line 2892

def requesting_user_can_edit
  @requesting_user_can_edit
end

#unprotected_rangesArray<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



2873
2874
2875
# File 'generated/google/apis/sheets_v4/classes.rb', line 2873

def unprotected_ranges
  @unprotected_ranges
end

#warning_onlyBoolean 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 is 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

Returns:

  • (Boolean)


2916
2917
2918
# File 'generated/google/apis/sheets_v4/classes.rb', line 2916

def warning_only
  @warning_only
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
# File 'generated/google/apis/sheets_v4/classes.rb', line 2950

def update!(**args)
  @unprotected_ranges = args[:unprotected_ranges] if args.key?(:unprotected_ranges)
  @description = args[:description] if args.key?(:description)
  @named_range_id = args[:named_range_id] if args.key?(:named_range_id)
  @requesting_user_can_edit = args[:requesting_user_can_edit] if args.key?(:requesting_user_can_edit)
  @editors = args[:editors] if args.key?(:editors)
  @protected_range_id = args[:protected_range_id] if args.key?(:protected_range_id)
  @warning_only = args[:warning_only] if args.key?(:warning_only)
  @range = args[:range] if args.key?(:range)
end