feat: yucca integration

This commit is contained in:
izzy 2026-04-15 15:17:19 +01:00
parent 8454cb2631
commit 77f9e87bd3
No known key found for this signature in database
102 changed files with 11198 additions and 164 deletions

View File

@ -85,7 +85,10 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
// https://github.com/devcontainers/features/issues/1466
"moby": false
"moby": false,
"dockerDashComposeVersion": "none",
"installDockerBuildx": false,
"installDockerComposeSwitch": false
}
},
"forwardPorts": [3000, 9231, 9230, 2283],

View File

@ -82,6 +82,8 @@ jobs:
node-version-file: './server/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run package manager install
run: pnpm install
- name: Run linter
@ -126,6 +128,8 @@ jobs:
node-version-file: './cli/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Setup typescript-sdk
run: pnpm install && pnpm run build
working-directory: ./open-api/typescript-sdk
@ -173,6 +177,8 @@ jobs:
node-version-file: './cli/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -215,6 +221,8 @@ jobs:
node-version-file: './web/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -259,6 +267,8 @@ jobs:
node-version-file: './web/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -297,6 +307,8 @@ jobs:
node-version-file: './web/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Install dependencies
run: pnpm --filter=immich-i18n install --frozen-lockfile
- name: Format
@ -345,6 +357,8 @@ jobs:
node-version-file: './e2e/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -392,6 +406,8 @@ jobs:
node-version-file: './server/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run pnpm install
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
- name: Run medium tests
@ -431,6 +447,8 @@ jobs:
node-version-file: './e2e/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -503,6 +521,8 @@ jobs:
node-version-file: './e2e/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup typescript-sdk
run: pnpm install --frozen-lockfile && pnpm build
working-directory: ./open-api/typescript-sdk
@ -668,6 +688,8 @@ jobs:
node-version-file: './.github/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run pnpm install
run: pnpm install --frozen-lockfile
- name: Run formatter
@ -719,6 +741,8 @@ jobs:
node-version-file: './server/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Install server dependencies
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile
- name: Build the app
@ -781,6 +805,8 @@ jobs:
node-version-file: './server/.nvmrc'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Install server dependencies
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
- name: Build the app

View File

@ -44,6 +44,7 @@
"exiftool-vendored": "^35.0.0",
"globals": "^17.0.0",
"luxon": "^3.4.4",
"orchestration-ui": "0.1.54",
"pg": "^8.11.3",
"pngjs": "^7.0.0",
"prettier": "^3.7.4",

View File

@ -0,0 +1,385 @@
import { LoginResponseDto, StorageFolder } from '@immich/sdk';
import * as sdk from 'orchestration-ui/sdk';
import { io, Socket } from 'socket.io-client';
import { createUserDto } from 'src/fixtures';
import { errorDto } from 'src/responses';
import { app, asBearerAuth, baseUrl, utils } from 'src/utils';
import request from 'supertest';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
describe('/yucca', () => {
let admin: LoginResponseDto;
let nonAdmin: LoginResponseDto;
let requestOpts: any;
let filename: string;
let socket: Socket;
let libraryId: string;
beforeAll(async () => {
sdk.defaults.baseUrl = baseUrl;
await utils.resetDatabase();
admin = await utils.adminSetup();
nonAdmin = await utils.userSetup(admin.accessToken, createUserDto.user1);
requestOpts = { headers: asBearerAuth(admin.accessToken) };
await utils.resetBackups(admin.accessToken);
await sdk.resetOrchestrator(requestOpts);
socket = io(baseUrl, {
path: '/api/yucca/socket.io',
transports: ['websocket'],
extraHeaders: asBearerAuth(admin.accessToken),
});
socket.onAny(console.info);
});
afterAll(async () => {
socket.close();
// "resetDatabase" does not reinit the module config, trigger an update / clean up
if (libraryId) {
await utils.deleteLibrary(admin.accessToken, libraryId);
}
});
const waitForMessage = (type: string) => {
return new Promise((resolve) => {
const listener = (msg: string) => {
const payload = JSON.parse(msg);
if (payload.type !== type) {
return;
}
resolve(payload);
socket.offAny(listener);
};
socket.onAny(listener);
});
};
describe('Orchestration Module', async () => {
it('works', async () => {
await expect(sdk.onboardingStatus(requestOpts)).resolves.toEqual(
expect.objectContaining({
hasOnboardedKey: false,
hasBackend: false,
hasBackup: false,
hasSchedule: false,
hasSkippedExtraConfig: false,
}),
);
});
it('is inaccessible without admin', async () => {
await expect(sdk.onboardingStatus({ headers: asBearerAuth(nonAdmin.accessToken) })).rejects.toEqual(
expect.objectContaining({ data: errorDto.forbidden }),
);
});
it('is inaccessible without logging in', async () => {
await expect(sdk.onboardingStatus()).rejects.toEqual(expect.objectContaining({ data: errorDto.unauthorized }));
});
});
describe.sequential('Local Backup', async () => {
beforeAll(async () => {
await sdk.importRecoveryKey(
{
recoveryKey: '0'.repeat(32),
},
requestOpts,
);
});
it.sequential('configures a local backend', async () => {
await utils.mkdir('/local-backend');
await sdk.createLocalBackend(
{
path: '/local-backend',
},
requestOpts,
);
});
it.sequential('configures Immich backup', async () => {
const event = waitForMessage('IntegrationUpdate');
await sdk.configureImmichIntegration(
{
name: 'Immich',
worm: false,
cron: '0 3 * * *',
backupConfiguration: true,
dataFolders: [StorageFolder.Backups, StorageFolder.Upload],
libraries: 'all',
},
requestOpts,
);
await event;
await expect(sdk.getIntegrations(requestOpts)).resolves.toEqual(
expect.objectContaining({
immichIntegration: expect.objectContaining({
configuration: {
backupConfiguration: true,
dataFolders: ['backups', 'upload'],
libraries: 'all',
},
}),
immichState: {
dataFolders: expect.arrayContaining(Object.values(StorageFolder)),
dataPath: '/data',
libraries: [],
},
}),
);
});
it.sequential('updates configuration', async () => {
await utils.mkdir('/test');
({ id: libraryId } = await utils.createLibrary(admin.accessToken, {
ownerId: admin.userId,
name: 'My Library',
importPaths: ['/test'],
}));
await expect(sdk.getIntegrations(requestOpts)).resolves.toEqual(
expect.objectContaining({
immichIntegration: expect.any(Object),
immichState: expect.objectContaining({
libraries: expect.arrayContaining([
expect.objectContaining({
name: 'My Library',
importPaths: ['/test'],
}),
]),
}),
}),
);
});
it.sequential('creates a snapshot', async () => {
const event = waitForMessage('TaskEnd');
const {
repositories: [{ id }],
} = await sdk.getRepositories(requestOpts);
filename = await utils.createBackup(admin.accessToken);
await sdk.createBackup(id, requestOpts);
await event;
const {
snapshots: [{ id: snapshotId }],
} = await sdk.getSnapshots(id, requestOpts);
await expect(sdk.getSnapshotListing(id, snapshotId, {}, requestOpts)).resolves.toMatchInlineSnapshot(`
{
"items": [
{
"isDirectory": true,
"path": "/data",
},
{
"isDirectory": true,
"path": "/test",
},
{
"isDirectory": true,
"path": "/yucca",
},
],
"parent": "/",
"path": "/",
}
`);
await expect(sdk.getSnapshotListing(id, snapshotId, { path: '/data' }, requestOpts)).resolves
.toMatchInlineSnapshot(`
{
"items": [
{
"isDirectory": true,
"path": "/data/backups",
},
{
"isDirectory": true,
"path": "/data/upload",
},
],
"parent": "/",
"path": "/data",
}
`);
await expect(sdk.getSnapshotListing(id, snapshotId, { path: '/data/backups' }, requestOpts)).resolves.toEqual(
expect.objectContaining({
items: [
{
isDirectory: false,
path: '/data/backups/.immich',
},
{
isDirectory: false,
path: expect.stringContaining('/data/backups/immich-db-backup-'),
},
],
parent: '/data',
path: '/data/backups',
}),
);
});
});
describe.sequential('Restore Local Backup', async () => {
let cookie: string;
beforeAll(async () => {
await sdk.resetOrchestrator(requestOpts);
await utils.resetDatabase();
socket.disconnect();
await utils.disconnectDatabase();
});
afterAll(async () => {
await utils.connectDatabase();
});
it.sequential(
'restores backup',
async () => {
const { status, headers } = await request(app).post('/admin/database-backups/start-restore').send();
expect(status).toBe(201);
cookie = headers['set-cookie'][0].split(';')[0];
await expect
.poll(
async () => {
const { status, body } = await request(app).get('/server/config');
expect(status).toBe(200);
return body.maintenanceMode;
},
{
interval: 500,
timeout: 10_000,
},
)
.toBeTruthy();
const maintenanceRequestOpts = {
headers: {
cookie,
},
};
await expect(sdk.getSchedules(maintenanceRequestOpts)).resolves.toEqual({ schedules: [] });
await sdk.importRecoveryKey(
{
recoveryKey: '0'.repeat(32),
},
maintenanceRequestOpts,
);
const {
backend: { id: backendId },
} = await sdk.createLocalBackend(
{
path: '/local-backend',
},
maintenanceRequestOpts,
);
const {
repositories: [
{
id: repositoryId,
snapshots: [{ id: snapshotId }],
},
],
} = await sdk.inspectRepositories(maintenanceRequestOpts);
socket = io(baseUrl, {
path: '/api/yucca/socket.io',
transports: ['websocket'],
extraHeaders: {
cookie,
},
});
const event = waitForMessage('TaskEnd');
await sdk.restoreFromPoint(
repositoryId,
snapshotId,
backendId,
{
yuccaConfig: '/yucca',
include: ['/data'],
},
maintenanceRequestOpts,
);
await event;
socket.disconnect();
const { status: restoreStatus } = await request(app).post('/admin/maintenance').set('Cookie', cookie).send({
action: 'restore_database',
restoreBackupFilename: filename,
});
expect(restoreStatus).toBe(201);
await expect
.poll(
async () => {
const { status, body } = await request(app).get('/server/config');
expect(status).toBe(200);
return body.maintenanceMode;
},
{
interval: 500,
timeout: 10_000,
},
)
.toBeTruthy();
const { status: status2, body } = await request(app).get('/admin/maintenance/status');
expect(status2).toBe(200);
expect(body).toEqual(
expect.objectContaining({
active: true,
action: 'restore_database',
}),
);
await expect
.poll(
async () => {
const { status, body } = await request(app).get('/server/config');
expect(status).toBe(200);
return body.maintenanceMode;
},
{
interval: 500,
timeout: 60_000,
},
)
.toBeFalsy();
await expect(sdk.getSchedules(requestOpts)).resolves.toEqual({
schedules: expect.arrayContaining([expect.objectContaining({ id: expect.any(String) })]),
});
},
60_000,
);
});
});

View File

