/* tslint:disable */ /* eslint-disable */ /** * Gitea API. * This documentation describes the Gitea API. * * OpenAPI spec version: 1.15.0+dev-49-gaee5ef005 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { NotificationCount } from '../models'; import { NotificationThread } from '../models'; /** * NotificationApi - axios parameter creator * @export */ export const NotificationApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary List users's notification threads * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetList: async (all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options: any = {}): Promise => { const localVarPath = `/notifications`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } if (all !== undefined) { localVarQueryParameter['all'] = all; } if (status_types) { localVarQueryParameter['status-types'] = status_types; } if (since !== undefined) { localVarQueryParameter['since'] = (since as any instanceof Date) ? (since as any).toISOString() : since; } if (before !== undefined) { localVarQueryParameter['before'] = (before as any instanceof Date) ? (before as any).toISOString() : before; } if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary List users's notification threads on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetRepoList: async (owner: string, repo: string, all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options: any = {}): Promise => { // verify required parameter 'owner' is not null or undefined if (owner === null || owner === undefined) { throw new RequiredError('owner','Required parameter owner was null or undefined when calling notifyGetRepoList.'); } // verify required parameter 'repo' is not null or undefined if (repo === null || repo === undefined) { throw new RequiredError('repo','Required parameter repo was null or undefined when calling notifyGetRepoList.'); } const localVarPath = `/repos/{owner}/{repo}/notifications` .replace(`{${"owner"}}`, encodeURIComponent(String(owner))) .replace(`{${"repo"}}`, encodeURIComponent(String(repo))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } if (all !== undefined) { localVarQueryParameter['all'] = all; } if (status_types) { localVarQueryParameter['status-types'] = status_types; } if (since !== undefined) { localVarQueryParameter['since'] = (since as any instanceof Date) ? (since as any).toISOString() : since; } if (before !== undefined) { localVarQueryParameter['before'] = (before as any instanceof Date) ? (before as any).toISOString() : before; } if (page !== undefined) { localVarQueryParameter['page'] = page; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Get notification thread by ID * @param {string} id id of notification thread * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetThread: async (id: string, options: any = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling notifyGetThread.'); } const localVarPath = `/notifications/threads/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Check if unread notifications exist * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyNewAvailable: async (options: any = {}): Promise => { const localVarPath = `/notifications/new`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Mark notification threads as read, pinned or unread * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as, Defaults to read. * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadList: async (last_read_at?: Date, all?: string, status_types?: Array, to_status?: string, options: any = {}): Promise => { const localVarPath = `/notifications`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } if (last_read_at !== undefined) { localVarQueryParameter['last_read_at'] = (last_read_at as any instanceof Date) ? (last_read_at as any).toISOString() : last_read_at; } if (all !== undefined) { localVarQueryParameter['all'] = all; } if (status_types) { localVarQueryParameter['status-types'] = status_types; } if (to_status !== undefined) { localVarQueryParameter['to-status'] = to_status; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Mark notification threads as read, pinned or unread on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as. Defaults to read. * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadRepoList: async (owner: string, repo: string, all?: string, status_types?: Array, to_status?: string, last_read_at?: Date, options: any = {}): Promise => { // verify required parameter 'owner' is not null or undefined if (owner === null || owner === undefined) { throw new RequiredError('owner','Required parameter owner was null or undefined when calling notifyReadRepoList.'); } // verify required parameter 'repo' is not null or undefined if (repo === null || repo === undefined) { throw new RequiredError('repo','Required parameter repo was null or undefined when calling notifyReadRepoList.'); } const localVarPath = `/repos/{owner}/{repo}/notifications` .replace(`{${"owner"}}`, encodeURIComponent(String(owner))) .replace(`{${"repo"}}`, encodeURIComponent(String(repo))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } if (all !== undefined) { localVarQueryParameter['all'] = all; } if (status_types) { localVarQueryParameter['status-types'] = status_types; } if (to_status !== undefined) { localVarQueryParameter['to-status'] = to_status; } if (last_read_at !== undefined) { localVarQueryParameter['last_read_at'] = (last_read_at as any instanceof Date) ? (last_read_at as any).toISOString() : last_read_at; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary Mark notification thread as read by ID * @param {string} id id of notification thread * @param {string} [to_status] Status to mark notifications as * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadThread: async (id: string, to_status?: string, options: any = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling notifyReadThread.'); } const localVarPath = `/notifications/threads/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication AccessToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("access_token") : await configuration.apiKey; localVarQueryParameter["access_token"] = localVarApiKeyValue; } // authentication AuthorizationHeaderToken required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Authorization") : await configuration.apiKey; localVarHeaderParameter["Authorization"] = localVarApiKeyValue; } // authentication BasicAuth required // authentication SudoHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("Sudo") : await configuration.apiKey; localVarHeaderParameter["Sudo"] = localVarApiKeyValue; } // authentication SudoParam required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("sudo") : await configuration.apiKey; localVarQueryParameter["sudo"] = localVarApiKeyValue; } // authentication TOTPHeader required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-GITEA-OTP") : await configuration.apiKey; localVarHeaderParameter["X-GITEA-OTP"] = localVarApiKeyValue; } // authentication Token required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("token") : await configuration.apiKey; localVarQueryParameter["token"] = localVarApiKeyValue; } if (to_status !== undefined) { localVarQueryParameter['to-status'] = to_status; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * NotificationApi - functional programming interface * @export */ export const NotificationApiFp = function(configuration?: Configuration) { return { /** * * @summary List users's notification threads * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyGetList(all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyGetList(all, status_types, since, before, page, limit, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary List users's notification threads on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyGetRepoList(owner: string, repo: string, all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyGetRepoList(owner, repo, all, status_types, since, before, page, limit, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Get notification thread by ID * @param {string} id id of notification thread * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyGetThread(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyGetThread(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Check if unread notifications exist * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyNewAvailable(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyNewAvailable(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Mark notification threads as read, pinned or unread * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as, Defaults to read. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyReadList(last_read_at?: Date, all?: string, status_types?: Array, to_status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyReadList(last_read_at, all, status_types, to_status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Mark notification threads as read, pinned or unread on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as. Defaults to read. * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyReadRepoList(owner: string, repo: string, all?: string, status_types?: Array, to_status?: string, last_read_at?: Date, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyReadRepoList(owner, repo, all, status_types, to_status, last_read_at, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @summary Mark notification thread as read by ID * @param {string} id id of notification thread * @param {string} [to_status] Status to mark notifications as * @param {*} [options] Override http request option. * @throws {RequiredError} */ async notifyReadThread(id: string, to_status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await NotificationApiAxiosParamCreator(configuration).notifyReadThread(id, to_status, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * NotificationApi - factory interface * @export */ export const NotificationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary List users's notification threads * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetList(all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any): AxiosPromise> { return NotificationApiFp(configuration).notifyGetList(all, status_types, since, before, page, limit, options).then((request) => request(axios, basePath)); }, /** * * @summary List users's notification threads on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetRepoList(owner: string, repo: string, all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any): AxiosPromise> { return NotificationApiFp(configuration).notifyGetRepoList(owner, repo, all, status_types, since, before, page, limit, options).then((request) => request(axios, basePath)); }, /** * * @summary Get notification thread by ID * @param {string} id id of notification thread * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyGetThread(id: string, options?: any): AxiosPromise { return NotificationApiFp(configuration).notifyGetThread(id, options).then((request) => request(axios, basePath)); }, /** * * @summary Check if unread notifications exist * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyNewAvailable(options?: any): AxiosPromise { return NotificationApiFp(configuration).notifyNewAvailable(options).then((request) => request(axios, basePath)); }, /** * * @summary Mark notification threads as read, pinned or unread * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as, Defaults to read. * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadList(last_read_at?: Date, all?: string, status_types?: Array, to_status?: string, options?: any): AxiosPromise { return NotificationApiFp(configuration).notifyReadList(last_read_at, all, status_types, to_status, options).then((request) => request(axios, basePath)); }, /** * * @summary Mark notification threads as read, pinned or unread on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as. Defaults to read. * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadRepoList(owner: string, repo: string, all?: string, status_types?: Array, to_status?: string, last_read_at?: Date, options?: any): AxiosPromise { return NotificationApiFp(configuration).notifyReadRepoList(owner, repo, all, status_types, to_status, last_read_at, options).then((request) => request(axios, basePath)); }, /** * * @summary Mark notification thread as read by ID * @param {string} id id of notification thread * @param {string} [to_status] Status to mark notifications as * @param {*} [options] Override http request option. * @throws {RequiredError} */ notifyReadThread(id: string, to_status?: string, options?: any): AxiosPromise { return NotificationApiFp(configuration).notifyReadThread(id, to_status, options).then((request) => request(axios, basePath)); }, }; }; /** * NotificationApi - object-oriented interface * @export * @class NotificationApi * @extends {BaseAPI} */ export class NotificationApi extends BaseAPI { /** * * @summary List users's notification threads * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyGetList(all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any) { return NotificationApiFp(this.configuration).notifyGetList(all, status_types, since, before, page, limit, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary List users's notification threads on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, show notifications marked as read. Default value is false * @param {Array<string>} [status_types] Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned * @param {Date} [since] Only show notifications updated after the given time. This is a timestamp in RFC 3339 format * @param {Date} [before] Only show notifications updated before the given time. This is a timestamp in RFC 3339 format * @param {number} [page] page number of results to return (1-based) * @param {number} [limit] page size of results * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyGetRepoList(owner: string, repo: string, all?: string, status_types?: Array, since?: Date, before?: Date, page?: number, limit?: number, options?: any) { return NotificationApiFp(this.configuration).notifyGetRepoList(owner, repo, all, status_types, since, before, page, limit, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Get notification thread by ID * @param {string} id id of notification thread * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyGetThread(id: string, options?: any) { return NotificationApiFp(this.configuration).notifyGetThread(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Check if unread notifications exist * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyNewAvailable(options?: any) { return NotificationApiFp(this.configuration).notifyNewAvailable(options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Mark notification threads as read, pinned or unread * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as, Defaults to read. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyReadList(last_read_at?: Date, all?: string, status_types?: Array, to_status?: string, options?: any) { return NotificationApiFp(this.configuration).notifyReadList(last_read_at, all, status_types, to_status, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Mark notification threads as read, pinned or unread on a specific repo * @param {string} owner owner of the repo * @param {string} repo name of the repo * @param {string} [all] If true, mark all notifications on this repo. Default value is false * @param {Array<string>} [status_types] Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. * @param {string} [to_status] Status to mark notifications as. Defaults to read. * @param {Date} [last_read_at] Describes the last point that notifications were checked. Anything updated since this time will not be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyReadRepoList(owner: string, repo: string, all?: string, status_types?: Array, to_status?: string, last_read_at?: Date, options?: any) { return NotificationApiFp(this.configuration).notifyReadRepoList(owner, repo, all, status_types, to_status, last_read_at, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Mark notification thread as read by ID * @param {string} id id of notification thread * @param {string} [to_status] Status to mark notifications as * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof NotificationApi */ public notifyReadThread(id: string, to_status?: string, options?: any) { return NotificationApiFp(this.configuration).notifyReadThread(id, to_status, options).then((request) => request(this.axios, this.basePath)); } }