# GoogleWorkspaceChangeTracker

Consumes complete Drive change pages and advances each source token only after that source succeeds.

Class 

`OfficeIMO.GoogleWorkspace.Sync`

**Namespace**

`OfficeIMO.GoogleWorkspace.Sync`

**Assembly**

`OfficeIMO.GoogleWorkspace.Sync`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[GoogleWorkspaceChangeTracker.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Sync/GoogleWorkspaceChangeTracker.cs#L105)

**Implements**

`IDisposable`

**Modifiers**

sealed

Consumes complete Drive change pages and advances each source token only after that source succeeds.

## Inheritance

- object
- GoogleWorkspaceChangeTracker

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Track Google Drive Changes](/docs/google-workspace/sync/) Guide
  
  Read Google Drive change feeds for the user and shared drives with checkpoints, and apply sync plans with dry runs, approvals, and conflict reporting.

Filter members 

Show inherited

## Constructors

`public GoogleWorkspaceChangeTracker(GoogleWorkspaceSession session, GoogleDriveClientOptions? options = null)` [#](#constructor-ctor-officeimo-googleworkspace-googleworkspacesession-officeimo-googleworkspace-drive-googledriveclientoptions)

[GoogleWorkspaceChangeTracker.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Sync/GoogleWorkspaceChangeTracker.cs#L105)

Creates a tracker using the supplied session and optional Drive client settings.

Parameters

**session OfficeIMO.GoogleWorkspace.GoogleWorkspaceSession required**

**options OfficeIMO.GoogleWorkspace.Drive.GoogleDriveClientOptions? = null optional**

## Methods

`public void Dispose()` [#](#method-dispose)

[GoogleWorkspaceChangeTracker.cs:207](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Sync/GoogleWorkspaceChangeTracker.cs#L207)

Disposes the underlying Drive client without taking ownership of the session.

`public async Task<GoogleWorkspaceSyncCheckpoint> InitializeAsync(IEnumerable<string>? sharedDriveIds = null, CancellationToken cancellationToken = default)` [#](#method-initializeasync-collections-generic-ienumerable-system-string-threading-cancellationtoken)

Obtains current start tokens for the user feed and distinct supplied shared drives.

Parameters

**sharedDriveIds System.Collections.Generic.IEnumerable<string>? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<GoogleWorkspaceSyncCheckpoint>`

`public async Task<GoogleWorkspaceChangeReadResult> ReadAsync(GoogleWorkspaceSyncCheckpoint checkpoint, GoogleWorkspaceChangeReadOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readasync-officeimo-googleworkspace-sync-googleworkspacesynccheckpoint-officeimo-googleworkspace-sync-googleworkspacechangereadoptions-threading-cancellationtoken)

Reads each feed to its new start token without advancing a failed source in the returned checkpoint.

Parameters

**checkpoint OfficeIMO.GoogleWorkspace.Sync.GoogleWorkspaceSyncCheckpoint required**

**options OfficeIMO.GoogleWorkspace.Sync.GoogleWorkspaceChangeReadOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<GoogleWorkspaceChangeReadResult>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:735EA9697E313D181D61DD2D81AD692DAAE86AB645677F6EDBB37C409E69C6FF -->