@ -95,6 +95,7 @@ test.describe('Database Backups', () => {
await page.waitForURL('/maintenance**');
}
await page.getByRole('button', { name: 'Database Backup' }).click();
await page.getByRole('button', { name: 'Next' }).click();
await page.getByRole('button', { name: 'Restore', exact: true }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Restore' }).click();

View File

@ -32,6 +32,7 @@ import {
createUserAdmin,
deleteAssets,
deleteDatabaseBackup,
deleteLibrary,
getAssetInfo,
getConfig,
getConfigDefaults,
@ -467,6 +468,8 @@ export const utils = {
updateLibrary: (accessToken: string, id: string, dto: UpdateLibraryDto) =>
updateLibrary({ id, updateLibraryDto: dto }, { headers: asBearerAuth(accessToken) }),
deleteLibrary: (accessToken: string, id: string) => deleteLibrary({ id }, { headers: asBearerAuth(accessToken) }),
createPartner: (accessToken: string, id: string) =>
createPartner({ partnerCreateDto: { sharedWithId: id } }, { headers: asBearerAuth(accessToken) }),
@ -570,6 +573,10 @@ export const utils = {
return executeCommand('docker', ['exec', 'immich-e2e-server', 'mv', source, dest]).promise;
},
async mkdir(path: string) {
return executeCommand('docker', ['exec', 'immich-e2e-server', 'mkdir', '-p', path]).promise;
},
createBackup: async (accessToken: string) => {
await utils.createJob(accessToken, {
name: ManualJobName.BackupDatabase,

View File

@ -119,6 +119,8 @@ Class | Method | HTTP request | Description
*AssetsApi* | [**updateBulkAssetMetadata**](doc//AssetsApi.md#updatebulkassetmetadata) | **PUT** /assets/metadata | Upsert asset metadata
*AssetsApi* | [**uploadAsset**](doc//AssetsApi.md#uploadasset) | **POST** /assets | Upload asset
*AssetsApi* | [**viewAsset**](doc//AssetsApi.md#viewasset) | **GET** /assets/{id}/thumbnail | View asset thumbnail
*AuthApi* | [**oidcAuthorize**](doc//AuthApi.md#oidcauthorize) | **GET** /yucca/auth/oidc/login |
*AuthApi* | [**oidcCallback**](doc//AuthApi.md#oidccallback) | **GET** /yucca/auth/oidc/callback |
*AuthenticationApi* | [**changePassword**](doc//AuthenticationApi.md#changepassword) | **POST** /auth/change-password | Change password
*AuthenticationApi* | [**changePinCode**](doc//AuthenticationApi.md#changepincode) | **PUT** /auth/pin-code | Change pin code
*AuthenticationApi* | [**finishOAuth**](doc//AuthenticationApi.md#finishoauth) | **POST** /oauth/callback | Finish OAuth
@ -136,6 +138,8 @@ Class | Method | HTTP request | Description
*AuthenticationApi* | [**unlockAuthSession**](doc//AuthenticationApi.md#unlockauthsession) | **POST** /auth/session/unlock | Unlock auth session
*AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken | Validate access token
*AuthenticationAdminApi* | [**unlinkAllOAuthAccountsAdmin**](doc//AuthenticationAdminApi.md#unlinkalloauthaccountsadmin) | **POST** /admin/auth/unlink-all | Unlink all OAuth accounts
*BackendApi* | [**createLocalBackend**](doc//BackendApi.md#createlocalbackend) | **POST** /yucca/backend/local |
*BackendApi* | [**getBackends**](doc//BackendApi.md#getbackends) | **GET** /yucca/backend |
*DatabaseBackupsAdminApi* | [**deleteDatabaseBackup**](doc//DatabaseBackupsAdminApi.md#deletedatabasebackup) | **DELETE** /admin/database-backups | Delete database backup
*DatabaseBackupsAdminApi* | [**downloadDatabaseBackup**](doc//DatabaseBackupsAdminApi.md#downloaddatabasebackup) | **GET** /admin/database-backups/{filename} | Download database backup
*DatabaseBackupsAdminApi* | [**listDatabaseBackups**](doc//DatabaseBackupsAdminApi.md#listdatabasebackups) | **GET** /admin/database-backups | List database backups
@ -147,6 +151,7 @@ Class | Method | HTTP request | Description
*DeprecatedApi* | [**getFullSyncForUser**](doc//DeprecatedApi.md#getfullsyncforuser) | **POST** /sync/full-sync | Get full sync for user
*DeprecatedApi* | [**getQueuesLegacy**](doc//DeprecatedApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
*DeprecatedApi* | [**runQueueCommandLegacy**](doc//DeprecatedApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
*DevelopmentApi* | [**resetOrchestrator**](doc//DevelopmentApi.md#resetorchestrator) | **POST** /yucca/debug/reset |
*DownloadApi* | [**downloadArchive**](doc//DownloadApi.md#downloadarchive) | **POST** /download/archive | Download asset archive
*DownloadApi* | [**getDownloadInfo**](doc//DownloadApi.md#getdownloadinfo) | **POST** /download/info | Retrieve download information
*DuplicatesApi* | [**deleteDuplicate**](doc//DuplicatesApi.md#deleteduplicate) | **DELETE** /duplicates/{id} | Delete a duplicate
@ -157,6 +162,9 @@ Class | Method | HTTP request | Description
*FacesApi* | [**deleteFace**](doc//FacesApi.md#deleteface) | **DELETE** /faces/{id} | Delete a face
*FacesApi* | [**getFaces**](doc//FacesApi.md#getfaces) | **GET** /faces | Retrieve faces for asset
*FacesApi* | [**reassignFacesById**](doc//FacesApi.md#reassignfacesbyid) | **PUT** /faces/{id} | Re-assign a face to another person
*FilesystemApi* | [**getFileListing**](doc//FilesystemApi.md#getfilelisting) | **GET** /yucca/fs |
*IntegrationsApi* | [**configureImmichIntegration**](doc//IntegrationsApi.md#configureimmichintegration) | **POST** /yucca/integrations/immich |
*IntegrationsApi* | [**getIntegrations**](doc//IntegrationsApi.md#getintegrations) | **GET** /yucca/integrations |
*JobsApi* | [**createJob**](doc//JobsApi.md#createjob) | **POST** /jobs | Create a manual job
*JobsApi* | [**getQueuesLegacy**](doc//JobsApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
*JobsApi* | [**runQueueCommandLegacy**](doc//JobsApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
@ -191,6 +199,11 @@ Class | Method | HTTP request | Description
*NotificationsAdminApi* | [**createNotification**](doc//NotificationsAdminApi.md#createnotification) | **POST** /admin/notifications | Create a notification
*NotificationsAdminApi* | [**getNotificationTemplateAdmin**](doc//NotificationsAdminApi.md#getnotificationtemplateadmin) | **POST** /admin/notifications/templates/{name} | Render email template
*NotificationsAdminApi* | [**sendTestEmailAdmin**](doc//NotificationsAdminApi.md#sendtestemailadmin) | **POST** /admin/notifications/test-email | Send test email
*OnboardingApi* | [**confirmRecoveryKey**](doc//OnboardingApi.md#confirmrecoverykey) | **POST** /yucca/onboarding/recovery-key |
*OnboardingApi* | [**currentRecoveryKey**](doc//OnboardingApi.md#currentrecoverykey) | **GET** /yucca/onboarding/recovery-key |
*OnboardingApi* | [**importRecoveryKey**](doc//OnboardingApi.md#importrecoverykey) | **PUT** /yucca/onboarding/recovery-key |
*OnboardingApi* | [**onboardingStatus**](doc//OnboardingApi.md#onboardingstatus) | **GET** /yucca/onboarding |
*OnboardingApi* | [**skipOnboardingExtraConfig**](doc//OnboardingApi.md#skiponboardingextraconfig) | **POST** /yucca/onboarding/skip |
*PartnersApi* | [**createPartner**](doc//PartnersApi.md#createpartner) | **POST** /partners | Create a partner
*PartnersApi* | [**createPartnerDeprecated**](doc//PartnersApi.md#createpartnerdeprecated) | **POST** /partners/{id} | Create a partner
*PartnersApi* | [**getPartners**](doc//PartnersApi.md#getpartners) | **GET** /partners | Retrieve partners
@ -215,6 +228,27 @@ Class | Method | HTTP request | Description
*QueuesApi* | [**getQueueJobs**](doc//QueuesApi.md#getqueuejobs) | **GET** /queues/{name}/jobs | Retrieve queue jobs
*QueuesApi* | [**getQueues**](doc//QueuesApi.md#getqueues) | **GET** /queues | List all queues
*QueuesApi* | [**updateQueue**](doc//QueuesApi.md#updatequeue) | **PUT** /queues/{name} | Update a queue
*RepositoryApi* | [**checkImportRepository**](doc//RepositoryApi.md#checkimportrepository) | **GET** /yucca/repository/{id}/import |
*RepositoryApi* | [**createBackup**](doc//RepositoryApi.md#createbackup) | **POST** /yucca/repository/{id} |
*RepositoryApi* | [**createRepository**](doc//RepositoryApi.md#createrepository) | **POST** /yucca/repository |
*RepositoryApi* | [**forgetSnapshot**](doc//RepositoryApi.md#forgetsnapshot) | **DELETE** /yucca/repository/{id}/snapshots/{snapshot} |
*RepositoryApi* | [**getRepositories**](doc//RepositoryApi.md#getrepositories) | **GET** /yucca/repository |
*RepositoryApi* | [**getRunHistory**](doc//RepositoryApi.md#getrunhistory) | **GET** /yucca/repository/{id}/runs |
*RepositoryApi* | [**getSnapshotListing**](doc//RepositoryApi.md#getsnapshotlisting) | **GET** /yucca/repository/{id}/snapshots/{snapshot}/listing |
*RepositoryApi* | [**getSnapshots**](doc//RepositoryApi.md#getsnapshots) | **GET** /yucca/repository/{id}/snapshots |
*RepositoryApi* | [**importRepository**](doc//RepositoryApi.md#importrepository) | **POST** /yucca/repository/{id}/import |
*RepositoryApi* | [**inspectRepositories**](doc//RepositoryApi.md#inspectrepositories) | **GET** /yucca/repository/inspect |
*RepositoryApi* | [**restoreFromPoint**](doc//RepositoryApi.md#restorefrompoint) | **POST** /yucca/repository/{id}/snapshots/{snapshot}/restore-from-point |
*RepositoryApi* | [**restoreSnapshot**](doc//RepositoryApi.md#restoresnapshot) | **POST** /yucca/repository/{id}/snapshots/{snapshot} |
*RepositoryApi* | [**updateRepository**](doc//RepositoryApi.md#updaterepository) | **PATCH** /yucca/repository/{id} |
*RunHistoryApi* | [**logStreamSse**](doc//RunHistoryApi.md#logstreamsse) | **GET** /yucca/logs/{id} |
*RunningTasksApi* | [**getRunningTasks**](doc//RunningTasksApi.md#getrunningtasks) | **GET** /yucca/tasks |
*ScheduleApi* | [**addRepositoryToSchedule**](doc//ScheduleApi.md#addrepositorytoschedule) | **PUT** /yucca/schedule/{id}/{repositoryId} |
*ScheduleApi* | [**createSchedule**](doc//ScheduleApi.md#createschedule) | **POST** /yucca/schedule |
*ScheduleApi* | [**getSchedules**](doc//ScheduleApi.md#getschedules) | **GET** /yucca/schedule |
*ScheduleApi* | [**removeRepositoryFromSchedule**](doc//ScheduleApi.md#removerepositoryfromschedule) | **DELETE** /yucca/schedule/{id}/{repositoryId} |
*ScheduleApi* | [**removeSchedule**](doc//ScheduleApi.md#removeschedule) | **DELETE** /yucca/schedule/{id} |
*ScheduleApi* | [**updateSchedule**](doc//ScheduleApi.md#updateschedule) | **PATCH** /yucca/schedule/{id} |
*SearchApi* | [**getAssetsByCity**](doc//SearchApi.md#getassetsbycity) | **GET** /search/cities | Retrieve assets by city
*SearchApi* | [**getExploreData**](doc//SearchApi.md#getexploredata) | **GET** /search/explore | Retrieve explore data
*SearchApi* | [**getSearchSuggestions**](doc//SearchApi.md#getsearchsuggestions) | **GET** /search/suggestions | Retrieve search suggestions
@ -330,6 +364,7 @@ Class | Method | HTTP request | Description
- [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md)
- [APIKeyResponseDto](doc//APIKeyResponseDto.md)
- [APIKeyUpdateDto](doc//APIKeyUpdateDto.md)
- [ActiveScheduleItemDto](doc//ActiveScheduleItemDto.md)
- [ActivityCreateDto](doc//ActivityCreateDto.md)
- [ActivityResponseDto](doc//ActivityResponseDto.md)
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)
@ -395,6 +430,10 @@ Class | Method | HTTP request | Description
- [AudioCodec](doc//AudioCodec.md)
- [AuthStatusResponseDto](doc//AuthStatusResponseDto.md)
- [AvatarUpdate](doc//AvatarUpdate.md)
- [BackendDto](doc//BackendDto.md)
- [BackendResponseDto](doc//BackendResponseDto.md)
- [BackendType](doc//BackendType.md)
- [BackendsResponseDto](doc//BackendsResponseDto.md)
- [BulkIdErrorReason](doc//BulkIdErrorReason.md)
- [BulkIdResponseDto](doc//BulkIdResponseDto.md)
- [BulkIdsDto](doc//BulkIdsDto.md)
@ -406,11 +445,15 @@ Class | Method | HTTP request | Description
- [CheckExistingAssetsDto](doc//CheckExistingAssetsDto.md)
- [CheckExistingAssetsResponseDto](doc//CheckExistingAssetsResponseDto.md)
- [Colorspace](doc//Colorspace.md)
- [ConfigureImmichIntegrationRequestDto](doc//ConfigureImmichIntegrationRequestDto.md)
- [ConfigureImmichIntegrationRequestDtoLibraries](doc//ConfigureImmichIntegrationRequestDtoLibraries.md)
- [ContributorCountResponseDto](doc//ContributorCountResponseDto.md)
- [CreateAlbumDto](doc//CreateAlbumDto.md)
- [CreateLibraryDto](doc//CreateLibraryDto.md)
- [CreateLocalBackendRequestDto](doc//CreateLocalBackendRequestDto.md)
- [CreateProfileImageResponseDto](doc//CreateProfileImageResponseDto.md)
- [CropParameters](doc//CropParameters.md)
- [CurrentRecoveryKeyResponse](doc//CurrentRecoveryKeyResponse.md)
- [DatabaseBackupConfig](doc//DatabaseBackupConfig.md)
- [DatabaseBackupDeleteDto](doc//DatabaseBackupDeleteDto.md)
- [DatabaseBackupDto](doc//DatabaseBackupDto.md)
@ -430,16 +473,28 @@ Class | Method | HTTP request | Description
- [ExifResponseDto](doc//ExifResponseDto.md)
- [FaceDto](doc//FaceDto.md)
- [FacialRecognitionConfig](doc//FacialRecognitionConfig.md)
- [FilesystemListingItemDto](doc//FilesystemListingItemDto.md)
- [FilesystemListingResponseDto](doc//FilesystemListingResponseDto.md)
- [FoldersResponse](doc//FoldersResponse.md)
- [FoldersUpdate](doc//FoldersUpdate.md)
- [ImageFormat](doc//ImageFormat.md)
- [ImmichIntegrationConfigurationDto](doc//ImmichIntegrationConfigurationDto.md)
- [ImmichIntegrationDto](doc//ImmichIntegrationDto.md)
- [ImmichLibraryDto](doc//ImmichLibraryDto.md)
- [ImmichStateDto](doc//ImmichStateDto.md)
- [ImportRecoveryKeyRequest](doc//ImportRecoveryKeyRequest.md)
- [InspectedLocalRepositoryDto](doc//InspectedLocalRepositoryDto.md)
- [IntegrationsResponseDto](doc//IntegrationsResponseDto.md)
- [JobCreateDto](doc//JobCreateDto.md)
- [JobName](doc//JobName.md)
- [JobSettingsDto](doc//JobSettingsDto.md)
- [LibraryResponseDto](doc//LibraryResponseDto.md)
- [LibraryStatsResponseDto](doc//LibraryStatsResponseDto.md)
- [LicenseKeyDto](doc//LicenseKeyDto.md)
- [ListSnapshotsResponseDto](doc//ListSnapshotsResponseDto.md)
- [LocalRepositoryDto](doc//LocalRepositoryDto.md)
- [LogLevel](doc//LogLevel.md)
- [LogResponseDto](doc//LogResponseDto.md)
- [LoginCredentialDto](doc//LoginCredentialDto.md)
- [LoginResponseDto](doc//LoginResponseDto.md)
- [LogoutResponseDto](doc//LogoutResponseDto.md)
@ -480,6 +535,7 @@ Class | Method | HTTP request | Description
- [OnThisDayDto](doc//OnThisDayDto.md)
- [OnboardingDto](doc//OnboardingDto.md)
- [OnboardingResponseDto](doc//OnboardingResponseDto.md)
- [OnboardingStatusResponseDto](doc//OnboardingStatusResponseDto.md)
- [PartnerCreateDto](doc//PartnerCreateDto.md)
- [PartnerDirection](doc//PartnerDirection.md)
- [PartnerResponseDto](doc//PartnerResponseDto.md)
@ -528,8 +584,32 @@ Class | Method | HTTP request | Description
- [RatingsUpdate](doc//RatingsUpdate.md)
- [ReactionLevel](doc//ReactionLevel.md)
- [ReactionType](doc//ReactionType.md)
- [RepositoryBackendDto](doc//RepositoryBackendDto.md)
- [RepositoryBackendsDto](doc//RepositoryBackendsDto.md)
- [RepositoryCheckImportResponseDto](doc//RepositoryCheckImportResponseDto.md)
- [RepositoryConfigurationDto](doc//RepositoryConfigurationDto.md)
- [RepositoryCreateRequestDto](doc//RepositoryCreateRequestDto.md)
- [RepositoryCreateResponseDto](doc//RepositoryCreateResponseDto.md)
- [RepositoryInspectResponseDto](doc//RepositoryInspectResponseDto.md)
- [RepositoryListResponseDto](doc//RepositoryListResponseDto.md)
- [RepositoryMetricsDto](doc//RepositoryMetricsDto.md)
- [RepositorySnapshotRestoreFromPointRequestDto](doc//RepositorySnapshotRestoreFromPointRequestDto.md)
- [RepositorySnapshotRestoreRequestDto](doc//RepositorySnapshotRestoreRequestDto.md)
- [RepositoryUpdateRequestDto](doc//RepositoryUpdateRequestDto.md)
- [RepositoryUpdateResponseDto](doc//RepositoryUpdateResponseDto.md)
- [ReverseGeocodingStateResponseDto](doc//ReverseGeocodingStateResponseDto.md)
- [RotateParameters](doc//RotateParameters.md)
- [RunDto](doc//RunDto.md)
- [RunHistoryResponseDto](doc//RunHistoryResponseDto.md)
- [RunStatus](doc//RunStatus.md)
- [RunningTaskDto](doc//RunningTaskDto.md)
- [RunningTaskListResponse](doc//RunningTaskListResponse.md)
- [ScheduleCreateRequestDto](doc//ScheduleCreateRequestDto.md)
- [ScheduleCreateResponseDto](doc//ScheduleCreateResponseDto.md)
- [ScheduleDto](doc//ScheduleDto.md)
- [ScheduleListResponseDto](doc//ScheduleListResponseDto.md)
- [ScheduleUpdateRequestDto](doc//ScheduleUpdateRequestDto.md)
- [ScheduleUpdateResponseDto](doc//ScheduleUpdateResponseDto.md)
- [SearchAlbumResponseDto](doc//SearchAlbumResponseDto.md)
- [SearchAssetResponseDto](doc//SearchAssetResponseDto.md)
- [SearchExploreItem](doc//SearchExploreItem.md)
@ -565,6 +645,7 @@ Class | Method | HTTP request | Description
- [SharedLinksUpdate](doc//SharedLinksUpdate.md)
- [SignUpDto](doc//SignUpDto.md)
- [SmartSearchDto](doc//SmartSearchDto.md)
- [SnapshotDto](doc//SnapshotDto.md)
- [SourceType](doc//SourceType.md)
- [StackCreateDto](doc//StackCreateDto.md)
- [StackResponseDto](doc//StackResponseDto.md)
@ -647,6 +728,8 @@ Class | Method | HTTP request | Description
- [TagUpsertDto](doc//TagUpsertDto.md)
- [TagsResponse](doc//TagsResponse.md)
- [TagsUpdate](doc//TagsUpdate.md)
- [TaskStatus](doc//TaskStatus.md)
- [TaskType](doc//TaskType.md)
- [TemplateDto](doc//TemplateDto.md)
- [TemplateResponseDto](doc//TemplateResponseDto.md)
- [TestEmailResponseDto](doc//TestEmailResponseDto.md)

View File

@ -34,13 +34,18 @@ part 'api/api_keys_api.dart';
part 'api/activities_api.dart';
part 'api/albums_api.dart';
part 'api/assets_api.dart';
part 'api/auth_api.dart';
part 'api/authentication_api.dart';
part 'api/authentication_admin_api.dart';
part 'api/backend_api.dart';
part 'api/database_backups_admin_api.dart';
part 'api/deprecated_api.dart';
part 'api/development_api.dart';
part 'api/download_api.dart';
part 'api/duplicates_api.dart';
part 'api/faces_api.dart';
part 'api/filesystem_api.dart';
part 'api/integrations_api.dart';
part 'api/jobs_api.dart';
part 'api/libraries_api.dart';
part 'api/maintenance_admin_api.dart';
@ -48,10 +53,15 @@ part 'api/map_api.dart';
part 'api/memories_api.dart';
part 'api/notifications_api.dart';
part 'api/notifications_admin_api.dart';
part 'api/onboarding_api.dart';
part 'api/partners_api.dart';
part 'api/people_api.dart';
part 'api/plugins_api.dart';
part 'api/queues_api.dart';
part 'api/repository_api.dart';
part 'api/run_history_api.dart';
part 'api/running_tasks_api.dart';
part 'api/schedule_api.dart';
part 'api/search_api.dart';
part 'api/server_api.dart';
part 'api/sessions_api.dart';
@ -72,6 +82,7 @@ part 'model/api_key_create_dto.dart';
part 'model/api_key_create_response_dto.dart';
part 'model/api_key_response_dto.dart';
part 'model/api_key_update_dto.dart';
part 'model/active_schedule_item_dto.dart';
part 'model/activity_create_dto.dart';
part 'model/activity_response_dto.dart';
part 'model/activity_statistics_response_dto.dart';
@ -137,6 +148,10 @@ part 'model/asset_visibility.dart';
part 'model/audio_codec.dart';
part 'model/auth_status_response_dto.dart';
part 'model/avatar_update.dart';
part 'model/backend_dto.dart';
part 'model/backend_response_dto.dart';
part 'model/backend_type.dart';
part 'model/backends_response_dto.dart';
part 'model/bulk_id_error_reason.dart';
part 'model/bulk_id_response_dto.dart';
part 'model/bulk_ids_dto.dart';
@ -148,11 +163,15 @@ part 'model/change_password_dto.dart';
part 'model/check_existing_assets_dto.dart';
part 'model/check_existing_assets_response_dto.dart';
part 'model/colorspace.dart';
part 'model/configure_immich_integration_request_dto.dart';
part 'model/configure_immich_integration_request_dto_libraries.dart';
part 'model/contributor_count_response_dto.dart';
part 'model/create_album_dto.dart';
part 'model/create_library_dto.dart';
part 'model/create_local_backend_request_dto.dart';
part 'model/create_profile_image_response_dto.dart';
part 'model/crop_parameters.dart';
part 'model/current_recovery_key_response.dart';
part 'model/database_backup_config.dart';
part 'model/database_backup_delete_dto.dart';
part 'model/database_backup_dto.dart';
@ -172,16 +191,28 @@ part 'model/email_notifications_update.dart';
part 'model/exif_response_dto.dart';
part 'model/face_dto.dart';
part 'model/facial_recognition_config.dart';
part 'model/filesystem_listing_item_dto.dart';
part 'model/filesystem_listing_response_dto.dart';
part 'model/folders_response.dart';
part 'model/folders_update.dart';
part 'model/image_format.dart';
part 'model/immich_integration_configuration_dto.dart';
part 'model/immich_integration_dto.dart';
part 'model/immich_library_dto.dart';
part 'model/immich_state_dto.dart';
part 'model/import_recovery_key_request.dart';
part 'model/inspected_local_repository_dto.dart';
part 'model/integrations_response_dto.dart';
part 'model/job_create_dto.dart';
part 'model/job_name.dart';
part 'model/job_settings_dto.dart';
part 'model/library_response_dto.dart';
part 'model/library_stats_response_dto.dart';
part 'model/license_key_dto.dart';
part 'model/list_snapshots_response_dto.dart';
part 'model/local_repository_dto.dart';
part 'model/log_level.dart';
part 'model/log_response_dto.dart';
part 'model/login_credential_dto.dart';
part 'model/login_response_dto.dart';
part 'model/logout_response_dto.dart';
@ -222,6 +253,7 @@ part 'model/ocr_config.dart';
part 'model/on_this_day_dto.dart';
part 'model/onboarding_dto.dart';
part 'model/onboarding_response_dto.dart';
part 'model/onboarding_status_response_dto.dart';
part 'model/partner_create_dto.dart';
part 'model/partner_direction.dart';
part 'model/partner_response_dto.dart';
@ -270,8 +302,32 @@ part 'model/ratings_response.dart';
part 'model/ratings_update.dart';
part 'model/reaction_level.dart';
part 'model/reaction_type.dart';
part 'model/repository_backend_dto.dart';
part 'model/repository_backends_dto.dart';
part 'model/repository_check_import_response_dto.dart';
part 'model/repository_configuration_dto.dart';
part 'model/repository_create_request_dto.dart';
part 'model/repository_create_response_dto.dart';
part 'model/repository_inspect_response_dto.dart';
part 'model/repository_list_response_dto.dart';
part 'model/repository_metrics_dto.dart';
part 'model/repository_snapshot_restore_from_point_request_dto.dart';
part 'model/repository_snapshot_restore_request_dto.dart';
part 'model/repository_update_request_dto.dart';
part 'model/repository_update_response_dto.dart';
part 'model/reverse_geocoding_state_response_dto.dart';
part 'model/rotate_parameters.dart';
part 'model/run_dto.dart';
part 'model/run_history_response_dto.dart';
part 'model/run_status.dart';
part 'model/running_task_dto.dart';
part 'model/running_task_list_response.dart';
part 'model/schedule_create_request_dto.dart';
part 'model/schedule_create_response_dto.dart';
part 'model/schedule_dto.dart';
part 'model/schedule_list_response_dto.dart';
part 'model/schedule_update_request_dto.dart';
part 'model/schedule_update_response_dto.dart';
part 'model/search_album_response_dto.dart';
part 'model/search_asset_response_dto.dart';
part 'model/search_explore_item.dart';
@ -307,6 +363,7 @@ part 'model/shared_links_response.dart';
part 'model/shared_links_update.dart';
part 'model/sign_up_dto.dart';
part 'model/smart_search_dto.dart';
part 'model/snapshot_dto.dart';
part 'model/source_type.dart';
part 'model/stack_create_dto.dart';
part 'model/stack_response_dto.dart';
@ -389,6 +446,8 @@ part 'model/tag_update_dto.dart';
part 'model/tag_upsert_dto.dart';
part 'model/tags_response.dart';
part 'model/tags_update.dart';
part 'model/task_status.dart';
part 'model/task_type.dart';
part 'model/template_dto.dart';
part 'model/template_response_dto.dart';
part 'model/test_email_response_dto.dart';

92
mobile/openapi/lib/api/auth_api.dart generated Normal file
View File

@ -0,0 +1,92 @@
//
// 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 AuthApi {
AuthApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /yucca/auth/oidc/login' operation and returns the [Response].
/// Parameters:
///
/// * [String] next (required):
Future<Response> oidcAuthorizeWithHttpInfo(String next,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/auth/oidc/login';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'next', next));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] next (required):
Future<void> oidcAuthorize(String next,) async {
final response = await oidcAuthorizeWithHttpInfo(next,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'GET /yucca/auth/oidc/callback' operation and returns the [Response].
Future<Response> oidcCallbackWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/auth/oidc/callback';
// 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,
);
}
Future<void> oidcCallback() async {
final response = await oidcCallbackWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}

106
mobile/openapi/lib/api/backend_api.dart generated Normal file
View File

@ -0,0 +1,106 @@
//
// 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 BackendApi {
BackendApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /yucca/backend/local' operation and returns the [Response].
/// Parameters:
///
/// * [CreateLocalBackendRequestDto] createLocalBackendRequestDto (required):
Future<Response> createLocalBackendWithHttpInfo(CreateLocalBackendRequestDto createLocalBackendRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/backend/local';
// ignore: prefer_final_locals
Object? postBody = createLocalBackendRequestDto;
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,
);
}
/// Parameters:
///
/// * [CreateLocalBackendRequestDto] createLocalBackendRequestDto (required):
Future<BackendResponseDto?> createLocalBackend(CreateLocalBackendRequestDto createLocalBackendRequestDto,) async {
final response = await createLocalBackendWithHttpInfo(createLocalBackendRequestDto,);
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), 'BackendResponseDto',) as BackendResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/backend' operation and returns the [Response].
Future<Response> getBackendsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/backend';
// 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,
);
}
Future<BackendsResponseDto?> getBackends() async {
final response = await getBackendsWithHttpInfo();
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), 'BackendsResponseDto',) as BackendsResponseDto;
}
return null;
}
}

View File

@ -0,0 +1,51 @@
//
// 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 DevelopmentApi {
DevelopmentApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /yucca/debug/reset' operation and returns the [Response].
Future<Response> resetOrchestratorWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/debug/reset';
// 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,
);
}
Future<void> resetOrchestrator() async {
final response = await resetOrchestratorWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}

View File

@ -0,0 +1,69 @@
//
// 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 FilesystemApi {
FilesystemApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /yucca/fs' operation and returns the [Response].
/// Parameters:
///
/// * [String] path:
Future<Response> getFileListingWithHttpInfo({ String? path, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/fs';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (path != null) {
queryParams.addAll(_queryParams('', 'path', path));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] path:
Future<FilesystemListingResponseDto?> getFileListing({ String? path, }) async {
final response = await getFileListingWithHttpInfo( path: path, );
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), 'FilesystemListingResponseDto',) as FilesystemListingResponseDto;
}
return null;
}
}

View File

@ -0,0 +1,98 @@
//
// 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 IntegrationsApi {
IntegrationsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /yucca/integrations/immich' operation and returns the [Response].
/// Parameters:
///
/// * [ConfigureImmichIntegrationRequestDto] configureImmichIntegrationRequestDto (required):
Future<Response> configureImmichIntegrationWithHttpInfo(ConfigureImmichIntegrationRequestDto configureImmichIntegrationRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/integrations/immich';
// ignore: prefer_final_locals
Object? postBody = configureImmichIntegrationRequestDto;
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,
);
}
/// Parameters:
///
/// * [ConfigureImmichIntegrationRequestDto] configureImmichIntegrationRequestDto (required):
Future<void> configureImmichIntegration(ConfigureImmichIntegrationRequestDto configureImmichIntegrationRequestDto,) async {
final response = await configureImmichIntegrationWithHttpInfo(configureImmichIntegrationRequestDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'GET /yucca/integrations' operation and returns the [Response].
Future<Response> getIntegrationsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/integrations';
// 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,
);
}
Future<IntegrationsResponseDto?> getIntegrations() async {
final response = await getIntegrationsWithHttpInfo();
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), 'IntegrationsResponseDto',) as IntegrationsResponseDto;
}
return null;
}
}

205
mobile/openapi/lib/api/onboarding_api.dart generated Normal file
View File

@ -0,0 +1,205 @@
//
// 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 OnboardingApi {
OnboardingApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /yucca/onboarding/recovery-key' operation and returns the [Response].
Future<Response> confirmRecoveryKeyWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/onboarding/recovery-key';
// 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,
);
}
Future<void> confirmRecoveryKey() async {
final response = await confirmRecoveryKeyWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'GET /yucca/onboarding/recovery-key' operation and returns the [Response].
Future<Response> currentRecoveryKeyWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/onboarding/recovery-key';
// 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,
);
}
Future<CurrentRecoveryKeyResponse?> currentRecoveryKey() async {
final response = await currentRecoveryKeyWithHttpInfo();
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), 'CurrentRecoveryKeyResponse',) as CurrentRecoveryKeyResponse;
}
return null;
}
/// Performs an HTTP 'PUT /yucca/onboarding/recovery-key' operation and returns the [Response].
/// Parameters:
///
/// * [ImportRecoveryKeyRequest] importRecoveryKeyRequest (required):
Future<Response> importRecoveryKeyWithHttpInfo(ImportRecoveryKeyRequest importRecoveryKeyRequest,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/onboarding/recovery-key';
// ignore: prefer_final_locals
Object? postBody = importRecoveryKeyRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ImportRecoveryKeyRequest] importRecoveryKeyRequest (required):
Future<void> importRecoveryKey(ImportRecoveryKeyRequest importRecoveryKeyRequest,) async {
final response = await importRecoveryKeyWithHttpInfo(importRecoveryKeyRequest,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'GET /yucca/onboarding' operation and returns the [Response].
Future<Response> onboardingStatusWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/onboarding';
// 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,
);
}
Future<OnboardingStatusResponseDto?> onboardingStatus() async {
final response = await onboardingStatusWithHttpInfo();
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), 'OnboardingStatusResponseDto',) as OnboardingStatusResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/onboarding/skip' operation and returns the [Response].
Future<Response> skipOnboardingExtraConfigWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/onboarding/skip';
// 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,
);
}
Future<void> skipOnboardingExtraConfig() async {
final response = await skipOnboardingExtraConfigWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}

701
mobile/openapi/lib/api/repository_api.dart generated Normal file
View File

@ -0,0 +1,701 @@
//
// 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 RepositoryApi {
RepositoryApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /yucca/repository/{id}/import' operation and returns the [Response].
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
Future<Response> checkImportRepositoryWithHttpInfo(String backend, String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/import'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'backend', backend));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
Future<RepositoryCheckImportResponseDto?> checkImportRepository(String backend, String id,) async {
final response = await checkImportRepositoryWithHttpInfo(backend, id,);
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), 'RepositoryCheckImportResponseDto',) as RepositoryCheckImportResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/repository/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> createBackupWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}'
.replaceAll('{id}', id);
// 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,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<LogResponseDto?> createBackup(String id,) async {
final response = await createBackupWithHttpInfo(id,);
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), 'LogResponseDto',) as LogResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/repository' operation and returns the [Response].
/// Parameters:
///
/// * [RepositoryCreateRequestDto] repositoryCreateRequestDto (required):
///
/// * [String] backend:
Future<Response> createRepositoryWithHttpInfo(RepositoryCreateRequestDto repositoryCreateRequestDto, { String? backend, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository';
// ignore: prefer_final_locals
Object? postBody = repositoryCreateRequestDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (backend != null) {
queryParams.addAll(_queryParams('', 'backend', backend));
}
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [RepositoryCreateRequestDto] repositoryCreateRequestDto (required):
///
/// * [String] backend:
Future<RepositoryCreateResponseDto?> createRepository(RepositoryCreateRequestDto repositoryCreateRequestDto, { String? backend, }) async {
final response = await createRepositoryWithHttpInfo(repositoryCreateRequestDto, backend: backend, );
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), 'RepositoryCreateResponseDto',) as RepositoryCreateResponseDto;
}
return null;
}
/// Performs an HTTP 'DELETE /yucca/repository/{id}/snapshots/{snapshot}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
Future<Response> forgetSnapshotWithHttpInfo(String id, String snapshot,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}'
.replaceAll('{id}', id)
.replaceAll('{snapshot}', snapshot);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
Future<ListSnapshotsResponseDto?> forgetSnapshot(String id, String snapshot,) async {
final response = await forgetSnapshotWithHttpInfo(id, snapshot,);
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), 'ListSnapshotsResponseDto',) as ListSnapshotsResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/repository' operation and returns the [Response].
Future<Response> getRepositoriesWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository';
// 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,
);
}
Future<RepositoryListResponseDto?> getRepositories() async {
final response = await getRepositoriesWithHttpInfo();
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), 'RepositoryListResponseDto',) as RepositoryListResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/repository/{id}/runs' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> getRunHistoryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/runs'
.replaceAll('{id}', id);
// 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,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<RunHistoryResponseDto?> getRunHistory(String id,) async {
final response = await getRunHistoryWithHttpInfo(id,);
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), 'RunHistoryResponseDto',) as RunHistoryResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/repository/{id}/snapshots/{snapshot}/listing' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [String] path:
Future<Response> getSnapshotListingWithHttpInfo(String id, String snapshot, { String? path, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}/listing'
.replaceAll('{id}', id)
.replaceAll('{snapshot}', snapshot);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (path != null) {
queryParams.addAll(_queryParams('', 'path', path));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [String] path:
Future<FilesystemListingResponseDto?> getSnapshotListing(String id, String snapshot, { String? path, }) async {
final response = await getSnapshotListingWithHttpInfo(id, snapshot, path: path, );
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), 'FilesystemListingResponseDto',) as FilesystemListingResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/repository/{id}/snapshots' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> getSnapshotsWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots'
.replaceAll('{id}', id);
// 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,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ListSnapshotsResponseDto?> getSnapshots(String id,) async {
final response = await getSnapshotsWithHttpInfo(id,);
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), 'ListSnapshotsResponseDto',) as ListSnapshotsResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/repository/{id}/import' operation and returns the [Response].
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
Future<Response> importRepositoryWithHttpInfo(String backend, String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/import'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'backend', backend));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
Future<RepositoryCreateResponseDto?> importRepository(String backend, String id,) async {
final response = await importRepositoryWithHttpInfo(backend, id,);
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), 'RepositoryCreateResponseDto',) as RepositoryCreateResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/repository/inspect' operation and returns the [Response].
Future<Response> inspectRepositoriesWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/inspect';
// 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,
);
}
Future<RepositoryInspectResponseDto?> inspectRepositories() async {
final response = await inspectRepositoriesWithHttpInfo();
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), 'RepositoryInspectResponseDto',) as RepositoryInspectResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/repository/{id}/snapshots/{snapshot}/restore-from-point' operation and returns the [Response].
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [RepositorySnapshotRestoreFromPointRequestDto] repositorySnapshotRestoreFromPointRequestDto (required):
Future<Response> restoreFromPointWithHttpInfo(String backend, String id, String snapshot, RepositorySnapshotRestoreFromPointRequestDto repositorySnapshotRestoreFromPointRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}/restore-from-point'
.replaceAll('{id}', id)
.replaceAll('{snapshot}', snapshot);
// ignore: prefer_final_locals
Object? postBody = repositorySnapshotRestoreFromPointRequestDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'backend', backend));
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] backend (required):
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [RepositorySnapshotRestoreFromPointRequestDto] repositorySnapshotRestoreFromPointRequestDto (required):
Future<LogResponseDto?> restoreFromPoint(String backend, String id, String snapshot, RepositorySnapshotRestoreFromPointRequestDto repositorySnapshotRestoreFromPointRequestDto,) async {
final response = await restoreFromPointWithHttpInfo(backend, id, snapshot, repositorySnapshotRestoreFromPointRequestDto,);
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), 'LogResponseDto',) as LogResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /yucca/repository/{id}/snapshots/{snapshot}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [RepositorySnapshotRestoreRequestDto] repositorySnapshotRestoreRequestDto (required):
Future<Response> restoreSnapshotWithHttpInfo(String id, String snapshot, RepositorySnapshotRestoreRequestDto repositorySnapshotRestoreRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots/{snapshot}'
.replaceAll('{id}', id)
.replaceAll('{snapshot}', snapshot);
// ignore: prefer_final_locals
Object? postBody = repositorySnapshotRestoreRequestDto;
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,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] snapshot (required):
///
/// * [RepositorySnapshotRestoreRequestDto] repositorySnapshotRestoreRequestDto (required):
Future<LogResponseDto?> restoreSnapshot(String id, String snapshot, RepositorySnapshotRestoreRequestDto repositorySnapshotRestoreRequestDto,) async {
final response = await restoreSnapshotWithHttpInfo(id, snapshot, repositorySnapshotRestoreRequestDto,);
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), 'LogResponseDto',) as LogResponseDto;
}
return null;
}
/// Performs an HTTP 'PATCH /yucca/repository/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [RepositoryUpdateRequestDto] repositoryUpdateRequestDto (required):
///
/// * [String] backend:
Future<Response> updateRepositoryWithHttpInfo(String id, RepositoryUpdateRequestDto repositoryUpdateRequestDto, { String? backend, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = repositoryUpdateRequestDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (backend != null) {
queryParams.addAll(_queryParams('', 'backend', backend));
}
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [RepositoryUpdateRequestDto] repositoryUpdateRequestDto (required):
///
/// * [String] backend:
Future<RepositoryUpdateResponseDto?> updateRepository(String id, RepositoryUpdateRequestDto repositoryUpdateRequestDto, { String? backend, }) async {
final response = await updateRepositoryWithHttpInfo(id, repositoryUpdateRequestDto, backend: backend, );
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), 'RepositoryUpdateResponseDto',) as RepositoryUpdateResponseDto;
}
return null;
}
}

View File

@ -0,0 +1,58 @@
//
// 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 RunHistoryApi {
RunHistoryApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /yucca/logs/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> logStreamSseWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/logs/{id}'
.replaceAll('{id}', id);
// 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,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<void> logStreamSse(String id,) async {
final response = await logStreamSseWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}

View File

@ -0,0 +1,59 @@
//
// 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 RunningTasksApi {
RunningTasksApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /yucca/tasks' operation and returns the [Response].
Future<Response> getRunningTasksWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/tasks';
// 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,
);
}
Future<RunningTaskListResponse?> getRunningTasks() async {
final response = await getRunningTasksWithHttpInfo();
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), 'RunningTaskListResponse',) as RunningTaskListResponse;
}
return null;
}
}

288
mobile/openapi/lib/api/schedule_api.dart generated Normal file
View File

@ -0,0 +1,288 @@
//
// 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 ScheduleApi {
ScheduleApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'PUT /yucca/schedule/{id}/{repositoryId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] repositoryId (required):
Future<Response> addRepositoryToScheduleWithHttpInfo(String id, String repositoryId,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule/{id}/{repositoryId}'
.replaceAll('{id}', id)
.replaceAll('{repositoryId}', repositoryId);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] repositoryId (required):
Future<void> addRepositoryToSchedule(String id, String repositoryId,) async {
final response = await addRepositoryToScheduleWithHttpInfo(id, repositoryId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'POST /yucca/schedule' operation and returns the [Response].
/// Parameters:
///
/// * [ScheduleCreateRequestDto] scheduleCreateRequestDto (required):
Future<Response> createScheduleWithHttpInfo(ScheduleCreateRequestDto scheduleCreateRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule';
// ignore: prefer_final_locals
Object? postBody = scheduleCreateRequestDto;
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,
);
}
/// Parameters:
///
/// * [ScheduleCreateRequestDto] scheduleCreateRequestDto (required):
Future<ScheduleCreateResponseDto?> createSchedule(ScheduleCreateRequestDto scheduleCreateRequestDto,) async {
final response = await createScheduleWithHttpInfo(scheduleCreateRequestDto,);
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), 'ScheduleCreateResponseDto',) as ScheduleCreateResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/schedule' operation and returns the [Response].
Future<Response> getSchedulesWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule';
// 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,
);
}
Future<ScheduleListResponseDto?> getSchedules() async {
final response = await getSchedulesWithHttpInfo();
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), 'ScheduleListResponseDto',) as ScheduleListResponseDto;
}
return null;
}
/// Performs an HTTP 'DELETE /yucca/schedule/{id}/{repositoryId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] repositoryId (required):
Future<Response> removeRepositoryFromScheduleWithHttpInfo(String id, String repositoryId,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule/{id}/{repositoryId}'
.replaceAll('{id}', id)
.replaceAll('{repositoryId}', repositoryId);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] repositoryId (required):
Future<void> removeRepositoryFromSchedule(String id, String repositoryId,) async {
final response = await removeRepositoryFromScheduleWithHttpInfo(id, repositoryId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'DELETE /yucca/schedule/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> removeScheduleWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<void> removeSchedule(String id,) async {
final response = await removeScheduleWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'PATCH /yucca/schedule/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [ScheduleUpdateRequestDto] scheduleUpdateRequestDto (required):
Future<Response> updateScheduleWithHttpInfo(String id, ScheduleUpdateRequestDto scheduleUpdateRequestDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/schedule/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = scheduleUpdateRequestDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [ScheduleUpdateRequestDto] scheduleUpdateRequestDto (required):
Future<ScheduleUpdateResponseDto?> updateSchedule(String id, ScheduleUpdateRequestDto scheduleUpdateRequestDto,) async {
final response = await updateScheduleWithHttpInfo(id, scheduleUpdateRequestDto,);
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), 'ScheduleUpdateResponseDto',) as ScheduleUpdateResponseDto;
}
return null;
}
}

View File

@ -190,6 +190,8 @@ class ApiClient {
return APIKeyResponseDto.fromJson(value);
case 'APIKeyUpdateDto':
return APIKeyUpdateDto.fromJson(value);
case 'ActiveScheduleItemDto':
return ActiveScheduleItemDto.fromJson(value);
case 'ActivityCreateDto':
return ActivityCreateDto.fromJson(value);
case 'ActivityResponseDto':
@ -320,6 +322,14 @@ class ApiClient {
return AuthStatusResponseDto.fromJson(value);
case 'AvatarUpdate':
return AvatarUpdate.fromJson(value);
case 'BackendDto':
return BackendDto.fromJson(value);
case 'BackendResponseDto':
return BackendResponseDto.fromJson(value);
case 'BackendType':
return BackendTypeTypeTransformer().decode(value);
case 'BackendsResponseDto':
return BackendsResponseDto.fromJson(value);
case 'BulkIdErrorReason':
return BulkIdErrorReasonTypeTransformer().decode(value);
case 'BulkIdResponseDto':
@ -342,16 +352,24 @@ class ApiClient {
return CheckExistingAssetsResponseDto.fromJson(value);
case 'Colorspace':
return ColorspaceTypeTransformer().decode(value);
case 'ConfigureImmichIntegrationRequestDto':
return ConfigureImmichIntegrationRequestDto.fromJson(value);
case 'ConfigureImmichIntegrationRequestDtoLibraries':
return ConfigureImmichIntegrationRequestDtoLibraries.fromJson(value);
case 'ContributorCountResponseDto':
return ContributorCountResponseDto.fromJson(value);
case 'CreateAlbumDto':
return CreateAlbumDto.fromJson(value);
case 'CreateLibraryDto':
return CreateLibraryDto.fromJson(value);
case 'CreateLocalBackendRequestDto':
return CreateLocalBackendRequestDto.fromJson(value);
case 'CreateProfileImageResponseDto':
return CreateProfileImageResponseDto.fromJson(value);
case 'CropParameters':
return CropParameters.fromJson(value);
case 'CurrentRecoveryKeyResponse':
return CurrentRecoveryKeyResponse.fromJson(value);
case 'DatabaseBackupConfig':
return DatabaseBackupConfig.fromJson(value);
case 'DatabaseBackupDeleteDto':
@ -390,12 +408,30 @@ class ApiClient {
return FaceDto.fromJson(value);
case 'FacialRecognitionConfig':
return FacialRecognitionConfig.fromJson(value);
case 'FilesystemListingItemDto':
return FilesystemListingItemDto.fromJson(value);
case 'FilesystemListingResponseDto':
return FilesystemListingResponseDto.fromJson(value);
case 'FoldersResponse':
return FoldersResponse.fromJson(value);
case 'FoldersUpdate':
return FoldersUpdate.fromJson(value);
case 'ImageFormat':
return ImageFormatTypeTransformer().decode(value);
case 'ImmichIntegrationConfigurationDto':
return ImmichIntegrationConfigurationDto.fromJson(value);
case 'ImmichIntegrationDto':
return ImmichIntegrationDto.fromJson(value);
case 'ImmichLibraryDto':
return ImmichLibraryDto.fromJson(value);
case 'ImmichStateDto':
return ImmichStateDto.fromJson(value);
case 'ImportRecoveryKeyRequest':
return ImportRecoveryKeyRequest.fromJson(value);
case 'InspectedLocalRepositoryDto':
return InspectedLocalRepositoryDto.fromJson(value);
case 'IntegrationsResponseDto':
return IntegrationsResponseDto.fromJson(value);
case 'JobCreateDto':
return JobCreateDto.fromJson(value);
case 'JobName':
@ -408,8 +444,14 @@ class ApiClient {
return LibraryStatsResponseDto.fromJson(value);
case 'LicenseKeyDto':
return LicenseKeyDto.fromJson(value);
case 'ListSnapshotsResponseDto':
return ListSnapshotsResponseDto.fromJson(value);
case 'LocalRepositoryDto':
return LocalRepositoryDto.fromJson(value);
case 'LogLevel':
return LogLevelTypeTransformer().decode(value);
case 'LogResponseDto':
return LogResponseDto.fromJson(value);
case 'LoginCredentialDto':
return LoginCredentialDto.fromJson(value);
case 'LoginResponseDto':
@ -490,6 +532,8 @@ class ApiClient {
return OnboardingDto.fromJson(value);
case 'OnboardingResponseDto':
return OnboardingResponseDto.fromJson(value);
case 'OnboardingStatusResponseDto':
return OnboardingStatusResponseDto.fromJson(value);
case 'PartnerCreateDto':
return PartnerCreateDto.fromJson(value);
case 'PartnerDirection':
@ -586,10 +630,58 @@ class ApiClient {
return ReactionLevelTypeTransformer().decode(value);
case 'ReactionType':
return ReactionTypeTypeTransformer().decode(value);
case 'RepositoryBackendDto':
return RepositoryBackendDto.fromJson(value);
case 'RepositoryBackendsDto':
return RepositoryBackendsDto.fromJson(value);
case 'RepositoryCheckImportResponseDto':
return RepositoryCheckImportResponseDto.fromJson(value);
case 'RepositoryConfigurationDto':
return RepositoryConfigurationDto.fromJson(value);
case 'RepositoryCreateRequestDto':
return RepositoryCreateRequestDto.fromJson(value);
case 'RepositoryCreateResponseDto':
return RepositoryCreateResponseDto.fromJson(value);
case 'RepositoryInspectResponseDto':
return RepositoryInspectResponseDto.fromJson(value);
case 'RepositoryListResponseDto':
return RepositoryListResponseDto.fromJson(value);
case 'RepositoryMetricsDto':
return RepositoryMetricsDto.fromJson(value);
case 'RepositorySnapshotRestoreFromPointRequestDto':
return RepositorySnapshotRestoreFromPointRequestDto.fromJson(value);
case 'RepositorySnapshotRestoreRequestDto':
return RepositorySnapshotRestoreRequestDto.fromJson(value);
case 'RepositoryUpdateRequestDto':
return RepositoryUpdateRequestDto.fromJson(value);
case 'RepositoryUpdateResponseDto':
return RepositoryUpdateResponseDto.fromJson(value);
case 'ReverseGeocodingStateResponseDto':
return ReverseGeocodingStateResponseDto.fromJson(value);
case 'RotateParameters':
return RotateParameters.fromJson(value);
case 'RunDto':
return RunDto.fromJson(value);
case 'RunHistoryResponseDto':
return RunHistoryResponseDto.fromJson(value);
case 'RunStatus':
return RunStatusTypeTransformer().decode(value);
case 'RunningTaskDto':
return RunningTaskDto.fromJson(value);
case 'RunningTaskListResponse':
return RunningTaskListResponse.fromJson(value);
case 'ScheduleCreateRequestDto':
return ScheduleCreateRequestDto.fromJson(value);
case 'ScheduleCreateResponseDto':
return ScheduleCreateResponseDto.fromJson(value);
case 'ScheduleDto':
return ScheduleDto.fromJson(value);
case 'ScheduleListResponseDto':
return ScheduleListResponseDto.fromJson(value);
case 'ScheduleUpdateRequestDto':
return ScheduleUpdateRequestDto.fromJson(value);
case 'ScheduleUpdateResponseDto':
return ScheduleUpdateResponseDto.fromJson(value);
case 'SearchAlbumResponseDto':
return SearchAlbumResponseDto.fromJson(value);
case 'SearchAssetResponseDto':
@ -660,6 +752,8 @@ class ApiClient {
return SignUpDto.fromJson(value);
case 'SmartSearchDto':
return SmartSearchDto.fromJson(value);
case 'SnapshotDto':
return SnapshotDto.fromJson(value);
case 'SourceType':
return SourceTypeTypeTransformer().decode(value);
case 'StackCreateDto':
@ -824,6 +918,10 @@ class ApiClient {
return TagsResponse.fromJson(value);
case 'TagsUpdate':
return TagsUpdate.fromJson(value);
case 'TaskStatus':
return TaskStatusTypeTransformer().decode(value);
case 'TaskType':
return TaskTypeTypeTransformer().decode(value);
case 'TemplateDto':
return TemplateDto.fromJson(value);
case 'TemplateResponseDto':

View File

@ -91,6 +91,9 @@ String parameterToString(dynamic value) {
if (value is AudioCodec) {
return AudioCodecTypeTransformer().encode(value).toString();
}
if (value is BackendType) {
return BackendTypeTypeTransformer().encode(value).toString();
}
if (value is BulkIdErrorReason) {
return BulkIdErrorReasonTypeTransformer().encode(value).toString();
}
@ -163,6 +166,9 @@ String parameterToString(dynamic value) {
if (value is ReactionType) {
return ReactionTypeTypeTransformer().encode(value).toString();
}
if (value is RunStatus) {
return RunStatusTypeTransformer().encode(value).toString();
}
if (value is SearchSuggestionType) {
return SearchSuggestionTypeTypeTransformer().encode(value).toString();
}
@ -181,6 +187,12 @@ String parameterToString(dynamic value) {
if (value is SyncRequestType) {
return SyncRequestTypeTypeTransformer().encode(value).toString();
}
if (value is TaskStatus) {
return TaskStatusTypeTransformer().encode(value).toString();
}
if (value is TaskType) {
return TaskTypeTypeTransformer().encode(value).toString();
}
if (value is ToneMapping) {
return ToneMappingTypeTransformer().encode(value).toString();
}

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 ActiveScheduleItemDto {
/// Returns a new [ActiveScheduleItemDto] instance.
ActiveScheduleItemDto({
required this.repositoryId,
required this.status,
});
String repositoryId;
TaskStatus status;
@override
bool operator ==(Object other) => identical(this, other) || other is ActiveScheduleItemDto &&
other.repositoryId == repositoryId &&
other.status == status;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(repositoryId.hashCode) +
(status.hashCode);
@override
String toString() => 'ActiveScheduleItemDto[repositoryId=$repositoryId, status=$status]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'repositoryId'] = this.repositoryId;
json[r'status'] = this.status;
return json;
}
/// Returns a new [ActiveScheduleItemDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ActiveScheduleItemDto? fromJson(dynamic value) {
upgradeDto(value, "ActiveScheduleItemDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ActiveScheduleItemDto(
repositoryId: mapValueOfType<String>(json, r'repositoryId')!,
status: TaskStatus.fromJson(json[r'status'])!,
);
}
return null;
}
static List<ActiveScheduleItemDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ActiveScheduleItemDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ActiveScheduleItemDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ActiveScheduleItemDto> mapFromJson(dynamic json) {
final map = <String, ActiveScheduleItemDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ActiveScheduleItemDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ActiveScheduleItemDto-objects as value to a dart map
static Map<String, List<ActiveScheduleItemDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ActiveScheduleItemDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ActiveScheduleItemDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'repositoryId',
'status',
};
}

132
mobile/openapi/lib/model/backend_dto.dart generated Normal file
View File

@ -0,0 +1,132 @@
//
// 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 BackendDto {
/// Returns a new [BackendDto] instance.
BackendDto({
this.error,
required this.id,
required this.isOnline,
required this.type,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? error;
String id;
bool isOnline;
BackendType type;
@override
bool operator ==(Object other) => identical(this, other) || other is BackendDto &&
other.error == error &&
other.id == id &&
other.isOnline == isOnline &&
other.type == type;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(error == null ? 0 : error!.hashCode) +
(id.hashCode) +
(isOnline.hashCode) +
(type.hashCode);
@override
String toString() => 'BackendDto[error=$error, id=$id, isOnline=$isOnline, type=$type]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.error != null) {
json[r'error'] = this.error;
} else {
// json[r'error'] = null;
}
json[r'id'] = this.id;
json[r'isOnline'] = this.isOnline;
json[r'type'] = this.type;
return json;
}
/// Returns a new [BackendDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static BackendDto? fromJson(dynamic value) {
upgradeDto(value, "BackendDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return BackendDto(
error: mapValueOfType<String>(json, r'error'),
id: mapValueOfType<String>(json, r'id')!,
isOnline: mapValueOfType<bool>(json, r'isOnline')!,
type: BackendType.fromJson(json[r'type'])!,
);
}
return null;
}
static List<BackendDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BackendDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BackendDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, BackendDto> mapFromJson(dynamic json) {
final map = <String, BackendDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = BackendDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of BackendDto-objects as value to a dart map
static Map<String, List<BackendDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BackendDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = BackendDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'isOnline',
'type',
};
}

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 BackendResponseDto {
/// Returns a new [BackendResponseDto] instance.
BackendResponseDto({
required this.backend,
});
BackendDto backend;
@override
bool operator ==(Object other) => identical(this, other) || other is BackendResponseDto &&
other.backend == backend;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backend.hashCode);
@override
String toString() => 'BackendResponseDto[backend=$backend]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'backend'] = this.backend;
return json;
}
/// Returns a new [BackendResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static BackendResponseDto? fromJson(dynamic value) {
upgradeDto(value, "BackendResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return BackendResponseDto(
backend: BackendDto.fromJson(json[r'backend'])!,
);
}
return null;
}
static List<BackendResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BackendResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BackendResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, BackendResponseDto> mapFromJson(dynamic json) {
final map = <String, BackendResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = BackendResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of BackendResponseDto-objects as value to a dart map
static Map<String, List<BackendResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BackendResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = BackendResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'backend',
};
}

View File

@ -0,0 +1,88 @@
//
// 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 BackendType {
/// Instantiate a new enum with the provided [value].
const BackendType._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const yucca = BackendType._(r'yucca');
static const local = BackendType._(r'local');
static const s3 = BackendType._(r's3');
/// List of all possible values in this [enum][BackendType].
static const values = <BackendType>[
yucca,
local,
s3,
];
static BackendType? fromJson(dynamic value) => BackendTypeTypeTransformer().decode(value);
static List<BackendType> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BackendType>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BackendType.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [BackendType] to String,
/// and [decode] dynamic data back to [BackendType].
class BackendTypeTypeTransformer {
factory BackendTypeTypeTransformer() => _instance ??= const BackendTypeTypeTransformer._();
const BackendTypeTypeTransformer._();
String encode(BackendType data) => data.value;
/// Decodes a [dynamic value][data] to a BackendType.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
BackendType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'yucca': return BackendType.yucca;
case r'local': return BackendType.local;
case r's3': return BackendType.s3;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [BackendTypeTypeTransformer] instance.
static BackendTypeTypeTransformer? _instance;
}

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 BackendsResponseDto {
/// Returns a new [BackendsResponseDto] instance.
BackendsResponseDto({
this.backends = const [],
});
List<BackendDto> backends;
@override
bool operator ==(Object other) => identical(this, other) || other is BackendsResponseDto &&
_deepEquality.equals(other.backends, backends);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backends.hashCode);
@override
String toString() => 'BackendsResponseDto[backends=$backends]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'backends'] = this.backends;
return json;
}
/// Returns a new [BackendsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static BackendsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "BackendsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return BackendsResponseDto(
backends: BackendDto.listFromJson(json[r'backends']),
);
}
return null;
}
static List<BackendsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BackendsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BackendsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, BackendsResponseDto> mapFromJson(dynamic json) {
final map = <String, BackendsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = BackendsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of BackendsResponseDto-objects as value to a dart map
static Map<String, List<BackendsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BackendsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = BackendsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'backends',
};
}

View File

@ -0,0 +1,141 @@
//
// 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 ConfigureImmichIntegrationRequestDto {
/// Returns a new [ConfigureImmichIntegrationRequestDto] instance.
ConfigureImmichIntegrationRequestDto({
required this.backupConfiguration,
required this.cron,
this.dataFolders = const [],
required this.libraries,
required this.name,
required this.worm,
});
bool backupConfiguration;
String cron;
List<String> dataFolders;
ConfigureImmichIntegrationRequestDtoLibraries libraries;
String name;
bool worm;
@override
bool operator ==(Object other) => identical(this, other) || other is ConfigureImmichIntegrationRequestDto &&
other.backupConfiguration == backupConfiguration &&
other.cron == cron &&
_deepEquality.equals(other.dataFolders, dataFolders) &&
other.libraries == libraries &&
other.name == name &&
other.worm == worm;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backupConfiguration.hashCode) +
(cron.hashCode) +
(dataFolders.hashCode) +
(libraries.hashCode) +
(name.hashCode) +
(worm.hashCode);
@override
String toString() => 'ConfigureImmichIntegrationRequestDto[backupConfiguration=$backupConfiguration, cron=$cron, dataFolders=$dataFolders, libraries=$libraries, name=$name, worm=$worm]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'backupConfiguration'] = this.backupConfiguration;
json[r'cron'] = this.cron;
json[r'dataFolders'] = this.dataFolders;
json[r'libraries'] = this.libraries;
json[r'name'] = this.name;
json[r'worm'] = this.worm;
return json;
}
/// Returns a new [ConfigureImmichIntegrationRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ConfigureImmichIntegrationRequestDto? fromJson(dynamic value) {
upgradeDto(value, "ConfigureImmichIntegrationRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ConfigureImmichIntegrationRequestDto(
backupConfiguration: mapValueOfType<bool>(json, r'backupConfiguration')!,
cron: mapValueOfType<String>(json, r'cron')!,
dataFolders: json[r'dataFolders'] is Iterable
? (json[r'dataFolders'] as Iterable).cast<String>().toList(growable: false)
: const [],
libraries: ConfigureImmichIntegrationRequestDtoLibraries.fromJson(json[r'libraries'])!,
name: mapValueOfType<String>(json, r'name')!,
worm: mapValueOfType<bool>(json, r'worm')!,
);
}
return null;
}
static List<ConfigureImmichIntegrationRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ConfigureImmichIntegrationRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ConfigureImmichIntegrationRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ConfigureImmichIntegrationRequestDto> mapFromJson(dynamic json) {
final map = <String, ConfigureImmichIntegrationRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ConfigureImmichIntegrationRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ConfigureImmichIntegrationRequestDto-objects as value to a dart map
static Map<String, List<ConfigureImmichIntegrationRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ConfigureImmichIntegrationRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ConfigureImmichIntegrationRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'backupConfiguration',
'cron',
'dataFolders',
'libraries',
'name',
'worm',
};
}

View File

@ -0,0 +1,91 @@
//
// 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 ConfigureImmichIntegrationRequestDtoLibraries {
/// Returns a new [ConfigureImmichIntegrationRequestDtoLibraries] instance.
ConfigureImmichIntegrationRequestDtoLibraries({
});
@override
bool operator ==(Object other) => identical(this, other) || other is ConfigureImmichIntegrationRequestDtoLibraries &&
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
@override
String toString() => 'ConfigureImmichIntegrationRequestDtoLibraries[]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
return json;
}
/// Returns a new [ConfigureImmichIntegrationRequestDtoLibraries] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ConfigureImmichIntegrationRequestDtoLibraries? fromJson(dynamic value) {
upgradeDto(value, "ConfigureImmichIntegrationRequestDtoLibraries");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ConfigureImmichIntegrationRequestDtoLibraries(
);
}
return null;
}
static List<ConfigureImmichIntegrationRequestDtoLibraries> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ConfigureImmichIntegrationRequestDtoLibraries>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ConfigureImmichIntegrationRequestDtoLibraries.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ConfigureImmichIntegrationRequestDtoLibraries> mapFromJson(dynamic json) {
final map = <String, ConfigureImmichIntegrationRequestDtoLibraries>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ConfigureImmichIntegrationRequestDtoLibraries.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ConfigureImmichIntegrationRequestDtoLibraries-objects as value to a dart map
static Map<String, List<ConfigureImmichIntegrationRequestDtoLibraries>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ConfigureImmichIntegrationRequestDtoLibraries>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ConfigureImmichIntegrationRequestDtoLibraries.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

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 CreateLocalBackendRequestDto {
/// Returns a new [CreateLocalBackendRequestDto] instance.
CreateLocalBackendRequestDto({
required this.path,
});
String path;
@override
bool operator ==(Object other) => identical(this, other) || other is CreateLocalBackendRequestDto &&
other.path == path;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(path.hashCode);
@override
String toString() => 'CreateLocalBackendRequestDto[path=$path]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'path'] = this.path;
return json;
}
/// Returns a new [CreateLocalBackendRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CreateLocalBackendRequestDto? fromJson(dynamic value) {
upgradeDto(value, "CreateLocalBackendRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return CreateLocalBackendRequestDto(
path: mapValueOfType<String>(json, r'path')!,
);
}
return null;
}
static List<CreateLocalBackendRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CreateLocalBackendRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CreateLocalBackendRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, CreateLocalBackendRequestDto> mapFromJson(dynamic json) {
final map = <String, CreateLocalBackendRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateLocalBackendRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of CreateLocalBackendRequestDto-objects as value to a dart map
static Map<String, List<CreateLocalBackendRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CreateLocalBackendRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CreateLocalBackendRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'path',
};
}

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 CurrentRecoveryKeyResponse {
/// Returns a new [CurrentRecoveryKeyResponse] instance.
CurrentRecoveryKeyResponse({
required this.recoveryKey,
});
String recoveryKey;
@override
bool operator ==(Object other) => identical(this, other) || other is CurrentRecoveryKeyResponse &&
other.recoveryKey == recoveryKey;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(recoveryKey.hashCode);
@override
String toString() => 'CurrentRecoveryKeyResponse[recoveryKey=$recoveryKey]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'recoveryKey'] = this.recoveryKey;
return json;
}
/// Returns a new [CurrentRecoveryKeyResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CurrentRecoveryKeyResponse? fromJson(dynamic value) {
upgradeDto(value, "CurrentRecoveryKeyResponse");
if (value is Map) {
final json = value.cast<String, dynamic>();
return CurrentRecoveryKeyResponse(
recoveryKey: mapValueOfType<String>(json, r'recoveryKey')!,
);
}
return null;
}
static List<CurrentRecoveryKeyResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CurrentRecoveryKeyResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CurrentRecoveryKeyResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, CurrentRecoveryKeyResponse> mapFromJson(dynamic json) {
final map = <String, CurrentRecoveryKeyResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CurrentRecoveryKeyResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of CurrentRecoveryKeyResponse-objects as value to a dart map
static Map<String, List<CurrentRecoveryKeyResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CurrentRecoveryKeyResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CurrentRecoveryKeyResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'recoveryKey',
};
}

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 FilesystemListingItemDto {
/// Returns a new [FilesystemListingItemDto] instance.
FilesystemListingItemDto({
required this.isDirectory,
required this.path,
});
bool isDirectory;
String path;
@override
bool operator ==(Object other) => identical(this, other) || other is FilesystemListingItemDto &&
other.isDirectory == isDirectory &&
other.path == path;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(isDirectory.hashCode) +
(path.hashCode);
@override
String toString() => 'FilesystemListingItemDto[isDirectory=$isDirectory, path=$path]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'isDirectory'] = this.isDirectory;
json[r'path'] = this.path;
return json;
}
/// Returns a new [FilesystemListingItemDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static FilesystemListingItemDto? fromJson(dynamic value) {
upgradeDto(value, "FilesystemListingItemDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return FilesystemListingItemDto(
isDirectory: mapValueOfType<bool>(json, r'isDirectory')!,
path: mapValueOfType<String>(json, r'path')!,
);
}
return null;
}
static List<FilesystemListingItemDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <FilesystemListingItemDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = FilesystemListingItemDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, FilesystemListingItemDto> mapFromJson(dynamic json) {
final map = <String, FilesystemListingItemDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = FilesystemListingItemDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of FilesystemListingItemDto-objects as value to a dart map
static Map<String, List<FilesystemListingItemDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<FilesystemListingItemDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = FilesystemListingItemDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'isDirectory',
'path',
};
}

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 FilesystemListingResponseDto {
/// Returns a new [FilesystemListingResponseDto] instance.
FilesystemListingResponseDto({
this.items = const [],
required this.parent,
required this.path,
});
List<FilesystemListingItemDto> items;
String parent;
String path;
@override
bool operator ==(Object other) => identical(this, other) || other is FilesystemListingResponseDto &&
_deepEquality.equals(other.items, items) &&
other.parent == parent &&
other.path == path;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(items.hashCode) +
(parent.hashCode) +
(path.hashCode);
@override
String toString() => 'FilesystemListingResponseDto[items=$items, parent=$parent, path=$path]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'items'] = this.items;
json[r'parent'] = this.parent;
json[r'path'] = this.path;
return json;
}
/// Returns a new [FilesystemListingResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static FilesystemListingResponseDto? fromJson(dynamic value) {
upgradeDto(value, "FilesystemListingResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return FilesystemListingResponseDto(
items: FilesystemListingItemDto.listFromJson(json[r'items']),
parent: mapValueOfType<String>(json, r'parent')!,
path: mapValueOfType<String>(json, r'path')!,
);
}
return null;
}
static List<FilesystemListingResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <FilesystemListingResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = FilesystemListingResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, FilesystemListingResponseDto> mapFromJson(dynamic json) {
final map = <String, FilesystemListingResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = FilesystemListingResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of FilesystemListingResponseDto-objects as value to a dart map
static Map<String, List<FilesystemListingResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<FilesystemListingResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = FilesystemListingResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'items',
'parent',
'path',
};
}

View File

@ -0,0 +1,117 @@
//
// 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 ImmichIntegrationConfigurationDto {
/// Returns a new [ImmichIntegrationConfigurationDto] instance.
ImmichIntegrationConfigurationDto({
required this.backupConfiguration,
this.dataFolders = const [],
required this.libraries,
});
bool backupConfiguration;
List<String> dataFolders;
ConfigureImmichIntegrationRequestDtoLibraries libraries;
@override
bool operator ==(Object other) => identical(this, other) || other is ImmichIntegrationConfigurationDto &&
other.backupConfiguration == backupConfiguration &&
_deepEquality.equals(other.dataFolders, dataFolders) &&
other.libraries == libraries;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backupConfiguration.hashCode) +
(dataFolders.hashCode) +
(libraries.hashCode);
@override
String toString() => 'ImmichIntegrationConfigurationDto[backupConfiguration=$backupConfiguration, dataFolders=$dataFolders, libraries=$libraries]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'backupConfiguration'] = this.backupConfiguration;
json[r'dataFolders'] = this.dataFolders;
json[r'libraries'] = this.libraries;
return json;
}
/// Returns a new [ImmichIntegrationConfigurationDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ImmichIntegrationConfigurationDto? fromJson(dynamic value) {
upgradeDto(value, "ImmichIntegrationConfigurationDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ImmichIntegrationConfigurationDto(
backupConfiguration: mapValueOfType<bool>(json, r'backupConfiguration')!,
dataFolders: json[r'dataFolders'] is Iterable
? (json[r'dataFolders'] as Iterable).cast<String>().toList(growable: false)
: const [],
libraries: ConfigureImmichIntegrationRequestDtoLibraries.fromJson(json[r'libraries'])!,
);
}
return null;
}
static List<ImmichIntegrationConfigurationDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImmichIntegrationConfigurationDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ImmichIntegrationConfigurationDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ImmichIntegrationConfigurationDto> mapFromJson(dynamic json) {
final map = <String, ImmichIntegrationConfigurationDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ImmichIntegrationConfigurationDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ImmichIntegrationConfigurationDto-objects as value to a dart map
static Map<String, List<ImmichIntegrationConfigurationDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImmichIntegrationConfigurationDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ImmichIntegrationConfigurationDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'backupConfiguration',
'dataFolders',
'libraries',
};
}

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 ImmichIntegrationDto {
/// Returns a new [ImmichIntegrationDto] instance.
ImmichIntegrationDto({
required this.configuration,
required this.id,
required this.scheduleId,
});
ImmichIntegrationConfigurationDto configuration;
String id;
String scheduleId;
@override
bool operator ==(Object other) => identical(this, other) || other is ImmichIntegrationDto &&
other.configuration == configuration &&
other.id == id &&
other.scheduleId == scheduleId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(configuration.hashCode) +
(id.hashCode) +
(scheduleId.hashCode);
@override
String toString() => 'ImmichIntegrationDto[configuration=$configuration, id=$id, scheduleId=$scheduleId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'configuration'] = this.configuration;
json[r'id'] = this.id;
json[r'scheduleId'] = this.scheduleId;
return json;
}
/// Returns a new [ImmichIntegrationDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ImmichIntegrationDto? fromJson(dynamic value) {
upgradeDto(value, "ImmichIntegrationDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ImmichIntegrationDto(
configuration: ImmichIntegrationConfigurationDto.fromJson(json[r'configuration'])!,
id: mapValueOfType<String>(json, r'id')!,
scheduleId: mapValueOfType<String>(json, r'scheduleId')!,
);
}
return null;
}
static List<ImmichIntegrationDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImmichIntegrationDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ImmichIntegrationDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ImmichIntegrationDto> mapFromJson(dynamic json) {
final map = <String, ImmichIntegrationDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ImmichIntegrationDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ImmichIntegrationDto-objects as value to a dart map
static Map<String, List<ImmichIntegrationDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImmichIntegrationDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ImmichIntegrationDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'configuration',
'id',
'scheduleId',
};
}

View File

@ -0,0 +1,127 @@
//
// 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 ImmichLibraryDto {
/// Returns a new [ImmichLibraryDto] instance.
ImmichLibraryDto({
this.exclusionPatterns = const [],
required this.id,
this.importPaths = const [],
required this.name,
});
List<String> exclusionPatterns;
String id;
List<String> importPaths;
String name;
@override
bool operator ==(Object other) => identical(this, other) || other is ImmichLibraryDto &&
_deepEquality.equals(other.exclusionPatterns, exclusionPatterns) &&
other.id == id &&
_deepEquality.equals(other.importPaths, importPaths) &&
other.name == name;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(exclusionPatterns.hashCode) +
(id.hashCode) +
(importPaths.hashCode) +
(name.hashCode);
@override
String toString() => 'ImmichLibraryDto[exclusionPatterns=$exclusionPatterns, id=$id, importPaths=$importPaths, name=$name]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'exclusionPatterns'] = this.exclusionPatterns;
json[r'id'] = this.id;
json[r'importPaths'] = this.importPaths;
json[r'name'] = this.name;
return json;
}
/// Returns a new [ImmichLibraryDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ImmichLibraryDto? fromJson(dynamic value) {
upgradeDto(value, "ImmichLibraryDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ImmichLibraryDto(
exclusionPatterns: json[r'exclusionPatterns'] is Iterable
? (json[r'exclusionPatterns'] as Iterable).cast<String>().toList(growable: false)
: const [],
id: mapValueOfType<String>(json, r'id')!,
importPaths: json[r'importPaths'] is Iterable
? (json[r'importPaths'] as Iterable).cast<String>().toList(growable: false)
: const [],
name: mapValueOfType<String>(json, r'name')!,
);
}
return null;
}
static List<ImmichLibraryDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImmichLibraryDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ImmichLibraryDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ImmichLibraryDto> mapFromJson(dynamic json) {
final map = <String, ImmichLibraryDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ImmichLibraryDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ImmichLibraryDto-objects as value to a dart map
static Map<String, List<ImmichLibraryDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImmichLibraryDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ImmichLibraryDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'exclusionPatterns',
'id',
'importPaths',
'name',
};
}

View File

@ -0,0 +1,117 @@
//
// 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 ImmichStateDto {
/// Returns a new [ImmichStateDto] instance.
ImmichStateDto({
this.dataFolders = const [],
required this.dataPath,
this.libraries = const [],
});
List<String> dataFolders;
String dataPath;
List<ImmichLibraryDto> libraries;
@override
bool operator ==(Object other) => identical(this, other) || other is ImmichStateDto &&
_deepEquality.equals(other.dataFolders, dataFolders) &&
other.dataPath == dataPath &&
_deepEquality.equals(other.libraries, libraries);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(dataFolders.hashCode) +
(dataPath.hashCode) +
(libraries.hashCode);
@override
String toString() => 'ImmichStateDto[dataFolders=$dataFolders, dataPath=$dataPath, libraries=$libraries]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'dataFolders'] = this.dataFolders;
json[r'dataPath'] = this.dataPath;
json[r'libraries'] = this.libraries;
return json;
}
/// Returns a new [ImmichStateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ImmichStateDto? fromJson(dynamic value) {
upgradeDto(value, "ImmichStateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ImmichStateDto(
dataFolders: json[r'dataFolders'] is Iterable
? (json[r'dataFolders'] as Iterable).cast<String>().toList(growable: false)
: const [],
dataPath: mapValueOfType<String>(json, r'dataPath')!,
libraries: ImmichLibraryDto.listFromJson(json[r'libraries']),
);
}
return null;
}
static List<ImmichStateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImmichStateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ImmichStateDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ImmichStateDto> mapFromJson(dynamic json) {
final map = <String, ImmichStateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ImmichStateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ImmichStateDto-objects as value to a dart map
static Map<String, List<ImmichStateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImmichStateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ImmichStateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'dataFolders',
'dataPath',
'libraries',
};
}

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 ImportRecoveryKeyRequest {
/// Returns a new [ImportRecoveryKeyRequest] instance.
ImportRecoveryKeyRequest({
required this.recoveryKey,
});
String recoveryKey;
@override
bool operator ==(Object other) => identical(this, other) || other is ImportRecoveryKeyRequest &&
other.recoveryKey == recoveryKey;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(recoveryKey.hashCode);
@override
String toString() => 'ImportRecoveryKeyRequest[recoveryKey=$recoveryKey]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'recoveryKey'] = this.recoveryKey;
return json;
}
/// Returns a new [ImportRecoveryKeyRequest] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ImportRecoveryKeyRequest? fromJson(dynamic value) {
upgradeDto(value, "ImportRecoveryKeyRequest");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ImportRecoveryKeyRequest(
recoveryKey: mapValueOfType<String>(json, r'recoveryKey')!,
);
}
return null;
}
static List<ImportRecoveryKeyRequest> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ImportRecoveryKeyRequest>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ImportRecoveryKeyRequest.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ImportRecoveryKeyRequest> mapFromJson(dynamic json) {
final map = <String, ImportRecoveryKeyRequest>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ImportRecoveryKeyRequest.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ImportRecoveryKeyRequest-objects as value to a dart map
static Map<String, List<ImportRecoveryKeyRequest>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ImportRecoveryKeyRequest>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ImportRecoveryKeyRequest.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'recoveryKey',
};
}

View File

@ -0,0 +1,165 @@
//
// 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 InspectedLocalRepositoryDto {
/// Returns a new [InspectedLocalRepositoryDto] instance.
InspectedLocalRepositoryDto({
this.backends,
this.configuration,
required this.id,
required this.metrics,
required this.name,
this.snapshots = const [],
required this.worm,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RepositoryBackendsDto? backends;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RepositoryConfigurationDto? configuration;
String id;
RepositoryMetricsDto metrics;
String name;
List<SnapshotDto> snapshots;
bool worm;
@override
bool operator ==(Object other) => identical(this, other) || other is InspectedLocalRepositoryDto &&
other.backends == backends &&
other.configuration == configuration &&
other.id == id &&
other.metrics == metrics &&
other.name == name &&
_deepEquality.equals(other.snapshots, snapshots) &&
other.worm == worm;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backends == null ? 0 : backends!.hashCode) +
(configuration == null ? 0 : configuration!.hashCode) +
(id.hashCode) +
(metrics.hashCode) +
(name.hashCode) +
(snapshots.hashCode) +
(worm.hashCode);
@override
String toString() => 'InspectedLocalRepositoryDto[backends=$backends, configuration=$configuration, id=$id, metrics=$metrics, name=$name, snapshots=$snapshots, worm=$worm]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.backends != null) {
json[r'backends'] = this.backends;
} else {
// json[r'backends'] = null;
}
if (this.configuration != null) {
json[r'configuration'] = this.configuration;
} else {
// json[r'configuration'] = null;
}
json[r'id'] = this.id;
json[r'metrics'] = this.metrics;
json[r'name'] = this.name;
json[r'snapshots'] = this.snapshots;
json[r'worm'] = this.worm;
return json;
}
/// Returns a new [InspectedLocalRepositoryDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static InspectedLocalRepositoryDto? fromJson(dynamic value) {
upgradeDto(value, "InspectedLocalRepositoryDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return InspectedLocalRepositoryDto(
backends: RepositoryBackendsDto.fromJson(json[r'backends']),
configuration: RepositoryConfigurationDto.fromJson(json[r'configuration']),
id: mapValueOfType<String>(json, r'id')!,
metrics: RepositoryMetricsDto.fromJson(json[r'metrics'])!,
name: mapValueOfType<String>(json, r'name')!,
snapshots: SnapshotDto.listFromJson(json[r'snapshots']),
worm: mapValueOfType<bool>(json, r'worm')!,
);
}
return null;
}
static List<InspectedLocalRepositoryDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <InspectedLocalRepositoryDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = InspectedLocalRepositoryDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, InspectedLocalRepositoryDto> mapFromJson(dynamic json) {
final map = <String, InspectedLocalRepositoryDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = InspectedLocalRepositoryDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of InspectedLocalRepositoryDto-objects as value to a dart map
static Map<String, List<InspectedLocalRepositoryDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<InspectedLocalRepositoryDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = InspectedLocalRepositoryDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'metrics',
'name',
'snapshots',
'worm',
};
}

View File

@ -0,0 +1,125 @@
//
// 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 IntegrationsResponseDto {
/// Returns a new [IntegrationsResponseDto] instance.
IntegrationsResponseDto({
this.immichIntegration,
this.immichState,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ImmichIntegrationDto? immichIntegration;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ImmichStateDto? immichState;
@override
bool operator ==(Object other) => identical(this, other) || other is IntegrationsResponseDto &&
other.immichIntegration == immichIntegration &&
other.immichState == immichState;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(immichIntegration == null ? 0 : immichIntegration!.hashCode) +
(immichState == null ? 0 : immichState!.hashCode);
@override
String toString() => 'IntegrationsResponseDto[immichIntegration=$immichIntegration, immichState=$immichState]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.immichIntegration != null) {
json[r'immichIntegration'] = this.immichIntegration;
} else {
// json[r'immichIntegration'] = null;
}
if (this.immichState != null) {
json[r'immichState'] = this.immichState;
} else {
// json[r'immichState'] = null;
}
return json;
}
/// Returns a new [IntegrationsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static IntegrationsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "IntegrationsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return IntegrationsResponseDto(
immichIntegration: ImmichIntegrationDto.fromJson(json[r'immichIntegration']),
immichState: ImmichStateDto.fromJson(json[r'immichState']),
);
}
return null;
}
static List<IntegrationsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <IntegrationsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = IntegrationsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, IntegrationsResponseDto> mapFromJson(dynamic json) {
final map = <String, IntegrationsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = IntegrationsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of IntegrationsResponseDto-objects as value to a dart map
static Map<String, List<IntegrationsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<IntegrationsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = IntegrationsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

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 ListSnapshotsResponseDto {
/// Returns a new [ListSnapshotsResponseDto] instance.
ListSnapshotsResponseDto({
this.snapshots = const [],
});
List<SnapshotDto> snapshots;
@override
bool operator ==(Object other) => identical(this, other) || other is ListSnapshotsResponseDto &&
_deepEquality.equals(other.snapshots, snapshots);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(snapshots.hashCode);
@override
String toString() => 'ListSnapshotsResponseDto[snapshots=$snapshots]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'snapshots'] = this.snapshots;
return json;
}
/// Returns a new [ListSnapshotsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ListSnapshotsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ListSnapshotsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ListSnapshotsResponseDto(
snapshots: SnapshotDto.listFromJson(json[r'snapshots']),
);
}
return null;
}
static List<ListSnapshotsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ListSnapshotsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ListSnapshotsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ListSnapshotsResponseDto> mapFromJson(dynamic json) {
final map = <String, ListSnapshotsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ListSnapshotsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ListSnapshotsResponseDto-objects as value to a dart map
static Map<String, List<ListSnapshotsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ListSnapshotsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ListSnapshotsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'snapshots',
};
}

View File

@ -0,0 +1,157 @@
//
// 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 LocalRepositoryDto {
/// Returns a new [LocalRepositoryDto] instance.
LocalRepositoryDto({
this.backends,
this.configuration,
required this.id,
required this.metrics,
required this.name,
required this.worm,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RepositoryBackendsDto? backends;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RepositoryConfigurationDto? configuration;
String id;
RepositoryMetricsDto metrics;
String name;
bool worm;
@override
bool operator ==(Object other) => identical(this, other) || other is LocalRepositoryDto &&
other.backends == backends &&
other.configuration == configuration &&
other.id == id &&
other.metrics == metrics &&
other.name == name &&
other.worm == worm;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backends == null ? 0 : backends!.hashCode) +
(configuration == null ? 0 : configuration!.hashCode) +
(id.hashCode) +
(metrics.hashCode) +
(name.hashCode) +
(worm.hashCode);
@override
String toString() => 'LocalRepositoryDto[backends=$backends, configuration=$configuration, id=$id, metrics=$metrics, name=$name, worm=$worm]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.backends != null) {
json[r'backends'] = this.backends;
} else {
// json[r'backends'] = null;
}
if (this.configuration != null) {
json[r'configuration'] = this.configuration;
} else {
// json[r'configuration'] = null;
}
json[r'id'] = this.id;
json[r'metrics'] = this.metrics;
json[r'name'] = this.name;
json[r'worm'] = this.worm;
return json;
}
/// Returns a new [LocalRepositoryDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static LocalRepositoryDto? fromJson(dynamic value) {
upgradeDto(value, "LocalRepositoryDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return LocalRepositoryDto(
backends: RepositoryBackendsDto.fromJson(json[r'backends']),
configuration: RepositoryConfigurationDto.fromJson(json[r'configuration']),
id: mapValueOfType<String>(json, r'id')!,
metrics: RepositoryMetricsDto.fromJson(json[r'metrics'])!,
name: mapValueOfType<String>(json, r'name')!,
worm: mapValueOfType<bool>(json, r'worm')!,
);
}
return null;
}
static List<LocalRepositoryDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <LocalRepositoryDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = LocalRepositoryDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, LocalRepositoryDto> mapFromJson(dynamic json) {
final map = <String, LocalRepositoryDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = LocalRepositoryDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of LocalRepositoryDto-objects as value to a dart map
static Map<String, List<LocalRepositoryDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<LocalRepositoryDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = LocalRepositoryDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'metrics',
'name',
'worm',
};
}

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 LogResponseDto {
/// Returns a new [LogResponseDto] instance.
LogResponseDto({
required this.logId,
});
String logId;
@override
bool operator ==(Object other) => identical(this, other) || other is LogResponseDto &&
other.logId == logId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(logId.hashCode);
@override
String toString() => 'LogResponseDto[logId=$logId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'logId'] = this.logId;
return json;
}
/// Returns a new [LogResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static LogResponseDto? fromJson(dynamic value) {
upgradeDto(value, "LogResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return LogResponseDto(
logId: mapValueOfType<String>(json, r'logId')!,
);
}
return null;
}
static List<LogResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <LogResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = LogResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, LogResponseDto> mapFromJson(dynamic json) {
final map = <String, LogResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = LogResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of LogResponseDto-objects as value to a dart map
static Map<String, List<LogResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<LogResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = LogResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'logId',
};
}

View File

@ -0,0 +1,131 @@
//
// 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 OnboardingStatusResponseDto {
/// Returns a new [OnboardingStatusResponseDto] instance.
OnboardingStatusResponseDto({
required this.hasBackend,
required this.hasBackup,
required this.hasOnboardedKey,
required this.hasSchedule,
required this.hasSkippedExtraConfig,
});
bool hasBackend;
bool hasBackup;
bool hasOnboardedKey;
bool hasSchedule;
bool hasSkippedExtraConfig;
@override
bool operator ==(Object other) => identical(this, other) || other is OnboardingStatusResponseDto &&
other.hasBackend == hasBackend &&
other.hasBackup == hasBackup &&
other.hasOnboardedKey == hasOnboardedKey &&
other.hasSchedule == hasSchedule &&
other.hasSkippedExtraConfig == hasSkippedExtraConfig;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(hasBackend.hashCode) +
(hasBackup.hashCode) +
(hasOnboardedKey.hashCode) +
(hasSchedule.hashCode) +
(hasSkippedExtraConfig.hashCode);
@override
String toString() => 'OnboardingStatusResponseDto[hasBackend=$hasBackend, hasBackup=$hasBackup, hasOnboardedKey=$hasOnboardedKey, hasSchedule=$hasSchedule, hasSkippedExtraConfig=$hasSkippedExtraConfig]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'hasBackend'] = this.hasBackend;
json[r'hasBackup'] = this.hasBackup;
json[r'hasOnboardedKey'] = this.hasOnboardedKey;
json[r'hasSchedule'] = this.hasSchedule;
json[r'hasSkippedExtraConfig'] = this.hasSkippedExtraConfig;
return json;
}
/// Returns a new [OnboardingStatusResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static OnboardingStatusResponseDto? fromJson(dynamic value) {
upgradeDto(value, "OnboardingStatusResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return OnboardingStatusResponseDto(
hasBackend: mapValueOfType<bool>(json, r'hasBackend')!,
hasBackup: mapValueOfType<bool>(json, r'hasBackup')!,
hasOnboardedKey: mapValueOfType<bool>(json, r'hasOnboardedKey')!,
hasSchedule: mapValueOfType<bool>(json, r'hasSchedule')!,
hasSkippedExtraConfig: mapValueOfType<bool>(json, r'hasSkippedExtraConfig')!,
);
}
return null;
}
static List<OnboardingStatusResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <OnboardingStatusResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = OnboardingStatusResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, OnboardingStatusResponseDto> mapFromJson(dynamic json) {
final map = <String, OnboardingStatusResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = OnboardingStatusResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of OnboardingStatusResponseDto-objects as value to a dart map
static Map<String, List<OnboardingStatusResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<OnboardingStatusResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = OnboardingStatusResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'hasBackend',
'hasBackup',
'hasOnboardedKey',
'hasSchedule',
'hasSkippedExtraConfig',
};
}

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 RepositoryBackendDto {
/// Returns a new [RepositoryBackendDto] instance.
RepositoryBackendDto({
required this.id,
required this.online,
required this.type,
});
String id;
bool online;
BackendType type;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryBackendDto &&
other.id == id &&
other.online == online &&
other.type == type;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(online.hashCode) +
(type.hashCode);
@override
String toString() => 'RepositoryBackendDto[id=$id, online=$online, type=$type]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'id'] = this.id;
json[r'online'] = this.online;
json[r'type'] = this.type;
return json;
}
/// Returns a new [RepositoryBackendDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryBackendDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryBackendDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryBackendDto(
id: mapValueOfType<String>(json, r'id')!,
online: mapValueOfType<bool>(json, r'online')!,
type: BackendType.fromJson(json[r'type'])!,
);
}
return null;
}
static List<RepositoryBackendDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryBackendDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryBackendDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryBackendDto> mapFromJson(dynamic json) {
final map = <String, RepositoryBackendDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryBackendDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryBackendDto-objects as value to a dart map
static Map<String, List<RepositoryBackendDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryBackendDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryBackendDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'online',
'type',
};
}

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 RepositoryBackendsDto {
/// Returns a new [RepositoryBackendsDto] instance.
RepositoryBackendsDto({
required this.primary,
this.secondary = const [],
});
RepositoryBackendDto primary;
List<RepositoryBackendDto> secondary;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryBackendsDto &&
other.primary == primary &&
_deepEquality.equals(other.secondary, secondary);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(primary.hashCode) +
(secondary.hashCode);
@override
String toString() => 'RepositoryBackendsDto[primary=$primary, secondary=$secondary]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'primary'] = this.primary;
json[r'secondary'] = this.secondary;
return json;
}
/// Returns a new [RepositoryBackendsDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryBackendsDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryBackendsDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryBackendsDto(
primary: RepositoryBackendDto.fromJson(json[r'primary'])!,
secondary: RepositoryBackendDto.listFromJson(json[r'secondary']),
);
}
return null;
}
static List<RepositoryBackendsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryBackendsDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryBackendsDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryBackendsDto> mapFromJson(dynamic json) {
final map = <String, RepositoryBackendsDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryBackendsDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryBackendsDto-objects as value to a dart map
static Map<String, List<RepositoryBackendsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryBackendsDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryBackendsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'primary',
'secondary',
};
}

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 RepositoryCheckImportResponseDto {
/// Returns a new [RepositoryCheckImportResponseDto] instance.
RepositoryCheckImportResponseDto({
required this.readable,
});
bool readable;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryCheckImportResponseDto &&
other.readable == readable;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(readable.hashCode);
@override
String toString() => 'RepositoryCheckImportResponseDto[readable=$readable]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'readable'] = this.readable;
return json;
}
/// Returns a new [RepositoryCheckImportResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryCheckImportResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryCheckImportResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryCheckImportResponseDto(
readable: mapValueOfType<bool>(json, r'readable')!,
);
}
return null;
}
static List<RepositoryCheckImportResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryCheckImportResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryCheckImportResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryCheckImportResponseDto> mapFromJson(dynamic json) {
final map = <String, RepositoryCheckImportResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryCheckImportResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryCheckImportResponseDto-objects as value to a dart map
static Map<String, List<RepositoryCheckImportResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryCheckImportResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryCheckImportResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'readable',
};
}

View File

@ -0,0 +1,101 @@
//
// 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 RepositoryConfigurationDto {
/// Returns a new [RepositoryConfigurationDto] instance.
RepositoryConfigurationDto({
this.paths = const [],
});
List<String> paths;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryConfigurationDto &&
_deepEquality.equals(other.paths, paths);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(paths.hashCode);
@override
String toString() => 'RepositoryConfigurationDto[paths=$paths]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'paths'] = this.paths;
return json;
}
/// Returns a new [RepositoryConfigurationDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryConfigurationDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryConfigurationDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryConfigurationDto(
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<RepositoryConfigurationDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryConfigurationDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryConfigurationDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryConfigurationDto> mapFromJson(dynamic json) {
final map = <String, RepositoryConfigurationDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryConfigurationDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryConfigurationDto-objects as value to a dart map
static Map<String, List<RepositoryConfigurationDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryConfigurationDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryConfigurationDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'paths',
};
}

View File

@ -0,0 +1,116 @@
//
// 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 RepositoryCreateRequestDto {
/// Returns a new [RepositoryCreateRequestDto] instance.
RepositoryCreateRequestDto({
required this.name,
this.paths = const [],
required this.worm,
});
String name;
List<String> paths;
bool worm;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryCreateRequestDto &&
other.name == name &&
_deepEquality.equals(other.paths, paths) &&
other.worm == worm;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(name.hashCode) +
(paths.hashCode) +
(worm.hashCode);
@override
String toString() => 'RepositoryCreateRequestDto[name=$name, paths=$paths, worm=$worm]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'name'] = this.name;
json[r'paths'] = this.paths;
json[r'worm'] = this.worm;
return json;
}
/// Returns a new [RepositoryCreateRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryCreateRequestDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryCreateRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryCreateRequestDto(
name: mapValueOfType<String>(json, r'name')!,
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
worm: mapValueOfType<bool>(json, r'worm')!,
);
}
return null;
}
static List<RepositoryCreateRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryCreateRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryCreateRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryCreateRequestDto> mapFromJson(dynamic json) {
final map = <String, RepositoryCreateRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryCreateRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryCreateRequestDto-objects as value to a dart map
static Map<String, List<RepositoryCreateRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryCreateRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryCreateRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'name',
'worm',
};
}

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 RepositoryCreateResponseDto {
/// Returns a new [RepositoryCreateResponseDto] instance.
RepositoryCreateResponseDto({
required this.repository,
});
LocalRepositoryDto repository;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryCreateResponseDto &&
other.repository == repository;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(repository.hashCode);
@override
String toString() => 'RepositoryCreateResponseDto[repository=$repository]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'repository'] = this.repository;
return json;
}
/// Returns a new [RepositoryCreateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryCreateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryCreateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryCreateResponseDto(
repository: LocalRepositoryDto.fromJson(json[r'repository'])!,
);
}
return null;
}
static List<RepositoryCreateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryCreateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryCreateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryCreateResponseDto> mapFromJson(dynamic json) {
final map = <String, RepositoryCreateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryCreateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryCreateResponseDto-objects as value to a dart map
static Map<String, List<RepositoryCreateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryCreateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryCreateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'repository',
};
}

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 RepositoryInspectResponseDto {
/// Returns a new [RepositoryInspectResponseDto] instance.
RepositoryInspectResponseDto({
this.repositories = const [],
});
List<InspectedLocalRepositoryDto> repositories;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryInspectResponseDto &&
_deepEquality.equals(other.repositories, repositories);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(repositories.hashCode);
@override
String toString() => 'RepositoryInspectResponseDto[repositories=$repositories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'repositories'] = this.repositories;
return json;
}
/// Returns a new [RepositoryInspectResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryInspectResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryInspectResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryInspectResponseDto(
repositories: InspectedLocalRepositoryDto.listFromJson(json[r'repositories']),
);
}
return null;
}
static List<RepositoryInspectResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryInspectResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryInspectResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryInspectResponseDto> mapFromJson(dynamic json) {
final map = <String, RepositoryInspectResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryInspectResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryInspectResponseDto-objects as value to a dart map
static Map<String, List<RepositoryInspectResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryInspectResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryInspectResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'repositories',
};
}

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 RepositoryListResponseDto {
/// Returns a new [RepositoryListResponseDto] instance.
RepositoryListResponseDto({
this.repositories = const [],
});
List<LocalRepositoryDto> repositories;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryListResponseDto &&
_deepEquality.equals(other.repositories, repositories);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(repositories.hashCode);
@override
String toString() => 'RepositoryListResponseDto[repositories=$repositories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'repositories'] = this.repositories;
return json;
}
/// Returns a new [RepositoryListResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryListResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryListResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryListResponseDto(
repositories: LocalRepositoryDto.listFromJson(json[r'repositories']),
);
}
return null;
}
static List<RepositoryListResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryListResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryListResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryListResponseDto> mapFromJson(dynamic json) {
final map = <String, RepositoryListResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryListResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryListResponseDto-objects as value to a dart map
static Map<String, List<RepositoryListResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryListResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryListResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'repositories',
};
}

View File

@ -0,0 +1,150 @@
//
// 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 RepositoryMetricsDto {
/// Returns a new [RepositoryMetricsDto] instance.
RepositoryMetricsDto({
this.lastBackup,
this.lastBackupDuration,
this.lastSuccessfulBackup,
required this.sizeBytes,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? lastBackup;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? lastBackupDuration;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? lastSuccessfulBackup;
num sizeBytes;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryMetricsDto &&
other.lastBackup == lastBackup &&
other.lastBackupDuration == lastBackupDuration &&
other.lastSuccessfulBackup == lastSuccessfulBackup &&
other.sizeBytes == sizeBytes;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(lastBackup == null ? 0 : lastBackup!.hashCode) +
(lastBackupDuration == null ? 0 : lastBackupDuration!.hashCode) +
(lastSuccessfulBackup == null ? 0 : lastSuccessfulBackup!.hashCode) +
(sizeBytes.hashCode);
@override
String toString() => 'RepositoryMetricsDto[lastBackup=$lastBackup, lastBackupDuration=$lastBackupDuration, lastSuccessfulBackup=$lastSuccessfulBackup, sizeBytes=$sizeBytes]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.lastBackup != null) {
json[r'lastBackup'] = this.lastBackup;
} else {
// json[r'lastBackup'] = null;
}
if (this.lastBackupDuration != null) {
json[r'lastBackupDuration'] = this.lastBackupDuration;
} else {
// json[r'lastBackupDuration'] = null;
}
if (this.lastSuccessfulBackup != null) {
json[r'lastSuccessfulBackup'] = this.lastSuccessfulBackup;
} else {
// json[r'lastSuccessfulBackup'] = null;
}
json[r'sizeBytes'] = this.sizeBytes;
return json;
}
/// Returns a new [RepositoryMetricsDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryMetricsDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryMetricsDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryMetricsDto(
lastBackup: mapValueOfType<String>(json, r'lastBackup'),
lastBackupDuration: num.parse('${json[r'lastBackupDuration']}'),
lastSuccessfulBackup: mapValueOfType<String>(json, r'lastSuccessfulBackup'),
sizeBytes: num.parse('${json[r'sizeBytes']}'),
);
}
return null;
}
static List<RepositoryMetricsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryMetricsDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryMetricsDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryMetricsDto> mapFromJson(dynamic json) {
final map = <String, RepositoryMetricsDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryMetricsDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryMetricsDto-objects as value to a dart map
static Map<String, List<RepositoryMetricsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryMetricsDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryMetricsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'sizeBytes',
};
}

View File

@ -0,0 +1,117 @@
//
// 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 RepositorySnapshotRestoreFromPointRequestDto {
/// Returns a new [RepositorySnapshotRestoreFromPointRequestDto] instance.
RepositorySnapshotRestoreFromPointRequestDto({
this.include = const [],
this.yuccaConfig,
});
List<String> include;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? yuccaConfig;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositorySnapshotRestoreFromPointRequestDto &&
_deepEquality.equals(other.include, include) &&
other.yuccaConfig == yuccaConfig;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(include.hashCode) +
(yuccaConfig == null ? 0 : yuccaConfig!.hashCode);
@override
String toString() => 'RepositorySnapshotRestoreFromPointRequestDto[include=$include, yuccaConfig=$yuccaConfig]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'include'] = this.include;
if (this.yuccaConfig != null) {
json[r'yuccaConfig'] = this.yuccaConfig;
} else {
// json[r'yuccaConfig'] = null;
}
return json;
}
/// Returns a new [RepositorySnapshotRestoreFromPointRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositorySnapshotRestoreFromPointRequestDto? fromJson(dynamic value) {
upgradeDto(value, "RepositorySnapshotRestoreFromPointRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositorySnapshotRestoreFromPointRequestDto(
include: json[r'include'] is Iterable
? (json[r'include'] as Iterable).cast<String>().toList(growable: false)
: const [],
yuccaConfig: mapValueOfType<String>(json, r'yuccaConfig'),
);
}
return null;
}
static List<RepositorySnapshotRestoreFromPointRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositorySnapshotRestoreFromPointRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositorySnapshotRestoreFromPointRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositorySnapshotRestoreFromPointRequestDto> mapFromJson(dynamic json) {
final map = <String, RepositorySnapshotRestoreFromPointRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositorySnapshotRestoreFromPointRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositorySnapshotRestoreFromPointRequestDto-objects as value to a dart map
static Map<String, List<RepositorySnapshotRestoreFromPointRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositorySnapshotRestoreFromPointRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositorySnapshotRestoreFromPointRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,117 @@
//
// 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 RepositorySnapshotRestoreRequestDto {
/// Returns a new [RepositorySnapshotRestoreRequestDto] instance.
RepositorySnapshotRestoreRequestDto({
this.include = const [],
this.target,
});
List<String> include;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? target;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositorySnapshotRestoreRequestDto &&
_deepEquality.equals(other.include, include) &&
other.target == target;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(include.hashCode) +
(target == null ? 0 : target!.hashCode);
@override
String toString() => 'RepositorySnapshotRestoreRequestDto[include=$include, target=$target]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'include'] = this.include;
if (this.target != null) {
json[r'target'] = this.target;
} else {
// json[r'target'] = null;
}
return json;
}
/// Returns a new [RepositorySnapshotRestoreRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositorySnapshotRestoreRequestDto? fromJson(dynamic value) {
upgradeDto(value, "RepositorySnapshotRestoreRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositorySnapshotRestoreRequestDto(
include: json[r'include'] is Iterable
? (json[r'include'] as Iterable).cast<String>().toList(growable: false)
: const [],
target: mapValueOfType<String>(json, r'target'),
);
}
return null;
}
static List<RepositorySnapshotRestoreRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositorySnapshotRestoreRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositorySnapshotRestoreRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositorySnapshotRestoreRequestDto> mapFromJson(dynamic json) {
final map = <String, RepositorySnapshotRestoreRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositorySnapshotRestoreRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositorySnapshotRestoreRequestDto-objects as value to a dart map
static Map<String, List<RepositorySnapshotRestoreRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositorySnapshotRestoreRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositorySnapshotRestoreRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,117 @@
//
// 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 RepositoryUpdateRequestDto {
/// Returns a new [RepositoryUpdateRequestDto] instance.
RepositoryUpdateRequestDto({
this.name,
this.paths = const [],
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? name;
List<String> paths;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryUpdateRequestDto &&
other.name == name &&
_deepEquality.equals(other.paths, paths);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(name == null ? 0 : name!.hashCode) +
(paths.hashCode);
@override
String toString() => 'RepositoryUpdateRequestDto[name=$name, paths=$paths]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.name != null) {
json[r'name'] = this.name;
} else {
// json[r'name'] = null;
}
json[r'paths'] = this.paths;
return json;
}
/// Returns a new [RepositoryUpdateRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryUpdateRequestDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryUpdateRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryUpdateRequestDto(
name: mapValueOfType<String>(json, r'name'),
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<RepositoryUpdateRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryUpdateRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryUpdateRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryUpdateRequestDto> mapFromJson(dynamic json) {
final map = <String, RepositoryUpdateRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryUpdateRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryUpdateRequestDto-objects as value to a dart map
static Map<String, List<RepositoryUpdateRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryUpdateRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryUpdateRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

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 RepositoryUpdateResponseDto {
/// Returns a new [RepositoryUpdateResponseDto] instance.
RepositoryUpdateResponseDto({
required this.repository,
});
LocalRepositoryDto repository;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryUpdateResponseDto &&
other.repository == repository;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(repository.hashCode);
@override
String toString() => 'RepositoryUpdateResponseDto[repository=$repository]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'repository'] = this.repository;
return json;
}
/// Returns a new [RepositoryUpdateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RepositoryUpdateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RepositoryUpdateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RepositoryUpdateResponseDto(
repository: LocalRepositoryDto.fromJson(json[r'repository'])!,
);
}
return null;
}
static List<RepositoryUpdateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RepositoryUpdateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RepositoryUpdateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RepositoryUpdateResponseDto> mapFromJson(dynamic json) {
final map = <String, RepositoryUpdateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RepositoryUpdateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RepositoryUpdateResponseDto-objects as value to a dart map
static Map<String, List<RepositoryUpdateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RepositoryUpdateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RepositoryUpdateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'repository',
};
}

131
mobile/openapi/lib/model/run_dto.dart generated Normal file
View File

@ -0,0 +1,131 @@
//
// 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 RunDto {
/// Returns a new [RunDto] instance.
RunDto({
required this.end,
required this.id,
required this.logFilePath,
required this.start,
required this.status,
});
String end;
String id;
String logFilePath;
String start;
RunStatus status;
@override
bool operator ==(Object other) => identical(this, other) || other is RunDto &&
other.end == end &&
other.id == id &&
other.logFilePath == logFilePath &&
other.start == start &&
other.status == status;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(end.hashCode) +
(id.hashCode) +
(logFilePath.hashCode) +
(start.hashCode) +
(status.hashCode);
@override
String toString() => 'RunDto[end=$end, id=$id, logFilePath=$logFilePath, start=$start, status=$status]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'end'] = this.end;
json[r'id'] = this.id;
json[r'logFilePath'] = this.logFilePath;
json[r'start'] = this.start;
json[r'status'] = this.status;
return json;
}
/// Returns a new [RunDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RunDto? fromJson(dynamic value) {
upgradeDto(value, "RunDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RunDto(
end: mapValueOfType<String>(json, r'end')!,
id: mapValueOfType<String>(json, r'id')!,
logFilePath: mapValueOfType<String>(json, r'logFilePath')!,
start: mapValueOfType<String>(json, r'start')!,
status: RunStatus.fromJson(json[r'status'])!,
);
}
return null;
}
static List<RunDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RunDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RunDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RunDto> mapFromJson(dynamic json) {
final map = <String, RunDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RunDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RunDto-objects as value to a dart map
static Map<String, List<RunDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RunDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RunDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'end',
'id',
'logFilePath',
'start',
'status',
};
}

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 RunHistoryResponseDto {
/// Returns a new [RunHistoryResponseDto] instance.
RunHistoryResponseDto({
this.runs = const [],
});
List<RunDto> runs;
@override
bool operator ==(Object other) => identical(this, other) || other is RunHistoryResponseDto &&
_deepEquality.equals(other.runs, runs);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(runs.hashCode);
@override
String toString() => 'RunHistoryResponseDto[runs=$runs]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'runs'] = this.runs;
return json;
}
/// Returns a new [RunHistoryResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RunHistoryResponseDto? fromJson(dynamic value) {
upgradeDto(value, "RunHistoryResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RunHistoryResponseDto(
runs: RunDto.listFromJson(json[r'runs']),
);
}
return null;
}
static List<RunHistoryResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RunHistoryResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RunHistoryResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RunHistoryResponseDto> mapFromJson(dynamic json) {
final map = <String, RunHistoryResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RunHistoryResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RunHistoryResponseDto-objects as value to a dart map
static Map<String, List<RunHistoryResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RunHistoryResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RunHistoryResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'runs',
};
}

88
mobile/openapi/lib/model/run_status.dart generated Normal file
View File

@ -0,0 +1,88 @@
//
// 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 RunStatus {
/// Instantiate a new enum with the provided [value].
const RunStatus._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const incomplete = RunStatus._(r'incomplete');
static const complete = RunStatus._(r'complete');
static const failed = RunStatus._(r'failed');
/// List of all possible values in this [enum][RunStatus].
static const values = <RunStatus>[
incomplete,
complete,
failed,
];
static RunStatus? fromJson(dynamic value) => RunStatusTypeTransformer().decode(value);
static List<RunStatus> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RunStatus>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RunStatus.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [RunStatus] to String,
/// and [decode] dynamic data back to [RunStatus].
class RunStatusTypeTransformer {
factory RunStatusTypeTransformer() => _instance ??= const RunStatusTypeTransformer._();
const RunStatusTypeTransformer._();
String encode(RunStatus data) => data.value;
/// Decodes a [dynamic value][data] to a RunStatus.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
RunStatus? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'incomplete': return RunStatus.incomplete;
case r'complete': return RunStatus.complete;
case r'failed': return RunStatus.failed;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [RunStatusTypeTransformer] instance.
static RunStatusTypeTransformer? _instance;
}

View File

@ -0,0 +1,131 @@
//
// 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 RunningTaskDto {
/// Returns a new [RunningTaskDto] instance.
RunningTaskDto({
this.logId,
required this.parentId,
this.scheduleStatus = const [],
required this.type,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? logId;
String parentId;
List<ActiveScheduleItemDto> scheduleStatus;
TaskType type;
@override
bool operator ==(Object other) => identical(this, other) || other is RunningTaskDto &&
other.logId == logId &&
other.parentId == parentId &&
_deepEquality.equals(other.scheduleStatus, scheduleStatus) &&
other.type == type;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(logId == null ? 0 : logId!.hashCode) +
(parentId.hashCode) +
(scheduleStatus.hashCode) +
(type.hashCode);
@override
String toString() => 'RunningTaskDto[logId=$logId, parentId=$parentId, scheduleStatus=$scheduleStatus, type=$type]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.logId != null) {
json[r'logId'] = this.logId;
} else {
// json[r'logId'] = null;
}
json[r'parentId'] = this.parentId;
json[r'scheduleStatus'] = this.scheduleStatus;
json[r'type'] = this.type;
return json;
}
/// Returns a new [RunningTaskDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RunningTaskDto? fromJson(dynamic value) {
upgradeDto(value, "RunningTaskDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RunningTaskDto(
logId: mapValueOfType<String>(json, r'logId'),
parentId: mapValueOfType<String>(json, r'parentId')!,
scheduleStatus: ActiveScheduleItemDto.listFromJson(json[r'scheduleStatus']),
type: TaskType.fromJson(json[r'type'])!,
);
}
return null;
}
static List<RunningTaskDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RunningTaskDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RunningTaskDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RunningTaskDto> mapFromJson(dynamic json) {
final map = <String, RunningTaskDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RunningTaskDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RunningTaskDto-objects as value to a dart map
static Map<String, List<RunningTaskDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RunningTaskDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RunningTaskDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'parentId',
'type',
};
}

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 RunningTaskListResponse {
/// Returns a new [RunningTaskListResponse] instance.
RunningTaskListResponse({
this.tasks = const [],
});
List<RunningTaskDto> tasks;
@override
bool operator ==(Object other) => identical(this, other) || other is RunningTaskListResponse &&
_deepEquality.equals(other.tasks, tasks);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(tasks.hashCode);
@override
String toString() => 'RunningTaskListResponse[tasks=$tasks]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'tasks'] = this.tasks;
return json;
}
/// Returns a new [RunningTaskListResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RunningTaskListResponse? fromJson(dynamic value) {
upgradeDto(value, "RunningTaskListResponse");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RunningTaskListResponse(
tasks: RunningTaskDto.listFromJson(json[r'tasks']),
);
}
return null;
}
static List<RunningTaskListResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RunningTaskListResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RunningTaskListResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RunningTaskListResponse> mapFromJson(dynamic json) {
final map = <String, RunningTaskListResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RunningTaskListResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RunningTaskListResponse-objects as value to a dart map
static Map<String, List<RunningTaskListResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RunningTaskListResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RunningTaskListResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'tasks',
};
}

View File

@ -0,0 +1,117 @@
//
// 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 ScheduleCreateRequestDto {
/// Returns a new [ScheduleCreateRequestDto] instance.
ScheduleCreateRequestDto({
required this.cron,
required this.name,
this.repositories = const [],
});
String cron;
String name;
List<String> repositories;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleCreateRequestDto &&
other.cron == cron &&
other.name == name &&
_deepEquality.equals(other.repositories, repositories);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(cron.hashCode) +
(name.hashCode) +
(repositories.hashCode);
@override
String toString() => 'ScheduleCreateRequestDto[cron=$cron, name=$name, repositories=$repositories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'cron'] = this.cron;
json[r'name'] = this.name;
json[r'repositories'] = this.repositories;
return json;
}
/// Returns a new [ScheduleCreateRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleCreateRequestDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleCreateRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleCreateRequestDto(
cron: mapValueOfType<String>(json, r'cron')!,
name: mapValueOfType<String>(json, r'name')!,
repositories: json[r'repositories'] is Iterable
? (json[r'repositories'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<ScheduleCreateRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleCreateRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleCreateRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleCreateRequestDto> mapFromJson(dynamic json) {
final map = <String, ScheduleCreateRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleCreateRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleCreateRequestDto-objects as value to a dart map
static Map<String, List<ScheduleCreateRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleCreateRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleCreateRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'cron',
'name',
'repositories',
};
}

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 ScheduleCreateResponseDto {
/// Returns a new [ScheduleCreateResponseDto] instance.
ScheduleCreateResponseDto({
required this.schedule,
});
ScheduleDto schedule;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleCreateResponseDto &&
other.schedule == schedule;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(schedule.hashCode);
@override
String toString() => 'ScheduleCreateResponseDto[schedule=$schedule]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'schedule'] = this.schedule;
return json;
}
/// Returns a new [ScheduleCreateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleCreateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleCreateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleCreateResponseDto(
schedule: ScheduleDto.fromJson(json[r'schedule'])!,
);
}
return null;
}
static List<ScheduleCreateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleCreateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleCreateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleCreateResponseDto> mapFromJson(dynamic json) {
final map = <String, ScheduleCreateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleCreateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleCreateResponseDto-objects as value to a dart map
static Map<String, List<ScheduleCreateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleCreateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleCreateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'schedule',
};
}

167
mobile/openapi/lib/model/schedule_dto.dart generated Normal file
View File

@ -0,0 +1,167 @@
//
// 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 ScheduleDto {
/// Returns a new [ScheduleDto] instance.
ScheduleDto({
required this.cron,
required this.id,
this.lastFinished,
this.lastRun,
required this.name,
required this.paused,
this.repositories = const [],
});
String cron;
String id;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? lastFinished;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? lastRun;
String name;
bool paused;
List<String> repositories;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleDto &&
other.cron == cron &&
other.id == id &&
other.lastFinished == lastFinished &&
other.lastRun == lastRun &&
other.name == name &&
other.paused == paused &&
_deepEquality.equals(other.repositories, repositories);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(cron.hashCode) +
(id.hashCode) +
(lastFinished == null ? 0 : lastFinished!.hashCode) +
(lastRun == null ? 0 : lastRun!.hashCode) +
(name.hashCode) +
(paused.hashCode) +
(repositories.hashCode);
@override
String toString() => 'ScheduleDto[cron=$cron, id=$id, lastFinished=$lastFinished, lastRun=$lastRun, name=$name, paused=$paused, repositories=$repositories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'cron'] = this.cron;
json[r'id'] = this.id;
if (this.lastFinished != null) {
json[r'lastFinished'] = this.lastFinished;
} else {
// json[r'lastFinished'] = null;
}
if (this.lastRun != null) {
json[r'lastRun'] = this.lastRun;
} else {
// json[r'lastRun'] = null;
}
json[r'name'] = this.name;
json[r'paused'] = this.paused;
json[r'repositories'] = this.repositories;
return json;
}
/// Returns a new [ScheduleDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleDto(
cron: mapValueOfType<String>(json, r'cron')!,
id: mapValueOfType<String>(json, r'id')!,
lastFinished: mapValueOfType<String>(json, r'lastFinished'),
lastRun: mapValueOfType<String>(json, r'lastRun'),
name: mapValueOfType<String>(json, r'name')!,
paused: mapValueOfType<bool>(json, r'paused')!,
repositories: json[r'repositories'] is Iterable
? (json[r'repositories'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<ScheduleDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleDto> mapFromJson(dynamic json) {
final map = <String, ScheduleDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleDto-objects as value to a dart map
static Map<String, List<ScheduleDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'cron',
'id',
'name',
'paused',
'repositories',
};
}

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 ScheduleListResponseDto {
/// Returns a new [ScheduleListResponseDto] instance.
ScheduleListResponseDto({
this.schedules = const [],
});
List<ScheduleDto> schedules;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleListResponseDto &&
_deepEquality.equals(other.schedules, schedules);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(schedules.hashCode);
@override
String toString() => 'ScheduleListResponseDto[schedules=$schedules]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'schedules'] = this.schedules;
return json;
}
/// Returns a new [ScheduleListResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleListResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleListResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleListResponseDto(
schedules: ScheduleDto.listFromJson(json[r'schedules']),
);
}
return null;
}
static List<ScheduleListResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleListResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleListResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleListResponseDto> mapFromJson(dynamic json) {
final map = <String, ScheduleListResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleListResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleListResponseDto-objects as value to a dart map
static Map<String, List<ScheduleListResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleListResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleListResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'schedules',
};
}

View File

@ -0,0 +1,151 @@
//
// 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 ScheduleUpdateRequestDto {
/// Returns a new [ScheduleUpdateRequestDto] instance.
ScheduleUpdateRequestDto({
this.cron,
this.name,
this.paused,
this.repositories = const [],
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? cron;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? name;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? paused;
List<String> repositories;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleUpdateRequestDto &&
other.cron == cron &&
other.name == name &&
other.paused == paused &&
_deepEquality.equals(other.repositories, repositories);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(cron == null ? 0 : cron!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(paused == null ? 0 : paused!.hashCode) +
(repositories.hashCode);
@override
String toString() => 'ScheduleUpdateRequestDto[cron=$cron, name=$name, paused=$paused, repositories=$repositories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.cron != null) {
json[r'cron'] = this.cron;
} else {
// json[r'cron'] = null;
}
if (this.name != null) {
json[r'name'] = this.name;
} else {
// json[r'name'] = null;
}
if (this.paused != null) {
json[r'paused'] = this.paused;
} else {
// json[r'paused'] = null;
}
json[r'repositories'] = this.repositories;
return json;
}
/// Returns a new [ScheduleUpdateRequestDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleUpdateRequestDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleUpdateRequestDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleUpdateRequestDto(
cron: mapValueOfType<String>(json, r'cron'),
name: mapValueOfType<String>(json, r'name'),
paused: mapValueOfType<bool>(json, r'paused'),
repositories: json[r'repositories'] is Iterable
? (json[r'repositories'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<ScheduleUpdateRequestDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleUpdateRequestDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleUpdateRequestDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleUpdateRequestDto> mapFromJson(dynamic json) {
final map = <String, ScheduleUpdateRequestDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleUpdateRequestDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleUpdateRequestDto-objects as value to a dart map
static Map<String, List<ScheduleUpdateRequestDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleUpdateRequestDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleUpdateRequestDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

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 ScheduleUpdateResponseDto {
/// Returns a new [ScheduleUpdateResponseDto] instance.
ScheduleUpdateResponseDto({
required this.schedule,
});
ScheduleDto schedule;
@override
bool operator ==(Object other) => identical(this, other) || other is ScheduleUpdateResponseDto &&
other.schedule == schedule;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(schedule.hashCode);
@override
String toString() => 'ScheduleUpdateResponseDto[schedule=$schedule]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'schedule'] = this.schedule;
return json;
}
/// Returns a new [ScheduleUpdateResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ScheduleUpdateResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ScheduleUpdateResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleUpdateResponseDto(
schedule: ScheduleDto.fromJson(json[r'schedule'])!,
);
}
return null;
}
static List<ScheduleUpdateResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ScheduleUpdateResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleUpdateResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ScheduleUpdateResponseDto> mapFromJson(dynamic json) {
final map = <String, ScheduleUpdateResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ScheduleUpdateResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ScheduleUpdateResponseDto-objects as value to a dart map
static Map<String, List<ScheduleUpdateResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ScheduleUpdateResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ScheduleUpdateResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'schedule',
};
}

117
mobile/openapi/lib/model/snapshot_dto.dart generated Normal file
View File

@ -0,0 +1,117 @@
//
// 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 SnapshotDto {
/// Returns a new [SnapshotDto] instance.
SnapshotDto({
required this.id,
this.paths = const [],
required this.time,
});
String id;
List<String> paths;
String time;
@override
bool operator ==(Object other) => identical(this, other) || other is SnapshotDto &&
other.id == id &&
_deepEquality.equals(other.paths, paths) &&
other.time == time;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(paths.hashCode) +
(time.hashCode);
@override
String toString() => 'SnapshotDto[id=$id, paths=$paths, time=$time]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'id'] = this.id;
json[r'paths'] = this.paths;
json[r'time'] = this.time;
return json;
}
/// Returns a new [SnapshotDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SnapshotDto? fromJson(dynamic value) {
upgradeDto(value, "SnapshotDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return SnapshotDto(
id: mapValueOfType<String>(json, r'id')!,
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
time: mapValueOfType<String>(json, r'time')!,
);
}
return null;
}
static List<SnapshotDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SnapshotDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SnapshotDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SnapshotDto> mapFromJson(dynamic json) {
final map = <String, SnapshotDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SnapshotDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SnapshotDto-objects as value to a dart map
static Map<String, List<SnapshotDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SnapshotDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = SnapshotDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'paths',
'time',
};
}

