GitHubNotificationService
IntelligenceX.Telemetry.GitHub
Reads and manages the authenticated user's GitHub notification inbox while respecting GitHub polling guidance.
Inheritance
- object
- GitHubNotificationService
Constructors
public GitHubNotificationService(string token, string? apiBaseUrl = null) #Initializes a notification service using a GitHub token with Notifications access.
Parameters
- token string
- A fine-grained token, GitHub App token, or classic token with the Notifications permission required by the requested operations.
- apiBaseUrl string? = null
- Optional GitHub-compatible API base URL.
Methods
public void Dispose() #Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public async Task<GitHubNotificationSnapshot> FetchAsync(GitHubNotificationQuery? query = null, CancellationToken cancellationToken = default) #Returns notification threads for the authenticated user, reusing a fresh snapshot until GitHub's poll interval expires.
Parameters
- query IntelligenceX.Telemetry.GitHub.GitHubNotificationQuery? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<GitHubNotificationSnapshot>public async Task MarkAllReadAsync(CancellationToken cancellationToken = default) #Marks every notification in the authenticated user's inbox as read and invalidates cached snapshots.
Parameters
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic async Task MarkDoneAsync(string threadId, CancellationToken cancellationToken = default) #Marks one GitHub notification thread as done and invalidates cached inbox snapshots.
Parameters
- threadId string
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic async Task MarkReadAsync(string threadId, CancellationToken cancellationToken = default) #Marks one GitHub notification thread as read and invalidates cached inbox snapshots.
Parameters
- threadId string
- cancellationToken System.Threading.CancellationToken = default
Returns
Task