Skip to content

Latest commit

 

History

History
673 lines (530 loc) · 31.2 KB

NotificationApi.md

File metadata and controls

673 lines (530 loc) · 31.2 KB

NotificationApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
notifyGetList GET /notifications List users's notification threads
notifyGetRepoList GET /repos/{owner}/{repo}/notifications List users's notification threads on a specific repo
notifyGetThread GET /notifications/threads/{id} Get notification thread by ID
notifyNewAvailable GET /notifications/new Check if unread notifications exist
notifyReadList PUT /notifications Mark notification threads as read, pinned or unread
notifyReadRepoList PUT /repos/{owner}/{repo}/notifications Mark notification threads as read, pinned or unread on a specific repo
notifyReadThread PATCH /notifications/threads/{id} Mark notification thread as read by ID

notifyGetList

List<NotificationThread> notifyGetList(all, statusTypes, subjectType, since, before, page, limit)

List users's notification threads

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
Boolean all = true; // Boolean | If true, show notifications marked as read. Default value is false
List<String> statusTypes = Arrays.asList("statusTypes_example"); // List<String> | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.
List<String> subjectType = Arrays.asList("subjectType_example"); // List<String> | filter notifications by subject type
OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
OffsetDateTime before = OffsetDateTime.now(); // OffsetDateTime | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
Integer page = 56; // Integer | page number of results to return (1-based)
Integer limit = 56; // Integer | page size of results
try {
    List<NotificationThread> result = apiInstance.notifyGetList(all, statusTypes, subjectType, since, before, page, limit);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyGetList");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
all Boolean If true, show notifications marked as read. Default value is false [optional]
statusTypes List<String> Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. [optional]
subjectType List<String> filter notifications by subject type [optional] [enum: issue, pull, commit, repository]
since OffsetDateTime Only show notifications updated after the given time. This is a timestamp in RFC 3339 format [optional]
before OffsetDateTime Only show notifications updated before the given time. This is a timestamp in RFC 3339 format [optional]
page Integer page number of results to return (1-based) [optional]
limit Integer page size of results [optional]

Return type

List<NotificationThread>

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notifyGetRepoList

List<NotificationThread> notifyGetRepoList(owner, repo, all, statusTypes, subjectType, since, before, page, limit)

List users's notification threads on a specific repo

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
String owner = "owner_example"; // String | owner of the repo
String repo = "repo_example"; // String | name of the repo
Boolean all = true; // Boolean | If true, show notifications marked as read. Default value is false
List<String> statusTypes = Arrays.asList("statusTypes_example"); // List<String> | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned
List<String> subjectType = Arrays.asList("subjectType_example"); // List<String> | filter notifications by subject type
OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
OffsetDateTime before = OffsetDateTime.now(); // OffsetDateTime | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
Integer page = 56; // Integer | page number of results to return (1-based)
Integer limit = 56; // Integer | page size of results
try {
    List<NotificationThread> result = apiInstance.notifyGetRepoList(owner, repo, all, statusTypes, subjectType, since, before, page, limit);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyGetRepoList");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String owner of the repo
repo String name of the repo
all Boolean If true, show notifications marked as read. Default value is false [optional]
statusTypes List<String> Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned [optional]
subjectType List<String> filter notifications by subject type [optional] [enum: issue, pull, commit, repository]
since OffsetDateTime Only show notifications updated after the given time. This is a timestamp in RFC 3339 format [optional]
before OffsetDateTime Only show notifications updated before the given time. This is a timestamp in RFC 3339 format [optional]
page Integer page number of results to return (1-based) [optional]
limit Integer page size of results [optional]

Return type

List<NotificationThread>

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notifyGetThread

NotificationThread notifyGetThread(id)

Get notification thread by ID

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
String id = "id_example"; // String | id of notification thread
try {
    NotificationThread result = apiInstance.notifyGetThread(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyGetThread");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String id of notification thread

Return type

NotificationThread

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notifyNewAvailable

NotificationCount notifyNewAvailable()

Check if unread notifications exist

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
try {
    NotificationCount result = apiInstance.notifyNewAvailable();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyNewAvailable");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

NotificationCount

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json, text/plain
  • Accept: application/json, text/html

notifyReadList

List<NotificationThread> notifyReadList(lastReadAt, all, statusTypes, toStatus)

Mark notification threads as read, pinned or unread

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
OffsetDateTime lastReadAt = OffsetDateTime.now(); // OffsetDateTime | Describes the last point that notifications were checked. Anything updated since this time will not be updated.
String all = "all_example"; // String | If true, mark all notifications on this repo. Default value is false
List<String> statusTypes = Arrays.asList("statusTypes_example"); // List<String> | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
String toStatus = "toStatus_example"; // String | Status to mark notifications as, Defaults to read.
try {
    List<NotificationThread> result = apiInstance.notifyReadList(lastReadAt, all, statusTypes, toStatus);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyReadList");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
lastReadAt OffsetDateTime Describes the last point that notifications were checked. Anything updated since this time will not be updated. [optional]
all String If true, mark all notifications on this repo. Default value is false [optional]
statusTypes List<String> Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. [optional]
toStatus String Status to mark notifications as, Defaults to read. [optional]

Return type

List<NotificationThread>

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notifyReadRepoList

List<NotificationThread> notifyReadRepoList(owner, repo, all, statusTypes, toStatus, lastReadAt)

Mark notification threads as read, pinned or unread on a specific repo

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
String owner = "owner_example"; // String | owner of the repo
String repo = "repo_example"; // String | name of the repo
String all = "all_example"; // String | If true, mark all notifications on this repo. Default value is false
List<String> statusTypes = Arrays.asList("statusTypes_example"); // List<String> | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
String toStatus = "toStatus_example"; // String | Status to mark notifications as. Defaults to read.
OffsetDateTime lastReadAt = OffsetDateTime.now(); // OffsetDateTime | Describes the last point that notifications were checked. Anything updated since this time will not be updated.
try {
    List<NotificationThread> result = apiInstance.notifyReadRepoList(owner, repo, all, statusTypes, toStatus, lastReadAt);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyReadRepoList");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
owner String owner of the repo
repo String name of the repo
all String If true, mark all notifications on this repo. Default value is false [optional]
statusTypes List<String> Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. [optional]
toStatus String Status to mark notifications as. Defaults to read. [optional]
lastReadAt OffsetDateTime Describes the last point that notifications were checked. Anything updated since this time will not be updated. [optional]

Return type

List<NotificationThread>

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notifyReadThread

NotificationThread notifyReadThread(id, toStatus)

Mark notification thread as read by ID

Example

// Import classes:
//import io.gitea.ApiClient;
//import io.gitea.ApiException;
//import io.gitea.Configuration;
//import io.gitea.auth.*;
//import io.gitea.api.NotificationApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");

// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");

// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");

// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");

// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");

// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");

// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");

NotificationApi apiInstance = new NotificationApi();
String id = "id_example"; // String | id of notification thread
String toStatus = "read"; // String | Status to mark notifications as
try {
    NotificationThread result = apiInstance.notifyReadThread(id, toStatus);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling NotificationApi#notifyReadThread");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id String id of notification thread
toStatus String Status to mark notifications as [optional] [default to read]

Return type

NotificationThread

Authorization

AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, TOTPHeader, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json