Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

GoogleWorkspaceSession

OfficeIMO.GoogleWorkspace

Namespace
OfficeIMO.GoogleWorkspace
Assembly
OfficeIMO.GoogleWorkspace
Source revision
67621aa8a46e with working tree changes
Modifiers
sealed

Represents a configured Google Workspace session used by exporter packages.

Inheritance

  • object
  • GoogleWorkspaceSession

Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public GoogleWorkspaceSession(IGoogleWorkspaceCredentialSource credentialSource, GoogleWorkspaceSessionOptions? options = null) #

Creates a session from a credential source and optional transport and policy settings.

Parameters

credentialSource OfficeIMO.GoogleWorkspace.IGoogleWorkspaceCredentialSource required
Source used to acquire scoped Google OAuth tokens.
options OfficeIMO.GoogleWorkspace.GoogleWorkspaceSessionOptions? = null optional
Session settings, or null to use defaults.

Methods

public async Task<GoogleWorkspaceAccessToken> AcquireAccessTokenAsync(IEnumerable<string> scopes, CancellationToken cancellationToken = default) #

Acquires and validates a token for every requested scope and the configured expected account.

Parameters

scopes System.Collections.Generic.IEnumerable<string> required
OAuth scopes required by the operation. Blank and duplicate entries are removed.
cancellationToken System.Threading.CancellationToken = default optional
Token used to cancel acquisition.

Returns

Task<GoogleWorkspaceAccessToken> A nonexpired token whose bound scopes cover the normalized request.

Exceptions

  • InvalidOperationException – The credential source returns no token, an expired token, insufficient scopes, or identity evidence that does not match the session policy.
public GoogleDriveFileLocation ResolveLocationDefaults(GoogleDriveFileLocation? location) #

Combines an operation-specific Drive location with the session defaults.

Parameters

location OfficeIMO.GoogleWorkspace.GoogleDriveFileLocation? required
Location supplied by the operation, or null to use all defaults.

Returns

GoogleDriveFileLocation A new location instance; the supplied instance is not modified.

Properties

public IGoogleWorkspaceCredentialSource CredentialSource { get; } #

Gets the credential source used by this session.

public GoogleWorkspaceSessionOptions Options { get; } #

Gets the transport, retry, identity, and operation-policy settings.