# GitHubNotificationService

Reads and manages the authenticated user's GitHub notification inbox while respecting GitHub polling guidance.

Class 

`IntelligenceX.Telemetry.GitHub`

**Namespace**

`IntelligenceX.Telemetry.GitHub`

**Assembly**

`IntelligenceX`

**Source**

[GitHubNotificationService.cs:35](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Telemetry/GitHub/GitHubNotificationService.cs#L35)

**Implements**

`IDisposable`

**Modifiers**

sealed

Reads and manages the authenticated user's GitHub notification inbox while respecting GitHub polling guidance.

## Inheritance

- object
- GitHubNotificationService

Filter members 

Show inherited

## Constructors

`public GitHubNotificationService(string token, string? apiBaseUrl = null)` [#](#constructor-ctor-string-string)

[GitHubNotificationService.cs:35](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Telemetry/GitHub/GitHubNotificationService.cs#L35)

Initializes a notification service using a GitHub token with Notifications access.

Parameters

**token string required**

A fine-grained token, GitHub App token, or classic token with the Notifications permission required by the requested operations.

**apiBaseUrl string? = null optional**

Optional GitHub-compatible API base URL.

## Methods

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

[GitHubNotificationService.cs:172](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Telemetry/GitHub/GitHubNotificationService.cs#L172)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

`public async Task<GitHubNotificationSnapshot> FetchAsync(GitHubNotificationQuery? query = null, CancellationToken cancellationToken = default)` [#](#method-fetchasync-intelligencex-telemetry-github-githubnotificationquery-threading-cancellationtoken)

Returns notification threads for the authenticated user, reusing a fresh snapshot until GitHub's poll interval expires.

Parameters

**query IntelligenceX.Telemetry.GitHub.GitHubNotificationQuery? = null optional**

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

Returns

`Task<GitHubNotificationSnapshot>`

`public async Task MarkAllReadAsync(CancellationToken cancellationToken = default)` [#](#method-markallreadasync-threading-cancellationtoken)

Marks every notification in the authenticated user's inbox as read and invalidates cached snapshots.

Parameters

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

Returns

`Task`

`public async Task MarkDoneAsync(string threadId, CancellationToken cancellationToken = default)` [#](#method-markdoneasync-string-threading-cancellationtoken)

Marks one GitHub notification thread as done and invalidates cached inbox snapshots.

Parameters

**threadId string required**

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

Returns

`Task`

`public async Task MarkReadAsync(string threadId, CancellationToken cancellationToken = default)` [#](#method-markreadasync-string-threading-cancellationtoken)

Marks one GitHub notification thread as read and invalidates cached inbox snapshots.

Parameters

**threadId string required**

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

Returns

`Task`

## 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:6C9714721D97286E5C808D5A8826CA43A5062703D75EDFAA0E8405140F4BDE3E -->
