# GoogleDriveTemporaryContentLease

Tracks a publicly readable Drive file and its explicit cleanup result.

Class 

`OfficeIMO.GoogleWorkspace.Drive`

**Namespace**

`OfficeIMO.GoogleWorkspace.Drive`

**Assembly**

`OfficeIMO.GoogleWorkspace.Drive`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[GoogleDriveTemporaryContentLease.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Drive/GoogleDriveTemporaryContentLease.cs#L64)

**Modifiers**

sealed

Tracks a publicly readable Drive file and its explicit cleanup result.

## Inheritance

- object
- GoogleDriveTemporaryContentLease

## Remarks

The file has no automatic expiry or disposal lifecycle and remains public until [GoogleDriveTemporaryContentLease.CleanupAsync](/api/google-workspace-drive/officeimo-googleworkspace-drive-googledrivetemporarycontentlease/) deletes it successfully.

## Usage

Explore 1 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.

### Returned or exposed by 1

- Method [GoogleDriveTemporaryContentLease.CreatePublicReadLeaseAsync](/api/google-workspace-drive/officeimo-googleworkspace-drive-googledrivetemporarycontentlease/#method-createpublicreadleaseasync-officeimo-googleworkspace-drive-googledriveclient-byte-officeimo-googleworkspace-drive-googledriveuploadoptions-officeimo-googleworkspace-translationreport-threading-cancellationtoken)

Filter members 

Show inherited

## Methods

`public async Task<GoogleDriveCleanupReport> CleanupAsync(CancellationToken cancellationToken = default)` [#](#method-cleanupasync-threading-cancellationtoken)

Attempts to delete the temporary file and returns the persistent cleanup result.

Parameters

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

Returns

`Task<GoogleDriveCleanupReport>`

`public static async Task<GoogleDriveTemporaryContentLease> CreatePublicReadLeaseAsync(GoogleDriveClient client, byte[] content, GoogleDriveUploadOptions options, TranslationReport? report = null, CancellationToken cancellationToken = default)` [#](#member-0931d4d07b9a542b461d28fb)

Uploads content, grants a non-discoverable public-reader permission, and returns an object for explicit cleanup.

Parameters

**client OfficeIMO.GoogleWorkspace.Drive.GoogleDriveClient required**

**content byte[] required**

**options OfficeIMO.GoogleWorkspace.Drive.GoogleDriveUploadOptions required**

**report OfficeIMO.GoogleWorkspace.TranslationReport? = null optional**

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

Returns

`Task<GoogleDriveTemporaryContentLease>`

## 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?`

## Properties

`public GoogleDriveFile File { get; }` [#](#property-file)

[GoogleDriveTemporaryContentLease.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Drive/GoogleDriveTemporaryContentLease.cs#L64)

Gets metadata for the temporary Drive file.

`public string PublicUri { get; }` [#](#property-publicuri)

[GoogleDriveTemporaryContentLease.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Drive/GoogleDriveTemporaryContentLease.cs#L66)

Gets the public download URI exposed until explicit cleanup deletes the file successfully.

`public GoogleDriveCleanupReport CleanupReport { get; }` [#](#property-cleanupreport)

[GoogleDriveTemporaryContentLease.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.GoogleWorkspace.Drive/GoogleDriveTemporaryContentLease.cs#L68)

Gets the cleanup report associated with this lease.

<!-- PowerForge markdown artifact sha256:B59769A196B98AD66B643F866644E9A56A0913BB13E14A4E72E9EB3751824EF2 -->