View File

@ -0,0 +1,88 @@
//
// 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 TaskStatus {
/// Instantiate a new enum with the provided [value].
const TaskStatus._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const incomplete = TaskStatus._(r'incomplete');
static const complete = TaskStatus._(r'complete');
static const failed = TaskStatus._(r'failed');
/// List of all possible values in this [enum][TaskStatus].
static const values = <TaskStatus>[
incomplete,
complete,
failed,
];
static TaskStatus? fromJson(dynamic value) => TaskStatusTypeTransformer().decode(value);
static List<TaskStatus> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TaskStatus>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TaskStatus.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [TaskStatus] to String,
/// and [decode] dynamic data back to [TaskStatus].
class TaskStatusTypeTransformer {
factory TaskStatusTypeTransformer() => _instance ??= const TaskStatusTypeTransformer._();
const TaskStatusTypeTransformer._();
String encode(TaskStatus data) => data.value;
/// Decodes a [dynamic value][data] to a TaskStatus.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
TaskStatus? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'incomplete': return TaskStatus.incomplete;
case r'complete': return TaskStatus.complete;
case r'failed': return TaskStatus.failed;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [TaskStatusTypeTransformer] instance.
static TaskStatusTypeTransformer? _instance;
}

91
mobile/openapi/lib/model/task_type.dart generated Normal file
View File

@ -0,0 +1,91 @@
//
// 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 TaskType {
/// Instantiate a new enum with the provided [value].
const TaskType._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const schedule = TaskType._(r'schedule');
static const restore = TaskType._(r'restore');
static const backup = TaskType._(r'backup');
static const forget = TaskType._(r'forget');
/// List of all possible values in this [enum][TaskType].
static const values = <TaskType>[
schedule,
restore,
backup,
forget,
];
static TaskType? fromJson(dynamic value) => TaskTypeTypeTransformer().decode(value);
static List<TaskType> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TaskType>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TaskType.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [TaskType] to String,
/// and [decode] dynamic data back to [TaskType].
class TaskTypeTypeTransformer {
factory TaskTypeTypeTransformer() => _instance ??= const TaskTypeTypeTransformer._();
const TaskTypeTypeTransformer._();
String encode(TaskType data) => data.value;
/// Decodes a [dynamic value][data] to a TaskType.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
TaskType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'schedule': return TaskType.schedule;
case r'restore': return TaskType.restore;
case r'backup': return TaskType.backup;
case r'forget': return TaskType.forget;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [TaskTypeTypeTransformer] instance.
static TaskTypeTypeTransformer? _instance;
}

File diff suppressed because it is too large Load Diff

View File

@ -2877,6 +2877,206 @@ export type WorkflowUpdateDto = {
name?: string;
triggerType?: PluginTriggerType;
};
export type BackendDto = {
error?: string;
id: string;
isOnline: boolean;
"type": BackendType;
};
export type BackendsResponseDto = {
backends: BackendDto[];
};
export type CreateLocalBackendRequestDto = {
path: string;
};
export type BackendResponseDto = {
backend: BackendDto;
};
export type FilesystemListingItemDto = {
isDirectory: boolean;
path: string;
};
export type FilesystemListingResponseDto = {
items: FilesystemListingItemDto[];
parent: string;
path: string;
};
export type ImmichIntegrationConfigurationDto = {
backupConfiguration: boolean;
dataFolders: string[];
libraries: "all" | string[];
};
export type ImmichIntegrationDto = {
configuration: ImmichIntegrationConfigurationDto;
id: string;
scheduleId: string;
};
export type ImmichLibraryDto = {
exclusionPatterns: string[];
id: string;
importPaths: string[];
name: string;
};
export type ImmichStateDto = {
dataFolders: string[];
dataPath: string;
libraries: ImmichLibraryDto[];
};
export type IntegrationsResponseDto = {
immichIntegration?: ImmichIntegrationDto;
immichState?: ImmichStateDto;
};
export type ConfigureImmichIntegrationRequestDto = {
backupConfiguration: boolean;
cron: string;
dataFolders: string[];
libraries: "all" | string[];
name: string;
worm: boolean;
};
export type OnboardingStatusResponseDto = {
hasBackend: boolean;
hasBackup: boolean;
hasOnboardedKey: boolean;
hasSchedule: boolean;
hasSkippedExtraConfig: boolean;
};
export type CurrentRecoveryKeyResponse = {
recoveryKey: string;
};
export type ImportRecoveryKeyRequest = {
recoveryKey: string;
};
export type RepositoryBackendDto = {
id: string;
online: boolean;
"type": BackendType;
};
export type RepositoryBackendsDto = {
primary: RepositoryBackendDto;
secondary: RepositoryBackendDto[];
};
export type RepositoryConfigurationDto = {
paths: string[];
};
export type RepositoryMetricsDto = {
lastBackup?: string;
lastBackupDuration?: number;
lastSuccessfulBackup?: string;
sizeBytes: number;
};
export type LocalRepositoryDto = {
backends?: RepositoryBackendsDto;
configuration?: RepositoryConfigurationDto;
id: string;
metrics: RepositoryMetricsDto;
name: string;
worm: boolean;
};
export type RepositoryListResponseDto = {
repositories: LocalRepositoryDto[];
};
export type RepositoryCreateRequestDto = {
name: string;
paths?: string[];
worm: boolean;
};
export type RepositoryCreateResponseDto = {
repository: LocalRepositoryDto;
};
export type SnapshotDto = {
id: string;
paths: string[];
time: string;
};
export type InspectedLocalRepositoryDto = {
backends?: RepositoryBackendsDto;
configuration?: RepositoryConfigurationDto;
id: string;
metrics: RepositoryMetricsDto;
name: string;
snapshots: SnapshotDto[];
worm: boolean;
};
export type RepositoryInspectResponseDto = {
repositories: InspectedLocalRepositoryDto[];
};
export type RepositoryUpdateRequestDto = {
name?: string;
paths?: string[];
};
export type RepositoryUpdateResponseDto = {
repository: LocalRepositoryDto;
};
export type LogResponseDto = {
logId: string;
};
export type RepositoryCheckImportResponseDto = {
readable: boolean;
};
export type RunDto = {
end: string;
id: string;
logFilePath: string;
start: string;
status: RunStatus;
};
export type RunHistoryResponseDto = {
runs: RunDto[];
};
export type ListSnapshotsResponseDto = {
snapshots: SnapshotDto[];
};
export type RepositorySnapshotRestoreRequestDto = {
include?: string[];
target?: string;
};
export type RepositorySnapshotRestoreFromPointRequestDto = {
include?: string[];
yuccaConfig?: string;
};
export type ScheduleDto = {
cron: string;
id: string;
lastFinished?: string;
lastRun?: string;
name: string;
paused: boolean;
repositories: string[];
};
export type ScheduleListResponseDto = {
schedules: ScheduleDto[];
};
export type ScheduleCreateRequestDto = {
cron: string;
name: string;
repositories: string[];
};
export type ScheduleCreateResponseDto = {
schedule: ScheduleDto;
};
export type ScheduleUpdateRequestDto = {
cron?: string;
name?: string;
paused?: boolean;
repositories?: string[];
};
export type ScheduleUpdateResponseDto = {
schedule: ScheduleDto;
};
export type ActiveScheduleItemDto = {
repositoryId: string;
status: TaskStatus;
};
export type RunningTaskDto = {
logId?: string;
parentId: string;
scheduleStatus?: ActiveScheduleItemDto[];
"type": TaskType;
};
export type RunningTaskListResponse = {
tasks: RunningTaskDto[];
};
export type LicenseResponseDto = UserLicense;
export type SyncAckV1 = {};
export type SyncAlbumDeleteV1 = {
@ -6755,6 +6955,348 @@ export function updateWorkflow({ id, workflowUpdateDto }: {
body: workflowUpdateDto
})));
}
export function oidcCallback(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/auth/oidc/callback", {
...opts
}));
}
export function oidcAuthorize({ next }: {
next: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText(`/yucca/auth/oidc/login${QS.query(QS.explode({
next
}))}`, {
...opts
}));
}
export function getBackends(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: BackendsResponseDto;
}>("/yucca/backend", {
...opts
}));
}
export function createLocalBackend({ createLocalBackendRequestDto }: {
createLocalBackendRequestDto: CreateLocalBackendRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: BackendResponseDto;
}>("/yucca/backend/local", oazapfts.json({
...opts,
method: "POST",
body: createLocalBackendRequestDto
})));
}
export function resetOrchestrator(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/debug/reset", {
...opts,
method: "POST"
}));
}
export function getFileListing({ path }: {
path?: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: FilesystemListingResponseDto;
}>(`/yucca/fs${QS.query(QS.explode({
path
}))}`, {
...opts
}));
}
export function getIntegrations(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: IntegrationsResponseDto;
}>("/yucca/integrations", {
...opts
}));
}
export function configureImmichIntegration({ configureImmichIntegrationRequestDto }: {
configureImmichIntegrationRequestDto: ConfigureImmichIntegrationRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/integrations/immich", oazapfts.json({
...opts,
method: "POST",
body: configureImmichIntegrationRequestDto
})));
}
export function logStreamSse({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText(`/yucca/logs/${encodeURIComponent(id)}`, {
...opts
}));
}
export function onboardingStatus(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: OnboardingStatusResponseDto;
}>("/yucca/onboarding", {
...opts
}));
}
export function currentRecoveryKey(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: CurrentRecoveryKeyResponse;
}>("/yucca/onboarding/recovery-key", {
...opts
}));
}
export function confirmRecoveryKey(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/onboarding/recovery-key", {
...opts,
method: "POST"
}));
}
export function importRecoveryKey({ importRecoveryKeyRequest }: {
importRecoveryKeyRequest: ImportRecoveryKeyRequest;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/onboarding/recovery-key", oazapfts.json({
...opts,
method: "PUT",
body: importRecoveryKeyRequest
})));
}
export function skipOnboardingExtraConfig(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/yucca/onboarding/skip", {
...opts,
method: "POST"
}));
}
export function getRepositories(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryListResponseDto;
}>("/yucca/repository", {
...opts
}));
}
export function createRepository({ backend, repositoryCreateRequestDto }: {
backend?: string;
repositoryCreateRequestDto: RepositoryCreateRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryCreateResponseDto;
}>(`/yucca/repository${QS.query(QS.explode({
backend
}))}`, oazapfts.json({
...opts,
method: "POST",
body: repositoryCreateRequestDto
})));
}
export function inspectRepositories(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryInspectResponseDto;
}>("/yucca/repository/inspect", {
...opts
}));
}
export function updateRepository({ backend, id, repositoryUpdateRequestDto }: {
backend?: string;
id: string;
repositoryUpdateRequestDto: RepositoryUpdateRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryUpdateResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}${QS.query(QS.explode({
backend
}))}`, oazapfts.json({
...opts,
method: "PATCH",
body: repositoryUpdateRequestDto
})));
}
export function createBackup({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: LogResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}`, {
...opts,
method: "POST"
}));
}
export function checkImportRepository({ backend, id }: {
backend: string;
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryCheckImportResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/import${QS.query(QS.explode({
backend
}))}`, {
...opts
}));
}
export function importRepository({ backend, id }: {
backend: string;
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RepositoryCreateResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/import${QS.query(QS.explode({
backend
}))}`, {
...opts,
method: "POST"
}));
}
export function getRunHistory({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RunHistoryResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/runs`, {
...opts
}));
}
export function getSnapshots({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ListSnapshotsResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/snapshots`, {
...opts
}));
}
export function forgetSnapshot({ id, snapshot }: {
id: string;
snapshot: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ListSnapshotsResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}`, {
...opts,
method: "DELETE"
}));
}
export function restoreSnapshot({ id, snapshot, repositorySnapshotRestoreRequestDto }: {
id: string;
snapshot: string;
repositorySnapshotRestoreRequestDto: RepositorySnapshotRestoreRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: LogResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}`, oazapfts.json({
...opts,
method: "POST",
body: repositorySnapshotRestoreRequestDto
})));
}
export function getSnapshotListing({ id, path, snapshot }: {
id: string;
path?: string;
snapshot: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: FilesystemListingResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}/listing${QS.query(QS.explode({
path
}))}`, {
...opts
}));
}
export function restoreFromPoint({ backend, id, snapshot, repositorySnapshotRestoreFromPointRequestDto }: {
backend: string;
id: string;
snapshot: string;
repositorySnapshotRestoreFromPointRequestDto: RepositorySnapshotRestoreFromPointRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: LogResponseDto;
}>(`/yucca/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}/restore-from-point${QS.query(QS.explode({
backend
}))}`, oazapfts.json({
...opts,
method: "POST",
body: repositorySnapshotRestoreFromPointRequestDto
})));
}
export function getSchedules(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ScheduleListResponseDto;
}>("/yucca/schedule", {
...opts
}));
}
export function createSchedule({ scheduleCreateRequestDto }: {
scheduleCreateRequestDto: ScheduleCreateRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ScheduleCreateResponseDto;
}>("/yucca/schedule", oazapfts.json({
...opts,
method: "POST",
body: scheduleCreateRequestDto
})));
}
export function removeSchedule({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText(`/yucca/schedule/${encodeURIComponent(id)}`, {
...opts,
method: "DELETE"
}));
}
export function updateSchedule({ id, scheduleUpdateRequestDto }: {
id: string;
scheduleUpdateRequestDto: ScheduleUpdateRequestDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ScheduleUpdateResponseDto;
}>(`/yucca/schedule/${encodeURIComponent(id)}`, oazapfts.json({
...opts,
method: "PATCH",
body: scheduleUpdateRequestDto
})));
}
export function removeRepositoryFromSchedule({ id, repositoryId }: {
id: string;
repositoryId: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText(`/yucca/schedule/${encodeURIComponent(id)}/${encodeURIComponent(repositoryId)}`, {
...opts,
method: "DELETE"
}));
}
export function addRepositoryToSchedule({ id, repositoryId }: {
id: string;
repositoryId: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText(`/yucca/schedule/${encodeURIComponent(id)}/${encodeURIComponent(repositoryId)}`, {
...opts,
method: "PUT"
}));
}
export function getRunningTasks(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: RunningTaskListResponse;
}>("/yucca/tasks", {
...opts
}));
}
export enum ReactionLevel {
Album = "album",
Asset = "asset"
@ -7319,6 +7861,27 @@ export enum OAuthTokenEndpointAuthMethod {
ClientSecretPost = "client_secret_post",
ClientSecretBasic = "client_secret_basic"
}
export enum BackendType {
Yucca = "yucca",
Local = "local",
S3 = "s3"
}
export enum RunStatus {
Incomplete = "incomplete",
Complete = "complete",
Failed = "failed"
}
export enum TaskStatus {
Incomplete = "incomplete",
Complete = "complete",
Failed = "failed"
}
export enum TaskType {
Schedule = "schedule",
Restore = "restore",
Backup = "backup",
Forget = "forget"
}
export enum UserMetadataKey {
Preferences = "preferences",
License = "license",

502
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,9 @@ packages:
- plugins
- web
- .github
dedupePeerDependents: false
ignoredBuiltDependencies:
- '@nestjs/core'
- '@parcel/watcher'
@ -25,42 +28,49 @@ ignoredBuiltDependencies:
- protobufjs
- ssh2
- utimes
injectWorkspacePackages: true
onlyBuiltDependencies:
- sharp
- '@tailwindcss/oxide'
- bcrypt
- better-sqlite3
- sharp
overrides:
canvas: 2.11.2
sharp: ^0.34.5
packageExtensions:
nestjs-kysely:
'@immich/ui':
dependencies:
tslib: '*'
nestjs-otel:
dependencies:
tslib: '*'
tailwindcss: '>=4.1'
'@photo-sphere-viewer/equirectangular-video-adapter':
dependencies:
three: '*'
'@photo-sphere-viewer/video-plugin':
dependencies:
three: '*'
sharp:
dependencies:
node-addon-api: '*'
node-gyp: '*'
'@immich/ui':
dependencies:
tailwindcss: '>=4.1'
tailwind-variants:
dependencies:
tailwindcss: '>=4.1'
bcrypt:
dependencies:
node-addon-api: '*'
node-gyp: '*'
dedupePeerDependents: false
nestjs-kysely:
dependencies:
tslib: '*'
nestjs-otel:
dependencies:
tslib: '*'
sharp:
dependencies:
node-addon-api: '*'
node-gyp: '*'
tailwind-variants:
dependencies:
tailwindcss: '>=4.1'
preferWorkspacePackages: true
injectWorkspacePackages: true
shamefullyHoist: false
verifyDepsBeforeRun: install

View File

@ -7,7 +7,8 @@ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
RUN npm install --global corepack@latest && \
corepack enable pnpm && \
pnpm config set store-dir "$PNPM_HOME"
pnpm config set store-dir "$PNPM_HOME" && \
pnpm config set registry https://npm.raccoon.sh
FROM builder AS server
@ -104,6 +105,8 @@ ENV IMMICH_SOURCE_REF=${BUILD_SOURCE_REF}
ENV IMMICH_SOURCE_COMMIT=${BUILD_SOURCE_COMMIT}
ENV IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/${BUILD_SOURCE_COMMIT}
RUN apt-get update && apt-get install -y restic
VOLUME /data
EXPOSE 2283
ENTRYPOINT ["tini", "--", "/bin/bash", "-c"]

View File

@ -28,7 +28,7 @@ FROM dev AS dev-container-server
RUN apt-get update --allow-releaseinfo-change && \
apt-get install inetutils-ping openjdk-21-jre-headless \
vim nano curl \
vim nano curl restic \
-y --no-install-recommends --fix-missing
RUN mkdir -p /workspaces && \

View File

@ -99,6 +99,7 @@
"nodemailer": "^8.0.0",
"nestjs-zod": "^5.3.0",
"openid-client": "^6.3.3",
"orchestration-api": "0.1.54",
"pg": "^8.11.3",
"pg-connection-string": "^2.9.1",
"picomatch": "^4.0.2",

View File

@ -6,6 +6,7 @@ import { ClsModule } from 'nestjs-cls';
import { KyselyModule } from 'nestjs-kysely';
import { OpenTelemetryModule } from 'nestjs-otel';
import { ZodSerializerInterceptor, ZodValidationPipe } from 'nestjs-zod';
import { OrchestrationApiModule } from 'orchestration-api/dist';
import { commandsAndQuestions } from 'src/commands';
import { IWorker } from 'src/constants';
import { controllers } from 'src/controllers';
@ -20,6 +21,7 @@ import { ErrorInterceptor } from 'src/middleware/error.interceptor';
import { FileUploadInterceptor } from 'src/middleware/file-upload.interceptor';
import { GlobalExceptionFilter } from 'src/middleware/global-exception.filter';
import { LoggingInterceptor } from 'src/middleware/logging.interceptor';
import { YuccaAdminGuard } from 'src/middleware/yucca-admin.guard';
import { repositories } from 'src/repositories';
import { AppRepository } from 'src/repositories/app.repository';
import { ConfigRepository } from 'src/repositories/config.repository';
@ -50,7 +52,12 @@ const commonMiddleware = [
{ provide: APP_INTERCEPTOR, useClass: ErrorInterceptor },
];
const apiMiddleware = [FileUploadInterceptor, ...commonMiddleware, { provide: APP_GUARD, useClass: AuthGuard }];
const apiMiddleware = [
FileUploadInterceptor,
...commonMiddleware,
{ provide: APP_GUARD, useClass: YuccaAdminGuard },
{ provide: APP_GUARD, useClass: AuthGuard },
];
const configRepository = new ConfigRepository();
const { bull, cls, database, otel } = configRepository.getEnv();
@ -102,14 +109,37 @@ export class BaseModule implements OnModuleInit, OnModuleDestroy {
}
@Module({
imports: [...bullImports, ...commonImports, ScheduleModule.forRoot()],
imports: [
...bullImports,
...commonImports,
ScheduleModule.forRoot(),
OrchestrationApiModule.forRoot({
// TODO: db init must happen elsewhere...
yuccaProductionApi: 'https://staging.fubar.computer',
// yuccaProductionApi: 'http://100.64.0.6:5173', // TODO
statePath: '/yucca', // TODO
requireWsAuth: true,
requireLock: true,
}),
],
controllers: [...controllers],
providers: [...common, ...apiMiddleware, { provide: IWorker, useValue: ImmichWorker.Api }],
})
export class ApiModule extends BaseModule {}
@Module({
imports: [...commonImports],
imports: [
...commonImports,
OrchestrationApiModule.forRoot({
yuccaProductionApi: 'https://staging.fubar.computer',
// yuccaProductionApi: 'http://100.64.0.6:5173', // TODO
statePath: '/yucca', // TODO
externalBaseUrl: 'https://my.immich.app',
requireWsAuth: true,
requireLock: true,
}),
],
controllers: [MaintenanceWorkerController],
providers: [
ConfigRepository,

View File

@ -879,6 +879,7 @@ export enum DatabaseLock {
MaintenanceOperation = 621,
MemoryCreation = 777,
VersionCheck = 800,
YuccaModuleConfig = 900,
}
export const DatabaseLockSchema = z.enum(DatabaseLock).describe('Database lock').meta({ id: 'DatabaseLock' });

View File

@ -125,7 +125,7 @@ class Workers {
}
onError(name: ImmichWorker, error: Error) {
console.error(`${name} worker error: ${error}, stack: ${error.stack}`);
console.error(`${name} worker error: ${JSON.stringify(error)}, stack: ${error.stack}`);
}
onExit(name: ImmichWorker, exitCode: number | null) {

View File

@ -41,16 +41,18 @@ export class MaintenanceAuthGuard implements CanActivate {
}
async canActivate(context: ExecutionContext): Promise<boolean> {
const request = context.switchToHttp().getRequest<MaintenanceAuthRequest>();
const targets = [context.getHandler()];
const options = this.reflector.getAllAndOverride<{ _emptyObject: never } | undefined>(
MetadataKey.AuthRoute,
targets,
);
if (!options) {
if (!options && !request.path.startsWith('/api/yucca')) {
return true;
}
const request = context.switchToHttp().getRequest<MaintenanceAuthRequest>();
request.auth = await this.service.authenticate(request.headers);
return true;

View File

@ -39,6 +39,10 @@ describe(MaintenanceWorkerService.name, () => {
strict: false,
});
const eventsGatewayMock = {
setAuthFn: vitest.fn(),
};
sut = new MaintenanceWorkerService(
mocks.logger as never,
mocks.app,
@ -50,6 +54,7 @@ describe(MaintenanceWorkerService.name, () => {
mocks.process,
mocks.database as never,
databaseBackupServiceMock,
eventsGatewayMock as never,
);
sut.mock({

View File

@ -4,6 +4,7 @@ import { NextFunction, Request, Response } from 'express';
import { jwtVerify } from 'jose';
import { readFileSync } from 'node:fs';
import { IncomingHttpHeaders } from 'node:http';
import { EventsGateway } from 'orchestration-api/dist';
import { serverVersion } from 'src/constants';
import { StorageCore } from 'src/cores/storage.core';
import {
@ -55,6 +56,7 @@ export class MaintenanceWorkerService {
private processRepository: ProcessRepository,
private databaseRepository: DatabaseRepository,
private databaseBackupService: DatabaseBackupService,
private readonly eventsGateway: EventsGateway,
) {
this.logger.setContext(this.constructor.name);
}
@ -77,6 +79,14 @@ export class MaintenanceWorkerService {
StorageCore.setMediaLocation(this.detectMediaLocation());
this.eventsGateway.setAuthFn(async (client) => {
await this.authenticate(client.request.headers);
return {
user: { isAdmin: true },
};
});
this.maintenanceWebsocketRepository.setAuthFn(async (client) => this.authenticate(client.request.headers));
this.maintenanceWebsocketRepository.setStatusUpdateFn((status) => (this.#status = status));

View File

@ -0,0 +1,23 @@
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { AuthRequest } from 'src/middleware/auth.guard';
import { AuthService } from 'src/services/auth.service';
@Injectable()
export class YuccaAdminGuard implements CanActivate {
constructor(private authService: AuthService) {}
async canActivate(context: ExecutionContext): Promise<boolean> {
const request = context.switchToHttp().getRequest<AuthRequest>();
if (!request.path.startsWith('/api/yucca')) {
return true;
}
request.user = await this.authService.authenticate({
headers: request.headers,
queryParams: request.query as Record<string, string>,
metadata: { adminRoute: true, sharedLinkRoute: false, uri: request.path },
});
return true;
}
}

View File

@ -1,6 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ModuleRef, Reflector } from '@nestjs/core';
import _ from 'lodash';
import { GatewayEvent as YuccaGatewayEvent } from 'orchestration-api/dist/events/events.gateway';
import { Socket } from 'socket.io';
import { SystemConfig } from 'src/config';
import { Asset } from 'src/database';
@ -67,6 +68,10 @@ type EventMap = {
/** job finishes with error */
JobError: [JobErrorEvent];
LibraryCreate: [];
LibraryUpdate: [];
LibraryDelete: [];
// queue events
QueueStart: [QueueStartEvent];
@ -94,6 +99,8 @@ type EventMap = {
// websocket events
WebsocketConnect: [{ userId: string }];
YuccaEvent: [YuccaGatewayEvent];
};
export type AppRestartEvent = {

View File

@ -16,7 +16,7 @@ import { AppRestartEvent, ArgsOf, EventRepository } from 'src/repositories/event
import { LoggingRepository } from 'src/repositories/logging.repository';
import { handlePromiseError } from 'src/utils/misc';
export const serverEvents = ['ConfigUpdate', 'AppRestart'] as const;
export const serverEvents = ['ConfigUpdate', 'AppRestart', 'YuccaEvent'] as const;
export type ServerEvents = (typeof serverEvents)[number];
export interface ClientEventMap {

View File

@ -46,6 +46,7 @@ import { UserService } from 'src/services/user.service';
import { VersionService } from 'src/services/version.service';
import { ViewService } from 'src/services/view.service';
import { WorkflowService } from 'src/services/workflow.service';
import { YuccaService } from 'src/services/yucca.service';
export const services = [
ApiKeyService,
@ -96,4 +97,5 @@ export const services = [
VersionService,
ViewService,
WorkflowService,
YuccaService,
];

View File

@ -242,6 +242,8 @@ export class LibraryService extends BaseService {
'**/.stfolder/**',
],
});
await this.eventRepository.emit('LibraryCreate');
return mapLibrary(library);
}
@ -343,6 +345,7 @@ export class LibraryService extends BaseService {
}
const library = await this.libraryRepository.update(id, dto);
await this.eventRepository.emit('LibraryUpdate');
return mapLibrary(library);
}
@ -355,6 +358,8 @@ export class LibraryService extends BaseService {
await this.libraryRepository.softDelete(id);
await this.jobRepository.queue({ name: JobName.LibraryDelete, data: { id } });
await this.eventRepository.emit('LibraryDelete');
}
@OnJob({ name: JobName.LibraryDelete, queue: QueueName.Library })

View File

@ -0,0 +1,113 @@
import { Injectable, OnModuleDestroy, OnModuleInit, Optional } from '@nestjs/common';
import { EventsGateway, ModuleConfigRepository } from 'orchestration-api/dist';
import { GatewayEvent } from 'orchestration-api/dist/events/events.gateway';
import { SystemConfig } from 'src/config';
import { StorageCore } from 'src/cores/storage.core';
import { OnEvent } from 'src/decorators';
import { DatabaseLock, ImmichWorker, StorageFolder } from 'src/enum';
import { DatabaseRepository } from 'src/repositories/database.repository';
import { ArgOf, EventRepository } from 'src/repositories/event.repository';
import { LibraryRepository } from 'src/repositories/library.repository';
import { LoggingRepository } from 'src/repositories/logging.repository';
import { WebsocketRepository } from 'src/repositories/websocket.repository';
import { AuthService } from 'src/services/auth.service';
import { getExternalDomain } from 'src/utils/misc';
@Injectable()
export class YuccaService implements OnModuleInit, OnModuleDestroy {
private lock = false;
constructor(
private readonly logger: LoggingRepository,
private readonly databaseRepository: DatabaseRepository,
private readonly libraryRepository: LibraryRepository,
private readonly authService: AuthService,
private readonly eventRepository: EventRepository,
private readonly websocketRepository: WebsocketRepository,
@Optional() private readonly moduleConfig: ModuleConfigRepository,
@Optional() private readonly eventsGateway: EventsGateway,
) {
this.onInternalEvent = this.onInternalEvent.bind(this);
}
onModuleInit() {
if (this.eventsGateway) {
this.eventsGateway.setAuthFn(async (client) =>
this.authService.authenticate({
headers: client.request.headers,
queryParams: {},
metadata: { adminRoute: true, sharedLinkRoute: false, uri: '/api/yucca/socket.io' },
}),
);
this.eventsGateway.on(this.onInternalEvent);
}
}
onModuleDestroy() {
if (this.eventsGateway) {
this.eventsGateway.off(this.onInternalEvent);
}
}
private updateSystemConfig({ server }: SystemConfig) {
this.moduleConfig.update({
externalBaseUrl: getExternalDomain(server),
});
}
private async updateLibraryConfig() {
const libraries = await this.libraryRepository.getAll();
this.moduleConfig.update({
immichIntegration: {
dataPath: StorageCore.getMediaLocation(),
dataFolders: Object.values(StorageFolder),
libraries: libraries
.filter((library) => !library.deletedAt)
.map(({ id, name, importPaths, exclusionPatterns }) => ({ id, name, importPaths, exclusionPatterns })),
},
});
}
@OnEvent({ name: 'ConfigInit', workers: [ImmichWorker.Api] })
async onConfigInit({ newConfig }: ArgOf<'ConfigInit'>) {
this.updateSystemConfig(newConfig);
void this.updateLibraryConfig();
this.lock = await this.databaseRepository.tryLock(DatabaseLock.YuccaModuleConfig);
if (this.lock) {
this.moduleConfig.acquireLock();
}
}
@OnEvent({ name: 'ConfigUpdate', workers: [ImmichWorker.Api], server: true })
onConfigUpdate({ newConfig }: ArgOf<'ConfigUpdate'>) {
void this.updateSystemConfig(newConfig);
}
@OnEvent({ name: 'LibraryCreate', workers: [ImmichWorker.Api], server: true })
onLibraryCreate() {
void this.updateLibraryConfig();
}
@OnEvent({ name: 'LibraryUpdate', workers: [ImmichWorker.Api], server: true })
onLibraryUpdate() {
void this.updateLibraryConfig();
}
@OnEvent({ name: 'LibraryDelete', workers: [ImmichWorker.Api], server: true })
onLibraryDelete() {
void this.updateLibraryConfig();
}
@OnEvent({ name: 'YuccaEvent', workers: [ImmichWorker.Api], server: true })
onYuccaEvent(event: GatewayEvent) {
this.eventsGateway.emit(event);
}
onInternalEvent(event: GatewayEvent) {
this.websocketRepository.serverSend('YuccaEvent', event);
}
}

View File

@ -50,6 +50,7 @@
"lodash-es": "^4.17.21",
"luxon": "^3.4.4",
"maplibre-gl": "^5.6.2",
"orchestration-ui": "0.1.54",
"pmtiles": "^4.3.0",
"qrcode": "^1.5.4",
"simple-icons": "^15.15.0",

View File

@ -1,6 +1,8 @@
<script lang="ts">
import RestoreFlowDetectInstall from '$lib/components/maintenance/restore-flow/RestoreFlowDetectInstall.svelte';
import RestoreFlowIntro from '$lib/components/maintenance/restore-flow/RestoreFlowIntro.svelte';
import RestoreFlowSelectBackup from '$lib/components/maintenance/restore-flow/RestoreFlowSelectBackup.svelte';
import { OnboardingGate } from 'orchestration-ui';
type Props = {
end: () => void;
@ -9,11 +11,26 @@
const { end, expectedVersion }: Props = $props();
let stage = $state(0);
let stage = $state(localStorage.getItem('restoring-yucca') ? 1 : 0);
$effect(() => {
if (stage === 1) {
localStorage.setItem('restoring-yucca', '1');
} else {
localStorage.removeItem('restoring-yucca');
}
});
const next = () => stage++;
const previous = () => stage--;
</script>
{#if stage === 0}
<RestoreFlowDetectInstall next={() => stage++} {end} />
<RestoreFlowIntro flowToYucca={() => (stage = 1)} flowToDatabase={() => (stage = 2)} {end} />
{:else if stage === 1}
<OnboardingGate flow="immich-restore" onExit={previous} onFinish={() => stage++} />
{:else if stage === 2}
<RestoreFlowDetectInstall {next} previous={() => (stage = 0)} />
{:else}
<RestoreFlowSelectBackup previous={() => stage--} {end} {expectedVersion} />
<RestoreFlowSelectBackup {previous} {end} {expectedVersion} />
{/if}

View File

@ -7,10 +7,10 @@
type Props = {
next: () => void;
end: () => void;
previous: () => void;
};
const { next, end }: Props = $props();
const { next, previous }: Props = $props();
let detectedInstall: MaintenanceDetectInstallResponseDto | undefined = $state();
@ -93,6 +93,6 @@
</div>
<Text>{$t('maintenance_restore_library_confirm')}</Text>
<HStack>
<Button onclick={end} variant="ghost">{$t('cancel')}</Button>
<Button onclick={previous} variant="ghost">{$t('back')}</Button>
<Button onclick={next} trailingIcon={mdiArrowRight}>{$t('next')}</Button>
</HStack>

View File

@ -0,0 +1,20 @@
<script lang="ts">
import { Button, Heading, HStack } from '@immich/ui';
import { mdiArrowRight } from '@mdi/js';
import { t } from 'svelte-i18n';
type Props = {
flowToYucca: () => void;
flowToDatabase: () => void;
end: () => void;
};
const { flowToYucca, flowToDatabase, end }: Props = $props();
</script>
<Heading size="large" color="primary" tag="h1">Where would you like to restore from?</Heading>
<HStack>
<Button onclick={end} variant="ghost">{$t('cancel')}</Button>
<Button onclick={flowToYucca} trailingIcon={mdiArrowRight}>FUTO Backups</Button>
<Button onclick={flowToDatabase} trailingIcon={mdiArrowRight}>Database Backup</Button>
</HStack>

View File

@ -14,6 +14,7 @@
mdiAccountOutline,
mdiArchiveArrowDown,
mdiArchiveArrowDownOutline,
mdiBackupRestore,
mdiFolderOutline,
mdiHeart,
mdiHeartOutline,
@ -87,6 +88,8 @@
<NavbarItem title={$t('folders')} href={Route.folders()} icon={{ icon: mdiFolderOutline, flipped: true }} />
{/if}
<NavbarItem title="Backups" href={Route.backups()} icon={mdiBackupRestore} />
<NavbarItem title={$t('utilities')} href={Route.utilities()} icon={mdiToolboxOutline} activeIcon={mdiToolbox} />
<NavbarItem

View File

@ -147,6 +147,12 @@ export const Route = {
workflows: () => '/utilities/workflows',
viewWorkflow: ({ id }: { id: string }) => `/utilities/workflows/${id}`,
// backups
backups: () => '/backups',
backupsRepositories: () => '/backups/repositories',
backupsSchedules: () => '/backups/schedules',
backupsConfig: () => '/backups/config',
// queues
queues: () => '/admin/queues',
viewQueue: ({ name }: { name: QueueName }) => `/admin/queues/${asQueueSlug(name)}`,

View File

@ -0,0 +1,44 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/state';
import NavigationBar from '$lib/components/shared-components/navigation-bar/navigation-bar.svelte';
import { Route } from '$lib/route';
import { sidebarStore } from '$lib/stores/sidebar.svelte';
import { AppShell, AppShellHeader, AppShellSidebar, NavbarItem } from '@immich/ui';
import { mdiBackupRestore, mdiClock, mdiCog, mdiViewDashboard } from '@mdi/js';
import { OnboardingGate, orchestrationApiProvider, sdk, setProvider, YuccaContext } from 'orchestration-ui';
import type { Snippet } from 'svelte';
let { children }: { children: Snippet } = $props();
sdk.defaults.baseUrl = window.location.origin;
setProvider(orchestrationApiProvider);
</script>
<AppShell>
<AppShellHeader>
<NavigationBar noBorder />
</AppShellHeader>
<AppShellSidebar bind:open={sidebarStore.isOpen}>
<div class="flex flex-col pt-8 pe-4 gap-1">
<NavbarItem
title="Dashboard"
href={Route.backups()}
icon={mdiViewDashboard}
isActive={() => page.url.pathname === '/backups'}
/>
<NavbarItem title="Repositories" href={Route.backupsRepositories()} icon={mdiBackupRestore} />
<NavbarItem title="Schedules" href={Route.backupsSchedules()} icon={mdiClock} />
<NavbarItem title="Configure" href={Route.backupsConfig()} icon={mdiCog} />
</div>
</AppShellSidebar>
<YuccaContext baseUrl={window.location.origin}>
<div class="p-4 flex flex-col gap-2 max-w-6xl m-auto">
<OnboardingGate flow="immich-setup" onExit={() => goto('/')}>
{@render children()}
</OnboardingGate>
</div>
</YuccaContext>
</AppShell>

View File

@ -0,0 +1,6 @@
import { authenticate } from '$lib/utils/auth';
import type { LayoutLoad } from './$types';
export const load = (async ({ url }) => {
await authenticate(url);
}) satisfies LayoutLoad;

View File

@ -0,0 +1,13 @@
<script lang="ts">
import { Dashboard } from 'orchestration-ui';
import { goto } from '$app/navigation';
import { Route } from '$lib/route';
</script>
<Dashboard
onNavigate={(target) => {
if (target === 'backups') goto(Route.backupsRepositories());
else if (target === 'schedules') goto(Route.backupsSchedules());
else if (target === 'config') goto(Route.backupsConfig());
}}
/>

View File

@ -0,0 +1,9 @@
import type { PageLoad } from './$types';
export const load = (() => {
return {
meta: {
title: 'Backups',
},
};
}) satisfies PageLoad;

View File

@ -0,0 +1,5 @@
<script lang="ts">
import { BackendsList } from 'orchestration-ui';
</script>
<BackendsList />

View File

@ -0,0 +1,5 @@
<script lang="ts">
import { BackupsList } from 'orchestration-ui';
</script>
<BackupsList local />

Some files were not shown because too many files have changed in this diff Show More