Google::RestApi::SheetsApi4::Spreadsheet - Represents a Google Spreadsheet.


See the description and synopsis at Google::RestApi::SheetsApi4.


new(sheets => <SheetsApi4>, (id => <string> | name => <string> | title => <string> | uri => <string>), config_id => <string>, cache => <int>);

Creates a new instance of a Spreadsheet object. You would not normally call this directly, you would obtain it from the Sheets::open_spreadsheet routine.

 sheets: The parent SheetsApi4 object.
 id: The id of the spreadsheet (Google Drive file ID).
 name: The name of the spreadsheet (as shown in Google Drive).
 title: An alias for name.
 uri: The spreadsheet ID extracted from the overall URI.
 config_id: The custom config for this worksheet.
 cache: Cache information for this many seconds (default to 5, 0 disables).

Only one of id/name/title/uri should be specified and this API will derive the others as necessary.

The cache exists so that repeated calls for the same attributes or worksheet properties doesn't keep hammering the Google API over and over. The default is 5 seconds. See 'cache' below.


Calls the parent SheetsApi4's 'api' routine with the Sheet's endpoint, along with any args to be passed such as content, params, headers, etc.

You would not normally call this directly unless you were making a Google API call not currently supported by this API framework.


Returns the spreadsheet id (the Google Drive file id).


Returns the URI of this spreadsheet.


Returns the name of the spreadsheet.


An alias for 'spreadsheet_name'.


Returns the spreadsheet attributes of the specified fields.


Returns the spreadsheet property attributes of the specified fields.


Returns an array ref of the properties of the worksheets owned by this spreadsheet.


Sets the caching time in seconds. Calling will always delete the existing cache. 0 also disables the cache.


Deletes all the protected ranges from all the worksheets owned by this spreadsheet.


Returns the properties of the named range passed, or if false is passed, all the named ranges for this spreadsheet.


Creates a copy of this spreadsheet and passes any args to the Google Drive File copy routine.


Deletes this spreadsheet from Google Drive.


Creates a range group with the contained ranges.


Ties the given 'key => range' pairs into a tied range group. The range group can be used to send batch values (API batchUpdate) and batch requests (API batchRequests) as a single call once all the changes have been made to the overall hash.

Turning on the 'fetch_range' property will return the underlying ranges on fetch so that formatting for the ranges can be set. You would normally only turn this on for a short time, and turn it off when the underlying batch requests have been submitted.

 $tied = $ss->tie(id => $range_cell);
 $tied->{id} = 1001;


See also Google::RestApi::SheetsApi4::Worksheet::tie.


Returns the custom configuration item with the given key, or the entire configuration for this spreadsheet if no key is specified.

submit_values(values<arrayref>, content<hashref>);

Submits the batch values (Google API's batchUpdate) for the specified ranges. Content is passed to the SheetsApi4's 'api' call for any customized content you may need to pass.

submit_requests(requests<arrayref>, content<hashref>);

Submits any outstanding requests (Google API's batchRequests) for this spreadsheet. content will be passed to the SheetsApi4's 'api' call for any customized content you may need to pass.


Returns all the protected ranges for this spreadsheet.


Creates a new Worksheet object, passing the args to that object's 'new' routine (which see).


Returns the parent SheetsApi4 config.


Returns the SheetsApi4 object.


Shows some statistics on how many get/put/post etc calls were made. Useful for performance tuning during development.


  • Robin Murray


Copyright (c) 2019, Robin Murray. All rights reserved.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.