Class NotificationClient
Inheritance
Inherited Members
Namespace: Dangl.GiteaOrgManager.Client
Assembly: Dangl.GiteaOrgManager.dll
Syntax
public class NotificationClient
Constructors
| Improve this Doc View SourceNotificationClient(String, HttpClient)
Declaration
public NotificationClient(string baseUrl, HttpClient httpClient)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | baseUrl | |
| System.Net.Http.HttpClient | httpClient |
Properties
| Improve this Doc View SourceBaseUrl
Declaration
public string BaseUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
JsonSerializerSettings
Declaration
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
| Type | Description |
|---|---|
| Newtonsoft.Json.JsonSerializerSettings |
ReadResponseAsString
Declaration
public bool ReadResponseAsString { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceNotifyGetListAsync(Nullable<Boolean>, IEnumerable<String>, IEnumerable<Anonymous>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int32>, Nullable<Int32>)
List users's notification threads
Declaration
public virtual Task<ICollection<NotificationThread>> NotifyGetListAsync(bool? all, IEnumerable<string> status_types, IEnumerable<Anonymous> subject_type, DateTimeOffset? since, DateTimeOffset? before, int? page, int? limit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Boolean> | all | If true, show notifications marked as read. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. |
| System.Collections.Generic.IEnumerable<Anonymous> | subject_type | filter notifications by subject type |
| System.Nullable<System.DateTimeOffset> | since | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.DateTimeOffset> | before | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.Int32> | page | page number of results to return (1-based) |
| System.Nullable<System.Int32> | limit | page size of results |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyGetListAsync(Nullable<Boolean>, IEnumerable<String>, IEnumerable<Anonymous>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int32>, Nullable<Int32>, CancellationToken)
List users's notification threads
Declaration
public virtual async Task<ICollection<NotificationThread>> NotifyGetListAsync(bool? all, IEnumerable<string> status_types, IEnumerable<Anonymous> subject_type, DateTimeOffset? since, DateTimeOffset? before, int? page, int? limit, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Boolean> | all | If true, show notifications marked as read. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. |
| System.Collections.Generic.IEnumerable<Anonymous> | subject_type | filter notifications by subject type |
| System.Nullable<System.DateTimeOffset> | since | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.DateTimeOffset> | before | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.Int32> | page | page number of results to return (1-based) |
| System.Nullable<System.Int32> | limit | page size of results |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyGetRepoListAsync(String, String, Nullable<Boolean>, IEnumerable<String>, IEnumerable<Anonymous2>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int32>, Nullable<Int32>)
List users's notification threads on a specific repo
Declaration
public virtual Task<ICollection<NotificationThread>> NotifyGetRepoListAsync(string owner, string repo, bool? all, IEnumerable<string> status_types, IEnumerable<Anonymous2> subject_type, DateTimeOffset? since, DateTimeOffset? before, int? page, int? limit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | owner | owner of the repo |
| System.String | repo | name of the repo |
| System.Nullable<System.Boolean> | all | If true, show notifications marked as read. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned |
| System.Collections.Generic.IEnumerable<Anonymous2> | subject_type | filter notifications by subject type |
| System.Nullable<System.DateTimeOffset> | since | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.DateTimeOffset> | before | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.Int32> | page | page number of results to return (1-based) |
| System.Nullable<System.Int32> | limit | page size of results |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyGetRepoListAsync(String, String, Nullable<Boolean>, IEnumerable<String>, IEnumerable<Anonymous2>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Int32>, Nullable<Int32>, CancellationToken)
List users's notification threads on a specific repo
Declaration
public virtual async Task<ICollection<NotificationThread>> NotifyGetRepoListAsync(string owner, string repo, bool? all, IEnumerable<string> status_types, IEnumerable<Anonymous2> subject_type, DateTimeOffset? since, DateTimeOffset? before, int? page, int? limit, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | owner | owner of the repo |
| System.String | repo | name of the repo |
| System.Nullable<System.Boolean> | all | If true, show notifications marked as read. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned |
| System.Collections.Generic.IEnumerable<Anonymous2> | subject_type | filter notifications by subject type |
| System.Nullable<System.DateTimeOffset> | since | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.DateTimeOffset> | before | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format |
| System.Nullable<System.Int32> | page | page number of results to return (1-based) |
| System.Nullable<System.Int32> | limit | page size of results |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyGetThreadAsync(String)
Get notification thread by ID
Declaration
public virtual Task<NotificationThread> NotifyGetThreadAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | id of notification thread |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationThread> | NotificationThread |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyGetThreadAsync(String, CancellationToken)
Get notification thread by ID
Declaration
public virtual async Task<NotificationThread> NotifyGetThreadAsync(string id, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | id of notification thread |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationThread> | NotificationThread |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyNewAvailableAsync()
Check if unread notifications exist
Declaration
public virtual Task<NotificationCount> NotifyNewAvailableAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationCount> | Number of unread notifications |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyNewAvailableAsync(CancellationToken)
Check if unread notifications exist
Declaration
public virtual async Task<NotificationCount> NotifyNewAvailableAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationCount> | Number of unread notifications |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadListAsync(Nullable<DateTimeOffset>, String, IEnumerable<String>, String)
Mark notification threads as read, pinned or unread
Declaration
public virtual Task<ICollection<NotificationThread>> NotifyReadListAsync(DateTimeOffset? last_read_at, string all, IEnumerable<string> status_types, string to_status)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.DateTimeOffset> | last_read_at | Describes the last point that notifications were checked. Anything updated since this time will not be updated. |
| System.String | all | If true, mark all notifications on this repo. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. |
| System.String | to_status | Status to mark notifications as, Defaults to read. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadListAsync(Nullable<DateTimeOffset>, String, IEnumerable<String>, String, CancellationToken)
Mark notification threads as read, pinned or unread
Declaration
public virtual async Task<ICollection<NotificationThread>> NotifyReadListAsync(DateTimeOffset? last_read_at, string all, IEnumerable<string> status_types, string to_status, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.DateTimeOffset> | last_read_at | Describes the last point that notifications were checked. Anything updated since this time will not be updated. |
| System.String | all | If true, mark all notifications on this repo. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. |
| System.String | to_status | Status to mark notifications as, Defaults to read. |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadRepoListAsync(String, String, String, IEnumerable<String>, String, Nullable<DateTimeOffset>)
Mark notification threads as read, pinned or unread on a specific repo
Declaration
public virtual Task<ICollection<NotificationThread>> NotifyReadRepoListAsync(string owner, string repo, string all, IEnumerable<string> status_types, string to_status, DateTimeOffset? last_read_at)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | owner | owner of the repo |
| System.String | repo | name of the repo |
| System.String | all | If true, mark all notifications on this repo. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. |
| System.String | to_status | Status to mark notifications as. Defaults to read. |
| System.Nullable<System.DateTimeOffset> | last_read_at | Describes the last point that notifications were checked. Anything updated since this time will not be updated. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadRepoListAsync(String, String, String, IEnumerable<String>, String, Nullable<DateTimeOffset>, CancellationToken)
Mark notification threads as read, pinned or unread on a specific repo
Declaration
public virtual async Task<ICollection<NotificationThread>> NotifyReadRepoListAsync(string owner, string repo, string all, IEnumerable<string> status_types, string to_status, DateTimeOffset? last_read_at, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | owner | owner of the repo |
| System.String | repo | name of the repo |
| System.String | all | If true, mark all notifications on this repo. Default value is false |
| System.Collections.Generic.IEnumerable<System.String> | status_types | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. |
| System.String | to_status | Status to mark notifications as. Defaults to read. |
| System.Nullable<System.DateTimeOffset> | last_read_at | Describes the last point that notifications were checked. Anything updated since this time will not be updated. |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NotificationThread>> | NotificationThreadList |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadThreadAsync(String, String)
Mark notification thread as read by ID
Declaration
public virtual Task<NotificationThread> NotifyReadThreadAsync(string id, string to_status)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | id of notification thread |
| System.String | to_status | Status to mark notifications as |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationThread> | NotificationThread |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
NotifyReadThreadAsync(String, String, CancellationToken)
Mark notification thread as read by ID
Declaration
public virtual async Task<NotificationThread> NotifyReadThreadAsync(string id, string to_status, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | id of notification thread |
| System.String | to_status | Status to mark notifications as |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationThread> | NotificationThread |
Exceptions
| Type | Condition |
|---|---|
| ApiException | A server side error occurred. |
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<String, IEnumerable<String>>, CancellationToken)
Declaration
protected virtual async Task<NotificationClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Net.Http.HttpResponseMessage | response | |
| System.Collections.Generic.IReadOnlyDictionary<System.String, System.Collections.Generic.IEnumerable<System.String>> | headers | |
| System.Threading.CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<NotificationClient.ObjectResponseResult<T>> |
Type Parameters
| Name | Description |
|---|---|
| T |