mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: endpoint descriptions (#23813)
This commit is contained in:
parent
896665bca9
commit
edde0f93ae
76 changed files with 4193 additions and 1663 deletions
357
mobile/openapi/lib/api/authentication_api.dart
generated
357
mobile/openapi/lib/api/authentication_api.dart
generated
|
|
@ -16,7 +16,9 @@ class AuthenticationApi {
|
|||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// This endpoint requires the `auth.changePassword` permission.
|
||||
/// Change password
|
||||
///
|
||||
/// Change the password of the current user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
|
|
@ -48,7 +50,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// This endpoint requires the `auth.changePassword` permission.
|
||||
/// Change password
|
||||
///
|
||||
/// Change the password of the current user.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
@ -68,7 +72,9 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.update` permission.
|
||||
/// Change pin code
|
||||
///
|
||||
/// Change the pin code for the current user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
|
|
@ -100,7 +106,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.update` permission.
|
||||
/// Change pin code
|
||||
///
|
||||
/// Change the pin code for the current user.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
@ -112,7 +120,67 @@ class AuthenticationApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /auth/status' operation and returns the [Response].
|
||||
/// Finish OAuth
|
||||
///
|
||||
/// Complete the OAuth authorization process by exchanging the authorization code for a session token.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthCallbackDto] oAuthCallbackDto (required):
|
||||
Future<Response> finishOAuthWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/oauth/callback';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = oAuthCallbackDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Finish OAuth
|
||||
///
|
||||
/// Complete the OAuth authorization process by exchanging the authorization code for a session token.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthCallbackDto] oAuthCallbackDto (required):
|
||||
Future<LoginResponseDto?> finishOAuth(OAuthCallbackDto oAuthCallbackDto,) async {
|
||||
final response = await finishOAuthWithHttpInfo(oAuthCallbackDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LoginResponseDto',) as LoginResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Retrieve auth status
|
||||
///
|
||||
/// Get information about the current session, including whether the user has a password, and if the session can access locked assets.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> getAuthStatusWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/status';
|
||||
|
|
@ -138,6 +206,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Retrieve auth status
|
||||
///
|
||||
/// Get information about the current session, including whether the user has a password, and if the session can access locked assets.
|
||||
Future<AuthStatusResponseDto?> getAuthStatus() async {
|
||||
final response = await getAuthStatusWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
|
|
@ -153,7 +224,67 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/session/lock' operation and returns the [Response].
|
||||
/// Link OAuth account
|
||||
///
|
||||
/// Link an OAuth account to the authenticated user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthCallbackDto] oAuthCallbackDto (required):
|
||||
Future<Response> linkOAuthAccountWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/oauth/link';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = oAuthCallbackDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Link OAuth account
|
||||
///
|
||||
/// Link an OAuth account to the authenticated user.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthCallbackDto] oAuthCallbackDto (required):
|
||||
Future<UserAdminResponseDto?> linkOAuthAccount(OAuthCallbackDto oAuthCallbackDto,) async {
|
||||
final response = await linkOAuthAccountWithHttpInfo(oAuthCallbackDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Lock auth session
|
||||
///
|
||||
/// Remove elevated access to locked assets from the current session.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> lockAuthSessionWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/session/lock';
|
||||
|
|
@ -179,6 +310,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Lock auth session
|
||||
///
|
||||
/// Remove elevated access to locked assets from the current session.
|
||||
Future<void> lockAuthSession() async {
|
||||
final response = await lockAuthSessionWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
|
|
@ -186,7 +320,12 @@ class AuthenticationApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/login' operation and returns the [Response].
|
||||
/// Login
|
||||
///
|
||||
/// Login with username and password and receive a session token.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [LoginCredentialDto] loginCredentialDto (required):
|
||||
|
|
@ -215,6 +354,10 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Login
|
||||
///
|
||||
/// Login with username and password and receive a session token.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [LoginCredentialDto] loginCredentialDto (required):
|
||||
|
|
@ -233,7 +376,11 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/logout' operation and returns the [Response].
|
||||
/// Logout
|
||||
///
|
||||
/// Logout the current user and invalidate the session token.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> logoutWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/logout';
|
||||
|
|
@ -259,6 +406,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Logout
|
||||
///
|
||||
/// Logout the current user and invalidate the session token.
|
||||
Future<LogoutResponseDto?> logout() async {
|
||||
final response = await logoutWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
|
|
@ -274,7 +424,49 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.delete` permission.
|
||||
/// Redirect OAuth to mobile
|
||||
///
|
||||
/// Requests to this URL are automatically forwarded to the mobile app, and is used in some cases for OAuth redirecting.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> redirectOAuthToMobileWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/oauth/mobile-redirect';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Redirect OAuth to mobile
|
||||
///
|
||||
/// Requests to this URL are automatically forwarded to the mobile app, and is used in some cases for OAuth redirecting.
|
||||
Future<void> redirectOAuthToMobile() async {
|
||||
final response = await redirectOAuthToMobileWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Reset pin code
|
||||
///
|
||||
/// Reset the pin code for the current user by providing the account password
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
|
|
@ -306,7 +498,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.delete` permission.
|
||||
/// Reset pin code
|
||||
///
|
||||
/// Reset the pin code for the current user by providing the account password
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
@ -318,7 +512,9 @@ class AuthenticationApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.create` permission.
|
||||
/// Setup pin code
|
||||
///
|
||||
/// Setup a new pin code for the current user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
|
|
@ -350,7 +546,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// This endpoint requires the `pinCode.create` permission.
|
||||
/// Setup pin code
|
||||
///
|
||||
/// Setup a new pin code for the current user.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
@ -362,7 +560,12 @@ class AuthenticationApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/admin-sign-up' operation and returns the [Response].
|
||||
/// Register admin
|
||||
///
|
||||
/// Create the first admin user in the system.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SignUpDto] signUpDto (required):
|
||||
|
|
@ -391,6 +594,10 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Register admin
|
||||
///
|
||||
/// Create the first admin user in the system.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SignUpDto] signUpDto (required):
|
||||
|
|
@ -409,7 +616,116 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/session/unlock' operation and returns the [Response].
|
||||
/// Start OAuth
|
||||
///
|
||||
/// Initiate the OAuth authorization process.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthConfigDto] oAuthConfigDto (required):
|
||||
Future<Response> startOAuthWithHttpInfo(OAuthConfigDto oAuthConfigDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/oauth/authorize';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = oAuthConfigDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Start OAuth
|
||||
///
|
||||
/// Initiate the OAuth authorization process.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [OAuthConfigDto] oAuthConfigDto (required):
|
||||
Future<OAuthAuthorizeResponseDto?> startOAuth(OAuthConfigDto oAuthConfigDto,) async {
|
||||
final response = await startOAuthWithHttpInfo(oAuthConfigDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OAuthAuthorizeResponseDto',) as OAuthAuthorizeResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Unlink OAuth account
|
||||
///
|
||||
/// Unlink the OAuth account from the authenticated user.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> unlinkOAuthAccountWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/oauth/unlink';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Unlink OAuth account
|
||||
///
|
||||
/// Unlink the OAuth account from the authenticated user.
|
||||
Future<UserAdminResponseDto?> unlinkOAuthAccount() async {
|
||||
final response = await unlinkOAuthAccountWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Unlock auth session
|
||||
///
|
||||
/// Temporarily grant the session elevated access to locked assets by providing the correct PIN code.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SessionUnlockDto] sessionUnlockDto (required):
|
||||
|
|
@ -438,6 +754,10 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Unlock auth session
|
||||
///
|
||||
/// Temporarily grant the session elevated access to locked assets by providing the correct PIN code.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SessionUnlockDto] sessionUnlockDto (required):
|
||||
|
|
@ -448,7 +768,11 @@ class AuthenticationApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/validateToken' operation and returns the [Response].
|
||||
/// Validate access token
|
||||
///
|
||||
/// Validate the current authorization method is still valid.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> validateAccessTokenWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/validateToken';
|
||||
|
|
@ -474,6 +798,9 @@ class AuthenticationApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Validate access token
|
||||
///
|
||||
/// Validate the current authorization method is still valid.
|
||||
Future<ValidateAccessTokenResponseDto?> validateAccessToken() async {
|
||||
final response = await validateAccessTokenWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue