Class: Google::Apis::SheetsV4::FindReplaceRequest

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

Finds and replaces data in cells over a range, sheet, or all sheets.

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) ⇒ FindReplaceRequest

Returns a new instance of FindReplaceRequest



4778
4779
4780
# File 'generated/google/apis/sheets_v4/classes.rb', line 4778

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

Instance Attribute Details

#all_sheetsBoolean Also known as: all_sheets?

True to find/replace over all sheets. Corresponds to the JSON property allSheets

Returns:

  • (Boolean)


4744
4745
4746
# File 'generated/google/apis/sheets_v4/classes.rb', line 4744

def all_sheets
  @all_sheets
end

#findString

The value to search. Corresponds to the JSON property find

Returns:

  • (String)


4763
4764
4765
# File 'generated/google/apis/sheets_v4/classes.rb', line 4763

def find
  @find
end

#include_formulasBoolean Also known as: include_formulas?

True if the search should include cells with formulas. False to skip cells with formulas. Corresponds to the JSON property includeFormulas

Returns:

  • (Boolean)


4751
4752
4753
# File 'generated/google/apis/sheets_v4/classes.rb', line 4751

def include_formulas
  @include_formulas
end

#match_caseBoolean Also known as: match_case?

True if the search is case sensitive. Corresponds to the JSON property matchCase

Returns:

  • (Boolean)


4738
4739
4740
# File 'generated/google/apis/sheets_v4/classes.rb', line 4738

def match_case
  @match_case
end

#match_entire_cellBoolean Also known as: match_entire_cell?

True if the find value should match the entire cell. Corresponds to the JSON property matchEntireCell

Returns:

  • (Boolean)


4757
4758
4759
# File 'generated/google/apis/sheets_v4/classes.rb', line 4757

def match_entire_cell
  @match_entire_cell
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



4728
4729
4730
# File 'generated/google/apis/sheets_v4/classes.rb', line 4728

def range
  @range
end

#replacementString

The value to use as the replacement. Corresponds to the JSON property replacement

Returns:

  • (String)


4702
4703
4704
# File 'generated/google/apis/sheets_v4/classes.rb', line 4702

def replacement
  @replacement
end

#search_by_regexBoolean Also known as: search_by_regex?

True if the find value is a regex. The regular expression and replacement should follow Java regex rules at https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html. The replacement string is allowed to refer to capturing groups. For example, if one cell has the contents "Google Sheets" and another has "Google Docs", then searching for "o.* (.*)" with a replacement of "$1 Rocks" would change the contents of the cells to "GSheets Rocks" and "GDocs Rocks" respectively. Corresponds to the JSON property searchByRegex

Returns:

  • (Boolean)


4775
4776
4777
# File 'generated/google/apis/sheets_v4/classes.rb', line 4775

def search_by_regex
  @search_by_regex
end

#sheet_idFixnum

The sheet to find/replace over. Corresponds to the JSON property sheetId

Returns:

  • (Fixnum)


4733
4734
4735
# File 'generated/google/apis/sheets_v4/classes.rb', line 4733

def sheet_id
  @sheet_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
# File 'generated/google/apis/sheets_v4/classes.rb', line 4783

def update!(**args)
  @replacement = args[:replacement] if args.key?(:replacement)
  @range = args[:range] if args.key?(:range)
  @sheet_id = args[:sheet_id] if args.key?(:sheet_id)
  @match_case = args[:match_case] if args.key?(:match_case)
  @all_sheets = args[:all_sheets] if args.key?(:all_sheets)
  @include_formulas = args[:include_formulas] if args.key?(:include_formulas)
  @match_entire_cell = args[:match_entire_cell] if args.key?(:match_entire_cell)
  @find = args[:find] if args.key?(:find)
  @search_by_regex = args[:search_by_regex] if args.key?(:search_by_regex)
end