NAME
Google::RestApi::DriveApi3::Changes - Track changes in Google Drive.
SYNOPSIS
my $changes = $drive->changes();
# Get starting token
my $token = $changes->get_start_page_token();
# List changes since token
my @changes = $changes->list(page_token => $token);
# Or get changes with new token
my $result = $changes->list(page_token => $token);
my @change_list = @{$result->{changes}};
my $new_token = $result->{newStartPageToken};
# Watch for changes
$changes->watch(
page_token => $token,
id => 'channel-id',
address => 'https://example.com/webhook',
);
DESCRIPTION
Tracks changes to files in Google Drive. Useful for synchronization and change notification.
METHODS
get_start_page_token(drive_id => $id)
Gets the starting page token for listing future changes.
list(page_token => $token, ...)
Lists changes since the given page token.
Options: - page_token: Required starting token - spaces: 'drive' or 'appDataFolder' (default: 'drive') - include_removed: Include removed items (default: true) - include_items_from_all_drives: Include shared drive items (default: true) - supports_all_drives: Support shared drives (default: true) - page_size: Number of changes per page (default: 100) - drive_id: Specific shared drive ID - max_pages: Maximum pages to fetch (default: 0 = unlimited) - page_callback: See "PAGE CALLBACKS" in Google::RestApi
In list context, returns array of changes. In scalar context, returns hashref with changes and newStartPageToken.
watch(page_token => $token, id => $id, address => $url)
Sets up a notification channel for changes.
Parameters: - page_token: Starting token - id: Channel ID for the webhook - type: Channel type (default: 'web_hook') - address: Webhook URL - expiration: Optional expiration time in milliseconds
drive_api()
Returns the parent DriveApi3 object.
AUTHORS
Robin Murray mvsjes@cpan.org
COPYRIGHT
Copyright (c) 2019-2026 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.