1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-06 06:07:29 +02:00

updated openapi

This commit is contained in:
thexeroxbe
2024-11-06 12:23:02 +01:00
parent b842d7e01a
commit 7c8c0e0cd7
9 changed files with 405 additions and 1 deletions

View File

@ -144,6 +144,7 @@ Class | Method | HTTP request | Description
*MemoriesApi* | [**removeMemoryAssets**](doc//MemoriesApi.md#removememoryassets) | **DELETE** /memories/{id}/assets |
*MemoriesApi* | [**searchMemories**](doc//MemoriesApi.md#searchmemories) | **GET** /memories |
*MemoriesApi* | [**updateMemory**](doc//MemoriesApi.md#updatememory) | **PUT** /memories/{id} |
*NotificationsApi* | [**getNotificationTemplate**](doc//NotificationsApi.md#getnotificationtemplate) | **GET** /notifications/templates/{name} |
*NotificationsApi* | [**sendTestEmail**](doc//NotificationsApi.md#sendtestemail) | **POST** /notifications/test-email |
*OAuthApi* | [**finishOAuth**](doc//OAuthApi.md#finishoauth) | **POST** /oauth/callback |
*OAuthApi* | [**linkOAuthAccount**](doc//OAuthApi.md#linkoauthaccount) | **POST** /oauth/link |
@ -437,7 +438,9 @@ Class | Method | HTTP request | Description
- [SystemConfigSmtpDto](doc//SystemConfigSmtpDto.md)
- [SystemConfigSmtpTransportDto](doc//SystemConfigSmtpTransportDto.md)
- [SystemConfigStorageTemplateDto](doc//SystemConfigStorageTemplateDto.md)
- [SystemConfigTemplateEmailsDto](doc//SystemConfigTemplateEmailsDto.md)
- [SystemConfigTemplateStorageOptionDto](doc//SystemConfigTemplateStorageOptionDto.md)
- [SystemConfigTemplatesDto](doc//SystemConfigTemplatesDto.md)
- [SystemConfigThemeDto](doc//SystemConfigThemeDto.md)
- [SystemConfigTrashDto](doc//SystemConfigTrashDto.md)
- [SystemConfigUserDto](doc//SystemConfigUserDto.md)
@ -449,6 +452,7 @@ Class | Method | HTTP request | Description
- [TagUpsertDto](doc//TagUpsertDto.md)
- [TagsResponse](doc//TagsResponse.md)
- [TagsUpdate](doc//TagsUpdate.md)
- [TemplateResponseDto](doc//TemplateResponseDto.md)
- [TestEmailResponseDto](doc//TestEmailResponseDto.md)
- [TimeBucketResponseDto](doc//TimeBucketResponseDto.md)
- [TimeBucketSize](doc//TimeBucketSize.md)

View File

@ -251,7 +251,9 @@ part 'model/system_config_server_dto.dart';
part 'model/system_config_smtp_dto.dart';
part 'model/system_config_smtp_transport_dto.dart';
part 'model/system_config_storage_template_dto.dart';
part 'model/system_config_template_emails_dto.dart';
part 'model/system_config_template_storage_option_dto.dart';
part 'model/system_config_templates_dto.dart';
part 'model/system_config_theme_dto.dart';
part 'model/system_config_trash_dto.dart';
part 'model/system_config_user_dto.dart';
@ -263,6 +265,7 @@ part 'model/tag_update_dto.dart';
part 'model/tag_upsert_dto.dart';
part 'model/tags_response.dart';
part 'model/tags_update.dart';
part 'model/template_response_dto.dart';
part 'model/test_email_response_dto.dart';
part 'model/time_bucket_response_dto.dart';
part 'model/time_bucket_size.dart';

View File

@ -16,6 +16,54 @@ class NotificationsApi {
final ApiClient apiClient;
/// Performs an HTTP 'GET /notifications/templates/{name}' operation and returns the [Response].
/// Parameters:
///
/// * [String] name (required):
Future<Response> getNotificationTemplateWithHttpInfo(String name,) async {
// ignore: prefer_const_declarations
final path = r'/notifications/templates/{name}'
.replaceAll('{name}', name);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] name (required):
Future<TemplateResponseDto?> getNotificationTemplate(String name,) async {
final response = await getNotificationTemplateWithHttpInfo(name,);
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), 'TemplateResponseDto',) as TemplateResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /notifications/test-email' operation and returns the [Response].
/// Parameters:
///

View File

@ -556,8 +556,12 @@ class ApiClient {
return SystemConfigSmtpTransportDto.fromJson(value);
case 'SystemConfigStorageTemplateDto':
return SystemConfigStorageTemplateDto.fromJson(value);
case 'SystemConfigTemplateEmailsDto':
return SystemConfigTemplateEmailsDto.fromJson(value);
case 'SystemConfigTemplateStorageOptionDto':
return SystemConfigTemplateStorageOptionDto.fromJson(value);
case 'SystemConfigTemplatesDto':
return SystemConfigTemplatesDto.fromJson(value);
case 'SystemConfigThemeDto':
return SystemConfigThemeDto.fromJson(value);
case 'SystemConfigTrashDto':
@ -580,6 +584,8 @@ class ApiClient {
return TagsResponse.fromJson(value);
case 'TagsUpdate':
return TagsUpdate.fromJson(value);
case 'TemplateResponseDto':
return TemplateResponseDto.fromJson(value);
case 'TestEmailResponseDto':
return TestEmailResponseDto.fromJson(value);
case 'TimeBucketResponseDto':

View File

@ -29,6 +29,7 @@ class SystemConfigDto {
required this.reverseGeocoding,
required this.server,
required this.storageTemplate,
required this.templates,
required this.theme,
required this.trash,
required this.user,
@ -66,6 +67,8 @@ class SystemConfigDto {
SystemConfigStorageTemplateDto storageTemplate;
SystemConfigTemplatesDto templates;
SystemConfigThemeDto theme;
SystemConfigTrashDto trash;
@ -90,6 +93,7 @@ class SystemConfigDto {
other.reverseGeocoding == reverseGeocoding &&
other.server == server &&
other.storageTemplate == storageTemplate &&
other.templates == templates &&
other.theme == theme &&
other.trash == trash &&
other.user == user;
@ -113,12 +117,13 @@ class SystemConfigDto {
(reverseGeocoding.hashCode) +
(server.hashCode) +
(storageTemplate.hashCode) +
(templates.hashCode) +
(theme.hashCode) +
(trash.hashCode) +
(user.hashCode);
@override
String toString() => 'SystemConfigDto[backup=$backup, ffmpeg=$ffmpeg, image=$image, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, metadata=$metadata, newVersionCheck=$newVersionCheck, notifications=$notifications, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, theme=$theme, trash=$trash, user=$user]';
String toString() => 'SystemConfigDto[backup=$backup, ffmpeg=$ffmpeg, image=$image, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, metadata=$metadata, newVersionCheck=$newVersionCheck, notifications=$notifications, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, templates=$templates, theme=$theme, trash=$trash, user=$user]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -138,6 +143,7 @@ class SystemConfigDto {
json[r'reverseGeocoding'] = this.reverseGeocoding;
json[r'server'] = this.server;
json[r'storageTemplate'] = this.storageTemplate;
json[r'templates'] = this.templates;
json[r'theme'] = this.theme;
json[r'trash'] = this.trash;
json[r'user'] = this.user;
@ -169,6 +175,7 @@ class SystemConfigDto {
reverseGeocoding: SystemConfigReverseGeocodingDto.fromJson(json[r'reverseGeocoding'])!,
server: SystemConfigServerDto.fromJson(json[r'server'])!,
storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!,
templates: SystemConfigTemplatesDto.fromJson(json[r'templates'])!,
theme: SystemConfigThemeDto.fromJson(json[r'theme'])!,
trash: SystemConfigTrashDto.fromJson(json[r'trash'])!,
user: SystemConfigUserDto.fromJson(json[r'user'])!,
@ -235,6 +242,7 @@ class SystemConfigDto {
'reverseGeocoding',
'server',
'storageTemplate',
'templates',
'theme',
'trash',
'user',

View File

@ -0,0 +1,115 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemConfigTemplateEmailsDto {
/// Returns a new [SystemConfigTemplateEmailsDto] instance.
SystemConfigTemplateEmailsDto({
required this.albumInviteTemplate,
required this.albumUpdateTemplate,
required this.welcomeTemplate,
});
String albumInviteTemplate;
String albumUpdateTemplate;
String welcomeTemplate;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigTemplateEmailsDto &&
other.albumInviteTemplate == albumInviteTemplate &&
other.albumUpdateTemplate == albumUpdateTemplate &&
other.welcomeTemplate == welcomeTemplate;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumInviteTemplate.hashCode) +
(albumUpdateTemplate.hashCode) +
(welcomeTemplate.hashCode);
@override
String toString() => 'SystemConfigTemplateEmailsDto[albumInviteTemplate=$albumInviteTemplate, albumUpdateTemplate=$albumUpdateTemplate, welcomeTemplate=$welcomeTemplate]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumInviteTemplate'] = this.albumInviteTemplate;
json[r'albumUpdateTemplate'] = this.albumUpdateTemplate;
json[r'welcomeTemplate'] = this.welcomeTemplate;
return json;
}
/// Returns a new [SystemConfigTemplateEmailsDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigTemplateEmailsDto? fromJson(dynamic value) {
upgradeDto(value, "SystemConfigTemplateEmailsDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return SystemConfigTemplateEmailsDto(
albumInviteTemplate: mapValueOfType<String>(json, r'albumInviteTemplate')!,
albumUpdateTemplate: mapValueOfType<String>(json, r'albumUpdateTemplate')!,
welcomeTemplate: mapValueOfType<String>(json, r'welcomeTemplate')!,
);
}
return null;
}
static List<SystemConfigTemplateEmailsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigTemplateEmailsDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigTemplateEmailsDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SystemConfigTemplateEmailsDto> mapFromJson(dynamic json) {
final map = <String, SystemConfigTemplateEmailsDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigTemplateEmailsDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SystemConfigTemplateEmailsDto-objects as value to a dart map
static Map<String, List<SystemConfigTemplateEmailsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigTemplateEmailsDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = SystemConfigTemplateEmailsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumInviteTemplate',
'albumUpdateTemplate',
'welcomeTemplate',
};
}

View File

@ -0,0 +1,99 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemConfigTemplatesDto {
/// Returns a new [SystemConfigTemplatesDto] instance.
SystemConfigTemplatesDto({
required this.email,
});
SystemConfigTemplateEmailsDto email;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigTemplatesDto &&
other.email == email;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(email.hashCode);
@override
String toString() => 'SystemConfigTemplatesDto[email=$email]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'email'] = this.email;
return json;
}
/// Returns a new [SystemConfigTemplatesDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigTemplatesDto? fromJson(dynamic value) {
upgradeDto(value, "SystemConfigTemplatesDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return SystemConfigTemplatesDto(
email: SystemConfigTemplateEmailsDto.fromJson(json[r'email'])!,
);
}
return null;
}
static List<SystemConfigTemplatesDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigTemplatesDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigTemplatesDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SystemConfigTemplatesDto> mapFromJson(dynamic json) {
final map = <String, SystemConfigTemplatesDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigTemplatesDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SystemConfigTemplatesDto-objects as value to a dart map
static Map<String, List<SystemConfigTemplatesDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigTemplatesDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = SystemConfigTemplatesDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'email',
};
}

View File

@ -0,0 +1,107 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class TemplateResponseDto {
/// Returns a new [TemplateResponseDto] instance.
TemplateResponseDto({
required this.html,
required this.name,
});
String html;
String name;
@override
bool operator ==(Object other) => identical(this, other) || other is TemplateResponseDto &&
other.html == html &&
other.name == name;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(html.hashCode) +
(name.hashCode);
@override
String toString() => 'TemplateResponseDto[html=$html, name=$name]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'html'] = this.html;
json[r'name'] = this.name;
return json;
}
/// Returns a new [TemplateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TemplateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "TemplateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return TemplateResponseDto(
html: mapValueOfType<String>(json, r'html')!,
name: mapValueOfType<String>(json, r'name')!,
);
}
return null;
}
static List<TemplateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TemplateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TemplateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TemplateResponseDto> mapFromJson(dynamic json) {
final map = <String, TemplateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TemplateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TemplateResponseDto-objects as value to a dart map
static Map<String, List<TemplateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TemplateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = TemplateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'html',
'name',
};
}

View File

@ -639,6 +639,10 @@ export type MemoryUpdateDto = {
memoryAt?: string;
seenAt?: string;
};
export type TemplateResponseDto = {
html: string;
name: string;
};
export type SystemConfigSmtpTransportDto = {
host: string;
ignoreCert: boolean;
@ -2233,6 +2237,16 @@ export function addMemoryAssets({ id, bulkIdsDto }: {
body: bulkIdsDto
})));
}
export function getNotificationTemplate({ name }: {
name: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: TemplateResponseDto;
}>(`/notifications/templates/${encodeURIComponent(name)}`, {
...opts
}));
}
export function sendTestEmail({ systemConfigSmtpDto }: {
systemConfigSmtpDto: SystemConfigSmtpDto;
}, opts?: Oazapfts.RequestOpts) {