Tie::Google::Sheets::Client - Low level client used internally by Tie::Google::Sheets
version 0.02
This is a low level class used internally by Tie::Google::Sheets to talk to the Google Sheets API. It is not part of the public interface and may change without notice; do not use it directly.
The id of the spreadsheet being accessed.
The HTTP::AnyUA instance used to make requests.
The OAuth2 bearer token (or code reference) given to "new", if any.
The decoded service account key, if a service account was given to "new".
The most recently obtained OAuth2 access token, when authenticating via "service_account".
The epoch time at which "token" expires.
The maximum number of pending cell writes accumulated by "update_value" before they are automatically flushed.
undef (the default) disables batching: "update_value" sends each write immediately.
The maximum number of times an API request will be retried,
with exponential backoff,
after being rate limited by Google (HTTP status 429).
undef (the default) disables retrying: a rate limited request fails immediately.
my $client = Tie::Google::Sheets::Client->new(%options);
Constructor. %options are the same as documented in "CONSTRUCTOR" in Tie::Google::Sheets.
my $titles = $client->sheet_titles;
Returns an array reference of worksheet titles.
my $sheet_id = $client->sheet_id_for_title($title);
Returns the numeric sheet id for the worksheet named $title, or undef if there is no such worksheet.
my $value = $client->get_value($title, $a1);
Returns the value of the cell $a1 (for example "A1") in worksheet $title.
my $formula = $client->get_formula($title, $a1);
Returns the formula of the cell $a1 in worksheet $title, as text (for example "=SUM(A1:A10)"), or the same as "get_value" if the cell doesn't contain a formula.
$client->update_value($title, $a1, $value);
Sets the value of the cell $a1 in worksheet $title. If "batch_size" is set, the write is queued rather than sent immediately; see "flush".
$client->flush;
Sends any cell writes queued by "update_value" as a single values.batchUpdate API call. A no-op if nothing is queued. Called automatically before every other API request (so reads always see previously queued writes), when the number of queued writes reaches "batch_size", and when the client is garbage collected.
$client->clear_value($title, $a1);
Clears the value of the cell $a1 in worksheet $title.
$client->clear_range($title, $a1); $client->clear_range($title);
Clears the value of the cell $a1 in worksheet $title, or, if $a1 is omitted, clears every cell in the worksheet.
my $rows = $client->get_all_values($title);
Returns an array reference of array references holding every value in the used range of worksheet $title.
my $rows = $client->get_all_formulas($title);
Like "get_all_values", but returns formulas (as text) instead of values, for every cell in the used range of worksheet $title that has one; cells without a formula hold the same value "get_all_values" would return.
$client->add_sheet($title);
Adds a new, empty worksheet named $title.
$client->delete_sheet($title);
Deletes the worksheet named $title.
$client->copy_worksheet($from_title, $to_title);
Copies the worksheet named $from_title to a new worksheet named $to_title, including its formatting, data validation, and other properties, not just its cell values.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2026 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.