Compare commits

..

3 Commits

Author SHA1 Message Date
timonrieger 182de9871a migrate mobile call sites 2026-05-18 17:17:56 +02:00
timonrieger 1ed8d32291 gen client 2026-05-18 17:17:56 +02:00
timonrieger a6d5e9a62c bump to v7.22.0 and update patching 2026-05-18 17:15:08 +02:00
453 changed files with 7689 additions and 25127 deletions
-9
View File
@@ -1,9 +0,0 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.17.0",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c",
"integrity": "sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c"
}
}
}
+1 -4
View File
@@ -85,10 +85,7 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
// https://github.com/devcontainers/features/issues/1466
"moby": false,
"dockerDashComposeVersion": "none",
"installDockerBuildx": false,
"installDockerComposeSwitch": false
"moby": false
}
},
"forwardPorts": [3000, 9231, 9230, 2283],
+2 -39
View File
@@ -80,9 +80,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run ci-unit
run: mise run //server:ci-unit
@@ -114,11 +111,9 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run ci-unit
run: mise run ci-unit
cli-unit-tests-win:
name: Unit Test CLI (Windows)
needs: pre-job
@@ -147,9 +142,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup @immich/sdk
run: mise run //:sdk:install && mise run //:sdk:build
@@ -194,9 +186,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup @immich/sdk
run: mise run //:sdk:install && mise run //:sdk:build
@@ -235,11 +224,9 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run ci-unit
run: mise run ci-unit
i18n-tests:
name: Test i18n
needs: pre-job
@@ -265,9 +252,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Install dependencies
run: pnpm -w install --frozen-lockfile
@@ -318,9 +302,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run ci-unit
run: mise run ci-unit
if: ${{ !cancelled() }}
@@ -354,9 +335,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run ci-medium
run: mise run ci-medium
if: ${{ !cancelled() }}
@@ -398,9 +376,6 @@ jobs:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Setup packages
run: pnpm --filter @immich/sdk --filter @immich/cli install --frozen-lockfile && pnpm --filter @immich/sdk --filter @immich/cli build
@@ -478,9 +453,6 @@ jobs:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run setup @immich/sdk
run: pnpm --filter @immich/sdk install --frozen-lockfile && pnpm --filter @immich/sdk build
@@ -650,9 +622,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- name: Configure npm registry
run: pnpm set registry https://npm.raccoon.sh/
- name: Run pnpm install
run: pnpm install --frozen-lockfile
@@ -704,9 +673,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- 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: Run API generation
@@ -765,9 +731,6 @@ jobs:
with:
github_token: ${{ steps.token.outputs.token }}
- 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
-1
View File
@@ -26,7 +26,6 @@
"devDependencies": {
"@eslint/js": "^10.0.0",
"@faker-js/faker": "^10.1.0",
"@futo-org/backups-orchestrator-ui": "0.1.73",
"@immich/cli": "workspace:*",
"@immich/e2e-auth-server": "workspace:*",
"@immich/sdk": "workspace:*",
@@ -1,385 +0,0 @@
import * as sdk from '@futo-org/backups-orchestrator-ui/sdk';
import { LoginResponseDto, StorageFolder } from '@immich/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(64),
},
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(64),
},
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,
);
});
});
@@ -95,7 +95,6 @@ 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();
@@ -1,141 +0,0 @@
import { LoginResponseDto, confirmRecoveryKey, importRecoveryKey, resetOrchestrator } from '@immich/sdk';
import { expect, test } from '@playwright/test';
import { io, type Socket } from 'socket.io-client';
import { asBearerAuth, baseUrl, utils } from 'src/utils';
test.describe.configure({ mode: 'serial' });
test.describe('Yucca Backups', () => {
let admin: LoginResponseDto;
let socket: Socket;
const waitForTaskEnd = () =>
new Promise<void>((resolve) => {
const listener = (msg: string) => {
try {
const payload = JSON.parse(msg);
if (payload.type === 'TaskEnd') {
socket.offAny(listener);
resolve();
}
} catch {
// no-op
}
};
socket.onAny(listener);
});
test.beforeAll(async () => {
utils.initSdk();
await utils.resetDatabase();
admin = await utils.adminSetup();
const headers = asBearerAuth(admin.accessToken);
await resetOrchestrator({ headers });
await importRecoveryKey({ importRecoveryKeyRequest: { recoveryKey: '0'.repeat(64) } }, { headers });
await confirmRecoveryKey({ headers });
await utils.mkdir('/local-backend');
socket = io(baseUrl, {
path: '/api/yucca/socket.io',
transports: ['websocket'],
extraHeaders: headers,
forceNew: true,
});
await new Promise<void>((resolve) => socket.on('connect', () => resolve()));
});
test.afterAll(async () => {
socket?.close();
});
test('onboarding configures a local backend', async ({ context, page }) => {
test.setTimeout(30_000);
await utils.setAuthCookies(context, admin.accessToken);
await page.goto('/backups');
const dialog = page.getByRole('dialog');
await expect(dialog.filter({ hasText: 'Backup options' })).toBeVisible();
await dialog.getByText('Local Folder').click();
await expect(dialog.filter({ hasText: 'Create local backend' })).toBeVisible();
await dialog.getByLabel('Path').fill('/local-backend');
await dialog.getByRole('button', { name: 'Save' }).click();
await expect(dialog.filter({ hasText: 'Configure Your Immich Backup' })).toBeVisible();
await dialog.getByRole('button', { name: 'Save' }).click();
await expect(dialog).toHaveCount(0);
await expect(page.getByRole('link', { name: 'Repositories' })).toBeVisible();
});
test('manually triggers a backup and waits for completion', async ({ context, page }) => {
test.setTimeout(60_000);
await utils.setAuthCookies(context, admin.accessToken);
await page.goto('/backups/repositories');
const backupNow = page.getByRole('button', { name: 'Backup Now' });
await expect(backupNow).toBeVisible();
const taskEnd = waitForTaskEnd();
await backupNow.click();
await expect(page.getByRole('dialog').filter({ hasText: 'Log Output' })).toBeVisible();
await taskEnd;
});
test('resets immich and restores from the local yucca backup', async ({ context, page }) => {
test.setTimeout(120_000);
await utils.setAuthCookies(context, admin.accessToken);
await utils.resetBackups(admin.accessToken);
await utils.createBackup(admin.accessToken);
await resetOrchestrator({ headers: asBearerAuth(admin.accessToken) });
await utils.resetDatabase();
await page.goto('/');
await page.getByRole('button', { name: 'Restore from backup' }).click();
try {
await page.waitForURL('/maintenance**');
} catch {
await page.goto('/maintenance');
await page.waitForURL('/maintenance**');
}
await page.getByRole('button', { name: 'FUTO Backups' }).click();
const dialog = page.getByRole('dialog');
await expect(dialog.filter({ hasText: 'Import recovery key' })).toBeVisible();
await dialog.getByLabel('Recovery Key').fill('0'.repeat(64));
await dialog.getByRole('button', { name: 'Save' }).click();
await expect(dialog.filter({ hasText: 'Where would you like to restore from?' })).toBeVisible();
await dialog.getByText('Local Folder').click();
await expect(dialog.filter({ hasText: 'Create local backend' })).toBeVisible();
await dialog.getByLabel('Path').fill('/local-backend');
await dialog.getByRole('button', { name: 'Save' }).click();
await expect(dialog.filter({ hasText: 'Select Restore Point' })).toBeVisible();
await dialog.getByRole('button', { name: 'Select' }).first().click();
await expect(dialog.filter({ hasText: /Restore from/ })).toBeVisible();
await dialog.getByRole('button', { name: 'Restore' }).first().click();
await expect(dialog.filter({ hasText: 'Confirm restore from snapshot' })).toBeVisible();
await dialog.getByRole('button', { name: 'Restore' }).click();
await expect(dialog.filter({ hasText: 'Restoring' })).toBeVisible();
await expect(dialog.filter({ hasText: 'Restoring' })).toBeHidden({ timeout: 60_000 });
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();
await page.waitForURL('/maintenance?**');
await page.waitForURL('/photos', { timeout: 90_000 });
});
});
-7
View File
@@ -30,7 +30,6 @@ import {
createUserAdmin,
deleteAssets,
deleteDatabaseBackup,
deleteLibrary,
getAssetInfo,
getConfig,
getConfigDefaults,
@@ -461,8 +460,6 @@ 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) }),
@@ -566,10 +563,6 @@ 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,
-5
View File
@@ -1469,7 +1469,6 @@
"maintenance_end_error": "Failed to end maintenance mode.",
"maintenance_logged_in_as": "Currently logged in as {user}",
"maintenance_restore_from_backup": "Restore From Backup",
"maintenance_restore_latest_backup_description": "We'll restore your database from the most recent backup. You can also pick a different one.",
"maintenance_restore_library": "Restore Your Library",
"maintenance_restore_library_confirm": "If this looks correct, continue to restoring a backup!",
"maintenance_restore_library_description": "Restoring Database",
@@ -1482,10 +1481,6 @@
"maintenance_restore_library_hint_regenerate_later": "You can regenerate these later in settings",
"maintenance_restore_library_hint_storage_template_missing_files": "Using storage template? You may be missing files",
"maintenance_restore_library_loading": "Loading integrity checks and heuristics…",
"maintenance_restore_loading_backups": "Loading backups…",
"maintenance_restore_no_backups": "There are no database backups.",
"maintenance_restore_select_another": "Select another backup",
"maintenance_restore_upload_backup": "Upload a backup",
"maintenance_task_backup": "Creating a backup of the existing database…",
"maintenance_task_migrations": "Running database migrations…",
"maintenance_task_restore": "Restoring the chosen backup…",
+5 -5
View File
@@ -18,11 +18,11 @@ extension DTOToAsset on api.AssetResponseDto {
height: height?.toInt(),
width: width?.toInt(),
isFavorite: isFavorite,
livePhotoVideoId: livePhotoVideoId,
livePhotoVideoId: livePhotoVideoId.orElse(null),
thumbHash: thumbhash,
localId: null,
type: type.toAssetType(),
stackId: stack?.id,
stackId: stack.orElse(null)?.id,
isEdited: isEdited,
);
}
@@ -41,13 +41,13 @@ extension DTOToAsset on api.AssetResponseDto {
height: height?.toInt(),
width: width?.toInt(),
isFavorite: isFavorite,
livePhotoVideoId: livePhotoVideoId,
livePhotoVideoId: livePhotoVideoId.orElse(null),
thumbHash: thumbhash,
localId: null,
type: type.toAssetType(),
stackId: stack?.id,
stackId: stack.orElse(null)?.id,
isEdited: isEdited,
exifInfo: exifInfo != null ? ExifDtoConverter.fromDto(exifInfo!) : const ExifInfo(),
exifInfo: exifInfo.orElse(null) != null ? ExifDtoConverter.fromDto(exifInfo.orElse(null)!) : const ExifInfo(),
);
}
}
@@ -20,50 +20,64 @@ class SearchApiRepository extends ApiRepository {
(filter.assetId != null && filter.assetId!.isNotEmpty)) {
return _api.searchSmart(
SmartSearchDto(
query: filter.context,
queryAssetId: filter.assetId,
language: filter.language,
country: filter.location.country,
state: filter.location.state,
city: filter.location.city,
make: filter.camera.make,
model: filter.camera.model,
takenAfter: filter.date.takenAfter,
takenBefore: filter.date.takenBefore,
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
rating: filter.rating.rating,
isFavorite: filter.display.isFavorite ? true : null,
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
personIds: filter.people.map((e) => e.id).toList(),
tagIds: filter.tagIds,
type: type,
page: page,
size: 100,
query: filter.context == null ? const Optional.absent() : Optional.present(filter.context!),
queryAssetId: filter.assetId == null ? const Optional.absent() : Optional.present(filter.assetId!),
language: filter.language == null ? const Optional.absent() : Optional.present(filter.language!),
country: filter.location.country == null
? const Optional.absent()
: Optional.present(filter.location.country!),
state: filter.location.state == null ? const Optional.absent() : Optional.present(filter.location.state!),
city: filter.location.city == null ? const Optional.absent() : Optional.present(filter.location.city!),
make: filter.camera.make == null ? const Optional.absent() : Optional.present(filter.camera.make!),
model: filter.camera.model == null ? const Optional.absent() : Optional.present(filter.camera.model!),
takenAfter: filter.date.takenAfter == null
? const Optional.absent()
: Optional.present(filter.date.takenAfter!),
takenBefore: filter.date.takenBefore == null
? const Optional.absent()
: Optional.present(filter.date.takenBefore!),
visibility: Optional.present(filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline),
rating: filter.rating.rating == null ? const Optional.absent() : Optional.present(filter.rating.rating!),
isFavorite: filter.display.isFavorite ? const Optional.present(true) : const Optional.absent(),
isNotInAlbum: filter.display.isNotInAlbum ? const Optional.present(true) : const Optional.absent(),
personIds: Optional.present(filter.people.map((e) => e.id).toList()),
tagIds: filter.tagIds == null ? const Optional.absent() : Optional.present(filter.tagIds!),
type: type == null ? const Optional.absent() : Optional.present(type),
page: Optional.present(page),
size: const Optional.present(100),
),
);
}
return _api.searchAssets(
MetadataSearchDto(
originalFileName: filter.filename != null && filter.filename!.isNotEmpty ? filter.filename : null,
country: filter.location.country,
description: filter.description != null && filter.description!.isNotEmpty ? filter.description : null,
ocr: filter.ocr != null && filter.ocr!.isNotEmpty ? filter.ocr : null,
state: filter.location.state,
city: filter.location.city,
make: filter.camera.make,
model: filter.camera.model,
takenAfter: filter.date.takenAfter,
takenBefore: filter.date.takenBefore,
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
rating: filter.rating.rating,
isFavorite: filter.display.isFavorite ? true : null,
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
personIds: filter.people.map((e) => e.id).toList(),
tagIds: filter.tagIds,
type: type,
page: page,
size: 1000,
originalFileName: filter.filename != null && filter.filename!.isNotEmpty
? Optional.present(filter.filename!)
: const Optional.absent(),
country: filter.location.country == null ? const Optional.absent() : Optional.present(filter.location.country!),
description: filter.description != null && filter.description!.isNotEmpty
? Optional.present(filter.description!)
: const Optional.absent(),
ocr: filter.ocr != null && filter.ocr!.isNotEmpty ? Optional.present(filter.ocr!) : const Optional.absent(),
state: filter.location.state == null ? const Optional.absent() : Optional.present(filter.location.state!),
city: filter.location.city == null ? const Optional.absent() : Optional.present(filter.location.city!),
make: filter.camera.make == null ? const Optional.absent() : Optional.present(filter.camera.make!),
model: filter.camera.model == null ? const Optional.absent() : Optional.present(filter.camera.model!),
takenAfter: filter.date.takenAfter == null
? const Optional.absent()
: Optional.present(filter.date.takenAfter!),
takenBefore: filter.date.takenBefore == null
? const Optional.absent()
: Optional.present(filter.date.takenBefore!),
visibility: Optional.present(filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline),
rating: filter.rating.rating == null ? const Optional.absent() : Optional.present(filter.rating.rating!),
isFavorite: filter.display.isFavorite ? const Optional.present(true) : const Optional.absent(),
isNotInAlbum: filter.display.isNotInAlbum ? const Optional.present(true) : const Optional.absent(),
personIds: Optional.present(filter.people.map((e) => e.id).toList()),
tagIds: filter.tagIds == null ? const Optional.absent() : Optional.present(filter.tagIds!),
type: type == null ? const Optional.absent() : Optional.present(type),
page: Optional.present(page),
size: const Optional.present(1000),
),
);
}
@@ -20,7 +20,7 @@ class SyncApiRepository {
}
Future<void> deleteSyncAck(List<SyncEntityType> types) {
return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: types));
return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: Optional.present(types)));
}
Future<void> streamChanges(
@@ -91,7 +91,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
email: Value(user.email),
hasProfileImage: Value(user.hasProfileImage),
profileChangedAt: Value(user.profileChangedAt),
avatarColor: Value(user.avatarColor?.toAvatarColor() ?? AvatarColor.primary),
avatarColor: Value(user.avatarColor.orElse(null)?.toAvatarColor() ?? AvatarColor.primary),
isAdmin: Value(user.isAdmin),
pinCode: Value(user.pinCode),
quotaSizeInBytes: Value(user.quotaSizeInBytes ?? 0),
@@ -133,7 +133,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
email: Value(user.email),
hasProfileImage: Value(user.hasProfileImage),
profileChangedAt: Value(user.profileChangedAt),
avatarColor: Value(user.avatarColor?.toAvatarColor() ?? AvatarColor.primary),
avatarColor: Value(user.avatarColor.orElse(null)?.toAvatarColor() ?? AvatarColor.primary),
);
batch.insert(_db.userEntity, companion.copyWith(id: Value(user.id)), onConflict: DoUpdate((_) => companion));
@@ -5,24 +5,24 @@ import 'package:openapi/api.dart';
abstract final class ExifDtoConverter {
static ExifInfo fromDto(ExifResponseDto dto) {
return ExifInfo(
fileSize: dto.fileSizeInByte,
description: dto.description,
orientation: dto.orientation,
timeZone: dto.timeZone,
dateTimeOriginal: dto.dateTimeOriginal,
isFlipped: isOrientationFlipped(dto.orientation),
latitude: dto.latitude?.toDouble(),
longitude: dto.longitude?.toDouble(),
city: dto.city,
state: dto.state,
country: dto.country,
make: dto.make,
model: dto.model,
lens: dto.lensModel,
f: dto.fNumber?.toDouble(),
mm: dto.focalLength?.toDouble(),
iso: dto.iso?.toInt(),
exposureSeconds: exposureTimeToSeconds(dto.exposureTime),
fileSize: dto.fileSizeInByte.orElse(null),
description: dto.description.orElse(null),
orientation: dto.orientation.orElse(null),
timeZone: dto.timeZone.orElse(null),
dateTimeOriginal: dto.dateTimeOriginal.orElse(null),
isFlipped: isOrientationFlipped(dto.orientation.orElse(null)),
latitude: dto.latitude.orElse(null)?.toDouble(),
longitude: dto.longitude.orElse(null)?.toDouble(),
city: dto.city.orElse(null),
state: dto.state.orElse(null),
country: dto.country.orElse(null),
make: dto.make.orElse(null),
model: dto.model.orElse(null),
lens: dto.lensModel.orElse(null),
f: dto.fNumber.orElse(null)?.toDouble(),
mm: dto.focalLength.orElse(null)?.toDouble(),
iso: dto.iso.orElse(null)?.toInt(),
exposureSeconds: exposureTimeToSeconds(dto.exposureTime.orElse(null)),
);
}
@@ -40,7 +40,7 @@ abstract final class UserConverter {
updatedAt: DateTime.now(),
avatarColor: dto.avatarColor.toAvatarColor(),
memoryEnabled: false,
inTimeline: dto.inTimeline ?? false,
inTimeline: dto.inTimeline.orElse(null) ?? false,
isPartnerSharedBy: false,
isPartnerSharedWith: false,
profileChangedAt: dto.profileChangedAt,
@@ -73,10 +73,10 @@ class SharedLink {
slug = dto.slug,
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
title = dto.type == SharedLinkType.ALBUM
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
? dto.album.orElse(null)?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
: "INDIVIDUAL SHARE",
thumbAssetId = dto.type == SharedLinkType.ALBUM
? dto.album?.albumThumbnailAssetId
? dto.album.orElse(null)?.albumThumbnailAssetId
: dto.assets.isNotEmpty
? dto.assets[0].id
: null;
@@ -29,7 +29,7 @@ final getAllPlacesProvider = FutureProvider.autoDispose<List<SearchCuratedConten
}
final curatedContent = assetPlaces
.map((data) => SearchCuratedContent(label: data.exifInfo!.city!, id: data.id))
.map((data) => SearchCuratedContent(label: data.exifInfo.orElse(null)!.city.orElse(null)!, id: data.id))
.toList();
return curatedContent;
@@ -23,8 +23,8 @@ class ActivityApiRepository extends ApiRepository {
final dto = ActivityCreateDto(
albumId: albumId,
type: type == ActivityType.comment ? ReactionType.comment : ReactionType.like,
assetId: assetId,
comment: comment,
assetId: assetId == null ? const Optional.absent() : Optional.present(assetId),
comment: comment == null ? const Optional.absent() : Optional.present(comment),
);
final response = await checkNull(_api.createActivity(dto));
return _toActivity(response);
@@ -45,6 +45,6 @@ class ActivityApiRepository extends ApiRepository {
type: dto.type == ReactionType.comment ? ActivityType.comment : ActivityType.like,
user: UserConverter.fromSimpleUserDto(dto.user),
assetId: dto.assetId,
comment: dto.comment,
comment: dto.comment.orElse(null),
);
}
@@ -24,7 +24,7 @@ class AssetApiRepository extends ApiRepository {
AssetApiRepository(this._api, this._stacksApi, this._trashApi);
Future<void> delete(List<String> ids, bool force) async {
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: force));
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: Optional.present(force)));
}
Future<void> restoreTrash(List<String> ids) async {
@@ -42,19 +42,27 @@ class AssetApiRepository extends ApiRepository {
}
Future<void> updateVisibility(List<String> ids, AssetVisibilityEnum visibility) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, visibility: _mapVisibility(visibility)));
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, visibility: Optional.present(_mapVisibility(visibility))));
}
Future<void> updateFavorite(List<String> ids, bool isFavorite) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: isFavorite));
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: Optional.present(isFavorite)));
}
Future<void> updateLocation(List<String> ids, LatLng location) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, latitude: location.latitude, longitude: location.longitude));
return _api.updateAssets(
AssetBulkUpdateDto(
ids: ids,
latitude: Optional.present(location.latitude),
longitude: Optional.present(location.longitude),
),
);
}
Future<void> updateDateTime(List<String> ids, DateTime dateTime) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, dateTimeOriginal: dateTime.toIso8601String()));
return _api.updateAssets(
AssetBulkUpdateDto(ids: ids, dateTimeOriginal: Optional.present(dateTime.toIso8601String())),
);
}
Future<StackResponse> stack(List<String> ids) async {
@@ -82,15 +90,15 @@ class AssetApiRepository extends ApiRepository {
final response = await checkNull(_api.getAssetInfo(assetId));
// we need to get the MIME of the thumbnail once that gets added to the API
return response.originalMimeType;
return response.originalMimeType.orElse(null);
}
Future<void> updateDescription(String assetId, String description) {
return _api.updateAsset(assetId, UpdateAssetDto(description: description));
return _api.updateAsset(assetId, UpdateAssetDto(description: Optional.present(description)));
}
Future<void> updateRating(String assetId, int rating) {
return _api.updateAsset(assetId, UpdateAssetDto(rating: rating));
return _api.updateAsset(assetId, UpdateAssetDto(rating: Optional.present(rating)));
}
Future<AssetEditsResponseDto?> editAsset(String assetId, List<AssetEdit> edits) {
@@ -13,7 +13,7 @@ class AuthApiRepository extends ApiRepository {
AuthApiRepository(this._apiService);
Future<void> changePassword(String newPassword) async {
await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: newPassword));
await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: Optional.present(newPassword)));
}
Future<LoginResponse> login(String email, String password) async {
@@ -46,7 +46,7 @@ class AuthApiRepository extends ApiRepository {
Future<bool> unlockPinCode(String pinCode) async {
try {
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: pinCode));
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: Optional.present(pinCode)));
return true;
} catch (_) {
return false;
@@ -22,7 +22,13 @@ class DriftAlbumApiRepository extends ApiRepository {
String? description,
}) async {
final responseDto = await checkNull(
_api.createAlbum(CreateAlbumDto(albumName: name, description: description, assetIds: assetIds.toList())),
_api.createAlbum(
CreateAlbumDto(
albumName: name,
description: description == null ? const Optional.absent() : Optional.present(description),
assetIds: Optional.present(assetIds.toList()),
),
),
);
return responseDto.toRemoteAlbum(owner);
@@ -73,11 +79,13 @@ class DriftAlbumApiRepository extends ApiRepository {
_api.updateAlbumInfo(
albumId,
UpdateAlbumDto(
albumName: name,
description: description,
albumThumbnailAssetId: thumbnailAssetId,
isActivityEnabled: isActivityEnabled,
order: apiOrder,
albumName: name == null ? const Optional.absent() : Optional.present(name),
description: description == null ? const Optional.absent() : Optional.present(description),
albumThumbnailAssetId: thumbnailAssetId == null
? const Optional.absent()
: Optional.present(thumbnailAssetId),
isActivityEnabled: isActivityEnabled == null ? const Optional.absent() : Optional.present(isActivityEnabled),
order: apiOrder == null ? const Optional.absent() : Optional.present(apiOrder),
),
),
);
@@ -99,7 +107,9 @@ class DriftAlbumApiRepository extends ApiRepository {
}
Future<bool> setActivityStatus(String albumId, bool isEnabled) async {
final response = await checkNull(_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: isEnabled)));
final response = await checkNull(
_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: Optional.present(isEnabled))),
);
return response.isActivityEnabled;
}
}
@@ -116,7 +126,7 @@ extension on AlbumResponseDto {
updatedAt: updatedAt,
thumbnailAssetId: albumThumbnailAssetId,
isActivityEnabled: isActivityEnabled,
order: order == AssetOrder.asc ? AlbumAssetOrder.asc : AlbumAssetOrder.desc,
order: order.orElse(null) == AssetOrder.asc ? AlbumAssetOrder.asc : AlbumAssetOrder.desc,
assetCount: assetCount,
isShared: albumUsers.length > 2,
);
@@ -16,7 +16,7 @@ class PartnerApiRepository extends ApiRepository {
Future<List<UserDto>> getAll(Direction direction) async {
final response = await checkNull(
_api.getPartners(direction == Direction.sharedByMe ? PartnerDirection.by : PartnerDirection.with_),
_api.getPartners(direction == Direction.sharedByMe ? PartnerDirection.sharedBy : PartnerDirection.sharedWith),
);
return response.map(UserConverter.fromPartnerDto).toList();
}
@@ -18,7 +18,10 @@ class PersonApiRepository extends ApiRepository {
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc);
final dto = PersonUpdateDto(
name: name == null ? const Optional.absent() : Optional.present(name),
birthDate: birthdayUtc == null ? const Optional.absent() : Optional.present(birthdayUtc),
);
final response = await checkNull(_api.updatePerson(id, dto));
return _toPerson(response);
}
@@ -15,7 +15,13 @@ class SessionsAPIRepository extends ApiRepository {
Future<SessionCreateResponse> createSession(String deviceType, String deviceOS, {int? duration}) async {
final dto = await checkNull(
_api.createSession(SessionCreateDto(deviceType: deviceType, deviceOS: deviceOS, duration: duration)),
_api.createSession(
SessionCreateDto(
deviceType: Optional.present(deviceType),
deviceOS: Optional.present(deviceOS),
duration: duration == null ? const Optional.absent() : Optional.present(duration),
),
),
);
return SessionCreateResponse(
@@ -23,7 +29,7 @@ class SessionsAPIRepository extends ApiRepository {
current: dto.current,
deviceType: deviceType,
deviceOS: deviceOS,
expiresAt: dto.expiresAt,
expiresAt: dto.expiresAt.orElse(null),
createdAt: dto.createdAt,
updatedAt: dto.updatedAt,
token: dto.token,
+1 -1
View File
@@ -55,7 +55,7 @@ class LockedGuard extends AutoRouteGuard {
return;
}
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: securePinCode));
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: Optional.present(securePinCode)));
resolver.next(true);
} on PlatformException catch (error) {
+6 -2
View File
@@ -18,7 +18,11 @@ class OAuthService {
log.info("Starting OAuth flow with redirect URI: $redirectUri");
final dto = await _apiService.oAuthApi.startOAuth(
OAuthConfigDto(redirectUri: redirectUri, state: state, codeChallenge: codeChallenge),
OAuthConfigDto(
redirectUri: redirectUri,
state: Optional.present(state),
codeChallenge: Optional.present(codeChallenge),
),
);
final authUrl = dto?.url;
@@ -37,7 +41,7 @@ class OAuthService {
}
return await _apiService.oAuthApi.finishOAuth(
OAuthCallbackDto(url: result, state: state, codeVerifier: codeVerifier),
OAuthCallbackDto(url: result, state: Optional.present(state), codeVerifier: Optional.present(codeVerifier)),
);
}
}
+24 -24
View File
@@ -48,26 +48,26 @@ class SharedLinkService {
if (type == SharedLinkType.ALBUM) {
dto = SharedLinkCreateDto(
type: type,
albumId: albumId,
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
albumId: albumId == null ? const Optional.absent() : Optional.present(albumId),
showMetadata: Optional.present(showMeta),
allowDownload: Optional.present(allowDownload),
allowUpload: Optional.present(allowUpload),
expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description == null ? const Optional.absent() : Optional.present(description),
password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug == null ? const Optional.absent() : Optional.present(slug),
);
} else if (assetIds != null) {
dto = SharedLinkCreateDto(
type: type,
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
assetIds: assetIds,
showMetadata: Optional.present(showMeta),
allowDownload: Optional.present(allowDownload),
allowUpload: Optional.present(allowUpload),
expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description == null ? const Optional.absent() : Optional.present(description),
password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug == null ? const Optional.absent() : Optional.present(slug),
assetIds: Optional.present(assetIds),
);
}
@@ -98,14 +98,14 @@ class SharedLinkService {
final responseDto = await _apiService.sharedLinksApi.updateSharedLink(
id,
SharedLinkEditDto(
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
changeExpiryTime: changeExpiry,
showMetadata: showMeta == null ? const Optional.absent() : Optional.present(showMeta),
allowDownload: allowDownload == null ? const Optional.absent() : Optional.present(allowDownload),
allowUpload: allowUpload == null ? const Optional.absent() : Optional.present(allowUpload),
expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description == null ? const Optional.absent() : Optional.present(description),
password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug == null ? const Optional.absent() : Optional.present(slug),
changeExpiryTime: changeExpiry == null ? const Optional.absent() : Optional.present(changeExpiry),
),
);
if (responseDto != null) {
+1 -1
View File
@@ -1 +1 @@
7.8.0
7.22.0
+1 -90
View File
@@ -4,7 +4,7 @@ Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 3.0.0
- Generator version: 7.8.0
- Generator version: 7.22.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements
@@ -118,7 +118,6 @@ 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* | [**oidcDeviceFlow**](doc//AuthApi.md#oidcdeviceflow) | **GET** /yucca/auth/oidc/device |
*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
@@ -137,8 +136,6 @@ 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,7 +144,6 @@ Class | Method | HTTP request | Description
*DeprecatedApi* | [**createPartnerDeprecated**](doc//DeprecatedApi.md#createpartnerdeprecated) | **POST** /partners/{id} | Create a partner
*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} | Dismiss a duplicate group
@@ -158,9 +154,6 @@ 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
@@ -195,11 +188,6 @@ 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
@@ -224,29 +212,6 @@ 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* | [**deleteRepository**](doc//RepositoryApi.md#deleterepository) | **DELETE** /yucca/repository/{id} |
*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* | [**pruneRepository**](doc//RepositoryApi.md#prunerepository) | **POST** /yucca/repository/{id}/snapshots/prune |
*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* | [**getRun**](doc//RunHistoryApi.md#getrun) | **GET** /yucca/logs/{id} |
*RunHistoryApi* | [**logStreamSse**](doc//RunHistoryApi.md#logstreamsse) | **GET** /yucca/logs/{id}/stream |
*RunningTasksApi* | [**cancelTask**](doc//RunningTasksApi.md#canceltask) | **POST** /yucca/tasks/{parentId}/cancel |
*RunningTasksApi* | [**getRunningTasks**](doc//RunningTasksApi.md#getrunningtasks) | **GET** /yucca/tasks |
*ScheduleApi* | [**createSchedule**](doc//ScheduleApi.md#createschedule) | **POST** /yucca/schedule |
*ScheduleApi* | [**getSchedules**](doc//ScheduleApi.md#getschedules) | **GET** /yucca/schedule |
*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
@@ -357,7 +322,6 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [ActiveScheduleItemDto](doc//ActiveScheduleItemDto.md)
- [ActivityCreateDto](doc//ActivityCreateDto.md)
- [ActivityResponseDto](doc//ActivityResponseDto.md)
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)
@@ -424,10 +388,6 @@ 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)
@@ -437,20 +397,15 @@ Class | Method | HTTP request | Description
- [CastUpdate](doc//CastUpdate.md)
- [ChangePasswordDto](doc//ChangePasswordDto.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)
- [DatabaseBackupListResponseDto](doc//DatabaseBackupListResponseDto.md)
- [DeviceFlowResponseDto](doc//DeviceFlowResponseDto.md)
- [DownloadArchiveDto](doc//DownloadArchiveDto.md)
- [DownloadArchiveInfo](doc//DownloadArchiveInfo.md)
- [DownloadInfoDto](doc//DownloadInfoDto.md)
@@ -466,28 +421,16 @@ 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)
@@ -528,7 +471,6 @@ 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)
@@ -568,35 +510,8 @@ 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)
- [RetentionPolicyDto](doc//RetentionPolicyDto.md)
- [ReverseGeocodingStateResponseDto](doc//ReverseGeocodingStateResponseDto.md)
- [RotateParameters](doc//RotateParameters.md)
- [RunDto](doc//RunDto.md)
- [RunHistoryResponseDto](doc//RunHistoryResponseDto.md)
- [RunResponseDto](doc//RunResponseDto.md)
- [RunStatus](doc//RunStatus.md)
- [RunType](doc//RunType.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)
@@ -631,8 +546,6 @@ Class | Method | HTTP request | Description
- [SharedLinksUpdate](doc//SharedLinksUpdate.md)
- [SignUpDto](doc//SignUpDto.md)
- [SmartSearchDto](doc//SmartSearchDto.md)
- [SnapshotDto](doc//SnapshotDto.md)
- [SnapshotSummaryDto](doc//SnapshotSummaryDto.md)
- [SourceType](doc//SourceType.md)
- [StackCreateDto](doc//StackCreateDto.md)
- [StackResponseDto](doc//StackResponseDto.md)
@@ -717,8 +630,6 @@ 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)
+1 -64
View File
@@ -29,23 +29,19 @@ part 'auth/api_key_auth.dart';
part 'auth/oauth.dart';
part 'auth/http_basic_auth.dart';
part 'auth/http_bearer_auth.dart';
part 'optional.dart';
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';
@@ -53,15 +49,10 @@ 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';
@@ -78,7 +69,6 @@ part 'api/users_admin_api.dart';
part 'api/views_api.dart';
part 'api/workflows_api.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';
@@ -145,10 +135,6 @@ 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';
@@ -158,20 +144,15 @@ part 'model/cast_response.dart';
part 'model/cast_update.dart';
part 'model/change_password_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';
part 'model/database_backup_list_response_dto.dart';
part 'model/device_flow_response_dto.dart';
part 'model/download_archive_dto.dart';
part 'model/download_archive_info.dart';
part 'model/download_info_dto.dart';
@@ -187,28 +168,16 @@ 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';
@@ -249,7 +218,6 @@ 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';
@@ -289,35 +257,8 @@ 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/retention_policy_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_response_dto.dart';
part 'model/run_status.dart';
part 'model/run_type.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';
@@ -352,8 +293,6 @@ 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/snapshot_summary_dto.dart';
part 'model/source_type.dart';
part 'model/stack_create_dto.dart';
part 'model/stack_response_dto.dart';
@@ -438,8 +377,6 @@ 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';
-59
View File
@@ -1,59 +0,0 @@
//
// 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/device' operation and returns the [Response].
Future<Response> oidcDeviceFlowWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/auth/oidc/device';
// 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<DeviceFlowResponseDto?> oidcDeviceFlow() async {
final response = await oidcDeviceFlowWithHttpInfo();
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), 'DeviceFlowResponseDto',) as DeviceFlowResponseDto;
}
return null;
}
}
-106
View File
@@ -1,106 +0,0 @@
//
// 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;
}
}
-51
View File
@@ -1,51 +0,0 @@
//
// 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));
}
}
}
-69
View File
@@ -1,69 +0,0 @@
//
// 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;
}
}
-98
View File
@@ -1,98 +0,0 @@
//
// 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
View File
@@ -1,205 +0,0 @@
//
// 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));
}
}
}
-789
View File
@@ -1,789 +0,0 @@
//
// 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}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteRepositoryWithHttpInfo(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,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteRepository(String id,) async {
final response = await deleteRepositoryWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// 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/prune' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> pruneRepositoryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/repository/{id}/snapshots/prune'
.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?> pruneRepository(String id,) async {
final response = await pruneRepositoryWithHttpInfo(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/{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;
}
}
-106
View File
@@ -1,106 +0,0 @@
//
// 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> getRunWithHttpInfo(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<RunResponseDto?> getRun(String id,) async {
final response = await getRunWithHttpInfo(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), 'RunResponseDto',) as RunResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /yucca/logs/{id}/stream' 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}/stream'
.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));
}
}
}
-99
View File
@@ -1,99 +0,0 @@
//
// 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 'POST /yucca/tasks/{parentId}/cancel' operation and returns the [Response].
/// Parameters:
///
/// * [String] parentId (required):
Future<Response> cancelTaskWithHttpInfo(String parentId,) async {
// ignore: prefer_const_declarations
final apiPath = r'/yucca/tasks/{parentId}/cancel'
.replaceAll('{parentId}', parentId);
// 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] parentId (required):
Future<void> cancelTask(String parentId,) async {
final response = await cancelTaskWithHttpInfo(parentId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// 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;
}
}
-198
View File
@@ -1,198 +0,0 @@
//
// 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 '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}' 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;
}
}
+3 -111
View File
@@ -143,19 +143,19 @@ class ApiClient {
);
}
Future<dynamic> deserializeAsync(String value, String targetType, {bool growable = false,}) =>
Future<dynamic> deserializeAsync(String value, String targetType, {bool growable = false,}) async =>
// ignore: deprecated_member_use_from_same_package
deserialize(value, targetType, growable: growable);
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
Future<dynamic> deserialize(String value, String targetType, {bool growable = false,}) async {
dynamic deserialize(String value, String targetType, {bool growable = false,}) {
// Remove all spaces. Necessary for regular expressions as well.
targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments
// If the expected target type is String, nothing to do...
return targetType == 'String'
? value
: fromJson(await compute((String j) => json.decode(j), value), targetType, growable: growable);
: fromJson(json.decode(value), targetType, growable: growable);
}
// ignore: deprecated_member_use_from_same_package
@@ -182,8 +182,6 @@ class ApiClient {
return valueString == 'true' || valueString == '1';
case 'DateTime':
return value is DateTime ? value : DateTime.tryParse(value);
case 'ActiveScheduleItemDto':
return ActiveScheduleItemDto.fromJson(value);
case 'ActivityCreateDto':
return ActivityCreateDto.fromJson(value);
case 'ActivityResponseDto':
@@ -316,14 +314,6 @@ 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,24 +332,16 @@ class ApiClient {
return ChangePasswordDto.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':
@@ -368,8 +350,6 @@ class ApiClient {
return DatabaseBackupDto.fromJson(value);
case 'DatabaseBackupListResponseDto':
return DatabaseBackupListResponseDto.fromJson(value);
case 'DeviceFlowResponseDto':
return DeviceFlowResponseDto.fromJson(value);
case 'DownloadArchiveDto':
return DownloadArchiveDto.fromJson(value);
case 'DownloadArchiveInfo':
@@ -400,30 +380,12 @@ 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':
@@ -436,14 +398,8 @@ 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':
@@ -524,8 +480,6 @@ 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':
@@ -604,64 +558,10 @@ 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 'RetentionPolicyDto':
return RetentionPolicyDto.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 'RunResponseDto':
return RunResponseDto.fromJson(value);
case 'RunStatus':
return RunStatusTypeTransformer().decode(value);
case 'RunType':
return RunTypeTypeTransformer().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':
@@ -730,10 +630,6 @@ class ApiClient {
return SignUpDto.fromJson(value);
case 'SmartSearchDto':
return SmartSearchDto.fromJson(value);
case 'SnapshotDto':
return SnapshotDto.fromJson(value);
case 'SnapshotSummaryDto':
return SnapshotSummaryDto.fromJson(value);
case 'SourceType':
return SourceTypeTypeTransformer().decode(value);
case 'StackCreateDto':
@@ -902,10 +798,6 @@ 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':
+3 -15
View File
@@ -94,9 +94,6 @@ 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();
}
@@ -160,12 +157,6 @@ 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 RunType) {
return RunTypeTypeTransformer().encode(value).toString();
}
if (value is SearchSuggestionType) {
return SearchSuggestionTypeTypeTransformer().encode(value).toString();
}
@@ -184,12 +175,6 @@ 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();
}
@@ -235,6 +220,9 @@ Future<String> _decodeBodyBytes(Response response) async {
/// Returns a valid [T] value found at the specified Map [key], null otherwise.
T? mapValueOfType<T>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
if (T == double && value is int) {
return value.toDouble() as T;
}
return value is T ? value : null;
}
-107
View File
@@ -1,107 +0,0 @@
//
// 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',
};
}
+23 -14
View File
@@ -14,8 +14,8 @@ class ActivityCreateDto {
/// Returns a new [ActivityCreateDto] instance.
ActivityCreateDto({
required this.albumId,
this.assetId,
this.comment,
this.assetId = const Optional.absent(),
this.comment = const Optional.absent(),
required this.type,
});
@@ -29,7 +29,7 @@ class ActivityCreateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? assetId;
Optional<String?> assetId;
/// Comment text (required if type is comment)
///
@@ -38,7 +38,7 @@ class ActivityCreateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? comment;
Optional<String?> comment;
ReactionType type;
@@ -63,15 +63,13 @@ class ActivityCreateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumId'] = this.albumId;
if (this.assetId != null) {
json[r'assetId'] = this.assetId;
} else {
// json[r'assetId'] = null;
if (this.assetId.isPresent) {
final value = this.assetId.value;
json[r'assetId'] = value;
}
if (this.comment != null) {
json[r'comment'] = this.comment;
} else {
// json[r'comment'] = null;
if (this.comment.isPresent) {
final value = this.comment.value;
json[r'comment'] = value;
}
json[r'type'] = this.type;
return json;
@@ -85,10 +83,21 @@ class ActivityCreateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'albumId'), 'Required key "ActivityCreateDto[albumId]" is missing from JSON.');
assert(json[r'albumId'] != null, 'Required key "ActivityCreateDto[albumId]" has a null value in JSON.');
assert(json.containsKey(r'type'), 'Required key "ActivityCreateDto[type]" is missing from JSON.');
assert(json[r'type'] != null, 'Required key "ActivityCreateDto[type]" has a null value in JSON.');
return true;
}());
return ActivityCreateDto(
albumId: mapValueOfType<String>(json, r'albumId')!,
assetId: mapValueOfType<String>(json, r'assetId'),
comment: mapValueOfType<String>(json, r'comment'),
assetId: json.containsKey(r'assetId') ? Optional.present(mapValueOfType<String>(json, r'assetId')) : const Optional.absent(),
comment: json.containsKey(r'comment') ? Optional.present(mapValueOfType<String>(json, r'comment')) : const Optional.absent(),
type: ReactionType.fromJson(json[r'type'])!,
);
}
+23 -8
View File
@@ -14,7 +14,7 @@ class ActivityResponseDto {
/// Returns a new [ActivityResponseDto] instance.
ActivityResponseDto({
required this.assetId,
this.comment,
this.comment = const Optional.absent(),
required this.createdAt,
required this.id,
required this.type,
@@ -25,7 +25,7 @@ class ActivityResponseDto {
String? assetId;
/// Comment text (for comment activities)
String? comment;
Optional<String?> comment;
/// Creation date
DateTime createdAt;
@@ -64,12 +64,11 @@ class ActivityResponseDto {
if (this.assetId != null) {
json[r'assetId'] = this.assetId;
} else {
// json[r'assetId'] = null;
json[r'assetId'] = null;
}
if (this.comment != null) {
json[r'comment'] = this.comment;
} else {
// json[r'comment'] = null;
if (this.comment.isPresent) {
final value = this.comment.value;
json[r'comment'] = value;
}
json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.createdAt.millisecondsSinceEpoch
@@ -88,9 +87,25 @@ class ActivityResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "ActivityResponseDto[assetId]" is missing from JSON.');
assert(json.containsKey(r'createdAt'), 'Required key "ActivityResponseDto[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "ActivityResponseDto[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "ActivityResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "ActivityResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'type'), 'Required key "ActivityResponseDto[type]" is missing from JSON.');
assert(json[r'type'] != null, 'Required key "ActivityResponseDto[type]" has a null value in JSON.');
assert(json.containsKey(r'user'), 'Required key "ActivityResponseDto[user]" is missing from JSON.');
assert(json[r'user'] != null, 'Required key "ActivityResponseDto[user]" has a null value in JSON.');
return true;
}());
return ActivityResponseDto(
assetId: mapValueOfType<String>(json, r'assetId'),
comment: mapValueOfType<String>(json, r'comment'),
comment: json.containsKey(r'comment') ? Optional.present(mapValueOfType<String>(json, r'comment')) : const Optional.absent(),
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
id: mapValueOfType<String>(json, r'id')!,
type: ReactionType.fromJson(json[r'type'])!,
@@ -58,6 +58,17 @@ class ActivityStatisticsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'comments'), 'Required key "ActivityStatisticsResponseDto[comments]" is missing from JSON.');
assert(json[r'comments'] != null, 'Required key "ActivityStatisticsResponseDto[comments]" has a null value in JSON.');
assert(json.containsKey(r'likes'), 'Required key "ActivityStatisticsResponseDto[likes]" is missing from JSON.');
assert(json[r'likes'] != null, 'Required key "ActivityStatisticsResponseDto[likes]" has a null value in JSON.');
return true;
}());
return ActivityStatisticsResponseDto(
comments: mapValueOfType<int>(json, r'comments')!,
likes: mapValueOfType<int>(json, r'likes')!,
+9
View File
@@ -45,6 +45,15 @@ class AddUsersDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'albumUsers'), 'Required key "AddUsersDto[albumUsers]" is missing from JSON.');
assert(json[r'albumUsers'] != null, 'Required key "AddUsersDto[albumUsers]" has a null value in JSON.');
return true;
}());
return AddUsersDto(
albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']),
);
@@ -45,6 +45,15 @@ class AdminOnboardingUpdateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'isOnboarded'), 'Required key "AdminOnboardingUpdateDto[isOnboarded]" is missing from JSON.');
assert(json[r'isOnboarded'] != null, 'Required key "AdminOnboardingUpdateDto[isOnboarded]" has a null value in JSON.');
return true;
}());
return AdminOnboardingUpdateDto(
isOnboarded: mapValueOfType<bool>(json, r'isOnboarded')!,
);
+60 -33
View File
@@ -17,17 +17,17 @@ class AlbumResponseDto {
required this.albumThumbnailAssetId,
this.albumUsers = const [],
required this.assetCount,
this.contributorCounts = const [],
this.contributorCounts = const Optional.present(const []),
required this.createdAt,
required this.description,
this.endDate,
this.endDate = const Optional.absent(),
required this.hasSharedLink,
required this.id,
required this.isActivityEnabled,
this.lastModifiedAssetTimestamp,
this.order,
this.lastModifiedAssetTimestamp = const Optional.absent(),
this.order = const Optional.absent(),
required this.shared,
this.startDate,
this.startDate = const Optional.absent(),
required this.updatedAt,
});
@@ -46,7 +46,7 @@ class AlbumResponseDto {
/// Maximum value: 9007199254740991
int assetCount;
List<ContributorCountResponseDto> contributorCounts;
Optional<List<ContributorCountResponseDto>?> contributorCounts;
/// Creation date
DateTime createdAt;
@@ -61,7 +61,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? endDate;
Optional<DateTime?> endDate;
/// Has shared link
bool hasSharedLink;
@@ -79,7 +79,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? lastModifiedAssetTimestamp;
Optional<DateTime?> lastModifiedAssetTimestamp;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -87,7 +87,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetOrder? order;
Optional<AssetOrder?> order;
/// Is shared album
bool shared;
@@ -99,7 +99,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? startDate;
Optional<DateTime?> startDate;
/// Last update date
DateTime updatedAt;
@@ -152,36 +152,35 @@ class AlbumResponseDto {
if (this.albumThumbnailAssetId != null) {
json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId;
} else {
// json[r'albumThumbnailAssetId'] = null;
json[r'albumThumbnailAssetId'] = null;
}
json[r'albumUsers'] = this.albumUsers;
json[r'assetCount'] = this.assetCount;
json[r'contributorCounts'] = this.contributorCounts;
if (this.contributorCounts.isPresent) {
final value = this.contributorCounts.value;
json[r'contributorCounts'] = value;
}
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
json[r'description'] = this.description;
if (this.endDate != null) {
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
} else {
// json[r'endDate'] = null;
if (this.endDate.isPresent) {
final value = this.endDate.value;
json[r'endDate'] = value == null ? null : value.toUtc().toIso8601String();
}
json[r'hasSharedLink'] = this.hasSharedLink;
json[r'id'] = this.id;
json[r'isActivityEnabled'] = this.isActivityEnabled;
if (this.lastModifiedAssetTimestamp != null) {
json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String();
} else {
// json[r'lastModifiedAssetTimestamp'] = null;
if (this.lastModifiedAssetTimestamp.isPresent) {
final value = this.lastModifiedAssetTimestamp.value;
json[r'lastModifiedAssetTimestamp'] = value == null ? null : value.toUtc().toIso8601String();
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
// json[r'order'] = null;
if (this.order.isPresent) {
final value = this.order.value;
json[r'order'] = value;
}
json[r'shared'] = this.shared;
if (this.startDate != null) {
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
} else {
// json[r'startDate'] = null;
if (this.startDate.isPresent) {
final value = this.startDate.value;
json[r'startDate'] = value == null ? null : value.toUtc().toIso8601String();
}
json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
return json;
@@ -195,22 +194,50 @@ class AlbumResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'albumName'), 'Required key "AlbumResponseDto[albumName]" is missing from JSON.');
assert(json[r'albumName'] != null, 'Required key "AlbumResponseDto[albumName]" has a null value in JSON.');
assert(json.containsKey(r'albumThumbnailAssetId'), 'Required key "AlbumResponseDto[albumThumbnailAssetId]" is missing from JSON.');
assert(json.containsKey(r'albumUsers'), 'Required key "AlbumResponseDto[albumUsers]" is missing from JSON.');
assert(json[r'albumUsers'] != null, 'Required key "AlbumResponseDto[albumUsers]" has a null value in JSON.');
assert(json.containsKey(r'assetCount'), 'Required key "AlbumResponseDto[assetCount]" is missing from JSON.');
assert(json[r'assetCount'] != null, 'Required key "AlbumResponseDto[assetCount]" has a null value in JSON.');
assert(json.containsKey(r'createdAt'), 'Required key "AlbumResponseDto[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "AlbumResponseDto[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'description'), 'Required key "AlbumResponseDto[description]" is missing from JSON.');
assert(json[r'description'] != null, 'Required key "AlbumResponseDto[description]" has a null value in JSON.');
assert(json.containsKey(r'hasSharedLink'), 'Required key "AlbumResponseDto[hasSharedLink]" is missing from JSON.');
assert(json[r'hasSharedLink'] != null, 'Required key "AlbumResponseDto[hasSharedLink]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AlbumResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AlbumResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'isActivityEnabled'), 'Required key "AlbumResponseDto[isActivityEnabled]" is missing from JSON.');
assert(json[r'isActivityEnabled'] != null, 'Required key "AlbumResponseDto[isActivityEnabled]" has a null value in JSON.');
assert(json.containsKey(r'shared'), 'Required key "AlbumResponseDto[shared]" is missing from JSON.');
assert(json[r'shared'] != null, 'Required key "AlbumResponseDto[shared]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "AlbumResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "AlbumResponseDto[updatedAt]" has a null value in JSON.');
return true;
}());
return AlbumResponseDto(
albumName: mapValueOfType<String>(json, r'albumName')!,
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']),
assetCount: mapValueOfType<int>(json, r'assetCount')!,
contributorCounts: ContributorCountResponseDto.listFromJson(json[r'contributorCounts']),
contributorCounts: json.containsKey(r'contributorCounts') ? Optional.present(ContributorCountResponseDto.listFromJson(json[r'contributorCounts'])) : const Optional.absent(),
createdAt: mapDateTime(json, r'createdAt', r'')!,
description: mapValueOfType<String>(json, r'description')!,
endDate: mapDateTime(json, r'endDate', r''),
endDate: json.containsKey(r'endDate') ? Optional.present(mapDateTime(json, r'endDate', r'')) : const Optional.absent(),
hasSharedLink: mapValueOfType<bool>(json, r'hasSharedLink')!,
id: mapValueOfType<String>(json, r'id')!,
isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled')!,
lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''),
order: AssetOrder.fromJson(json[r'order']),
lastModifiedAssetTimestamp: json.containsKey(r'lastModifiedAssetTimestamp') ? Optional.present(mapDateTime(json, r'lastModifiedAssetTimestamp', r'')) : const Optional.absent(),
order: json.containsKey(r'order') ? Optional.present(AssetOrder.fromJson(json[r'order'])) : const Optional.absent(),
shared: mapValueOfType<bool>(json, r'shared')!,
startDate: mapDateTime(json, r'startDate', r''),
startDate: json.containsKey(r'startDate') ? Optional.present(mapDateTime(json, r'startDate', r'')) : const Optional.absent(),
updatedAt: mapDateTime(json, r'updatedAt', r'')!,
);
}
@@ -68,6 +68,19 @@ class AlbumStatisticsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'notShared'), 'Required key "AlbumStatisticsResponseDto[notShared]" is missing from JSON.');
assert(json[r'notShared'] != null, 'Required key "AlbumStatisticsResponseDto[notShared]" has a null value in JSON.');
assert(json.containsKey(r'owned'), 'Required key "AlbumStatisticsResponseDto[owned]" is missing from JSON.');
assert(json[r'owned'] != null, 'Required key "AlbumStatisticsResponseDto[owned]" has a null value in JSON.');
assert(json.containsKey(r'shared'), 'Required key "AlbumStatisticsResponseDto[shared]" is missing from JSON.');
assert(json[r'shared'] != null, 'Required key "AlbumStatisticsResponseDto[shared]" has a null value in JSON.');
return true;
}());
return AlbumStatisticsResponseDto(
notShared: mapValueOfType<int>(json, r'notShared')!,
owned: mapValueOfType<int>(json, r'owned')!,
+15 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class AlbumUserAddDto {
/// Returns a new [AlbumUserAddDto] instance.
AlbumUserAddDto({
this.role,
this.role = const Optional.absent(),
required this.userId,
});
@@ -23,7 +23,7 @@ class AlbumUserAddDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AlbumUserRole? role;
Optional<AlbumUserRole?> role;
/// User ID
String userId;
@@ -44,10 +44,9 @@ class AlbumUserAddDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.role != null) {
json[r'role'] = this.role;
} else {
// json[r'role'] = null;
if (this.role.isPresent) {
final value = this.role.value;
json[r'role'] = value;
}
json[r'userId'] = this.userId;
return json;
@@ -61,8 +60,17 @@ class AlbumUserAddDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'userId'), 'Required key "AlbumUserAddDto[userId]" is missing from JSON.');
assert(json[r'userId'] != null, 'Required key "AlbumUserAddDto[userId]" has a null value in JSON.');
return true;
}());
return AlbumUserAddDto(
role: AlbumUserRole.fromJson(json[r'role']),
role: json.containsKey(r'role') ? Optional.present(AlbumUserRole.fromJson(json[r'role'])) : const Optional.absent(),
userId: mapValueOfType<String>(json, r'userId')!,
);
}
+11
View File
@@ -51,6 +51,17 @@ class AlbumUserCreateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'role'), 'Required key "AlbumUserCreateDto[role]" is missing from JSON.');
assert(json[r'role'] != null, 'Required key "AlbumUserCreateDto[role]" has a null value in JSON.');
assert(json.containsKey(r'userId'), 'Required key "AlbumUserCreateDto[userId]" is missing from JSON.');
assert(json[r'userId'] != null, 'Required key "AlbumUserCreateDto[userId]" has a null value in JSON.');
return true;
}());
return AlbumUserCreateDto(
role: AlbumUserRole.fromJson(json[r'role'])!,
userId: mapValueOfType<String>(json, r'userId')!,
+11
View File
@@ -50,6 +50,17 @@ class AlbumUserResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'role'), 'Required key "AlbumUserResponseDto[role]" is missing from JSON.');
assert(json[r'role'] != null, 'Required key "AlbumUserResponseDto[role]" has a null value in JSON.');
assert(json.containsKey(r'user'), 'Required key "AlbumUserResponseDto[user]" is missing from JSON.');
assert(json[r'user'] != null, 'Required key "AlbumUserResponseDto[user]" has a null value in JSON.');
return true;
}());
return AlbumUserResponseDto(
role: AlbumUserRole.fromJson(json[r'role'])!,
user: UserResponseDto.fromJson(json[r'user'])!,
+11
View File
@@ -52,6 +52,17 @@ class AlbumsAddAssetsDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'albumIds'), 'Required key "AlbumsAddAssetsDto[albumIds]" is missing from JSON.');
assert(json[r'albumIds'] != null, 'Required key "AlbumsAddAssetsDto[albumIds]" has a null value in JSON.');
assert(json.containsKey(r'assetIds'), 'Required key "AlbumsAddAssetsDto[assetIds]" is missing from JSON.');
assert(json[r'assetIds'] != null, 'Required key "AlbumsAddAssetsDto[assetIds]" has a null value in JSON.');
return true;
}());
return AlbumsAddAssetsDto(
albumIds: json[r'albumIds'] is Iterable
? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false)
+15 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class AlbumsAddAssetsResponseDto {
/// Returns a new [AlbumsAddAssetsResponseDto] instance.
AlbumsAddAssetsResponseDto({
this.error,
this.error = const Optional.absent(),
required this.success,
});
@@ -23,7 +23,7 @@ class AlbumsAddAssetsResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
BulkIdErrorReason? error;
Optional<BulkIdErrorReason?> error;
/// Operation success
bool success;
@@ -44,10 +44,9 @@ class AlbumsAddAssetsResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.error != null) {
json[r'error'] = this.error;
} else {
// json[r'error'] = null;
if (this.error.isPresent) {
final value = this.error.value;
json[r'error'] = value;
}
json[r'success'] = this.success;
return json;
@@ -61,8 +60,17 @@ class AlbumsAddAssetsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'success'), 'Required key "AlbumsAddAssetsResponseDto[success]" is missing from JSON.');
assert(json[r'success'] != null, 'Required key "AlbumsAddAssetsResponseDto[success]" has a null value in JSON.');
return true;
}());
return AlbumsAddAssetsResponseDto(
error: BulkIdErrorReason.fromJson(json[r'error']),
error: json.containsKey(r'error') ? Optional.present(BulkIdErrorReason.fromJson(json[r'error'])) : const Optional.absent(),
success: mapValueOfType<bool>(json, r'success')!,
);
}
+9
View File
@@ -44,6 +44,15 @@ class AlbumsResponse {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'defaultAssetOrder'), 'Required key "AlbumsResponse[defaultAssetOrder]" is missing from JSON.');
assert(json[r'defaultAssetOrder'] != null, 'Required key "AlbumsResponse[defaultAssetOrder]" has a null value in JSON.');
return true;
}());
return AlbumsResponse(
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!,
);
+13 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class AlbumsUpdate {
/// Returns a new [AlbumsUpdate] instance.
AlbumsUpdate({
this.defaultAssetOrder,
this.defaultAssetOrder = const Optional.absent(),
});
///
@@ -22,7 +22,7 @@ class AlbumsUpdate {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetOrder? defaultAssetOrder;
Optional<AssetOrder?> defaultAssetOrder;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumsUpdate &&
@@ -38,10 +38,9 @@ class AlbumsUpdate {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.defaultAssetOrder != null) {
json[r'defaultAssetOrder'] = this.defaultAssetOrder;
} else {
// json[r'defaultAssetOrder'] = null;
if (this.defaultAssetOrder.isPresent) {
final value = this.defaultAssetOrder.value;
json[r'defaultAssetOrder'] = value;
}
return json;
}
@@ -54,8 +53,15 @@ class AlbumsUpdate {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return AlbumsUpdate(
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']),
defaultAssetOrder: json.containsKey(r'defaultAssetOrder') ? Optional.present(AssetOrder.fromJson(json[r'defaultAssetOrder'])) : const Optional.absent(),
);
}
return null;
+15 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class ApiKeyCreateDto {
/// Returns a new [ApiKeyCreateDto] instance.
ApiKeyCreateDto({
this.name,
this.name = const Optional.absent(),
this.permissions = const [],
});
@@ -24,7 +24,7 @@ class ApiKeyCreateDto {
/// 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;
Optional<String?> name;
/// List of permissions
List<Permission> permissions;
@@ -45,10 +45,9 @@ class ApiKeyCreateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.name != null) {
json[r'name'] = this.name;
} else {
// json[r'name'] = null;
if (this.name.isPresent) {
final value = this.name.value;
json[r'name'] = value;
}
json[r'permissions'] = this.permissions;
return json;
@@ -62,8 +61,17 @@ class ApiKeyCreateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'permissions'), 'Required key "ApiKeyCreateDto[permissions]" is missing from JSON.');
assert(json[r'permissions'] != null, 'Required key "ApiKeyCreateDto[permissions]" has a null value in JSON.');
return true;
}());
return ApiKeyCreateDto(
name: mapValueOfType<String>(json, r'name'),
name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
permissions: Permission.listFromJson(json[r'permissions']),
);
}
@@ -51,6 +51,17 @@ class ApiKeyCreateResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'apiKey'), 'Required key "ApiKeyCreateResponseDto[apiKey]" is missing from JSON.');
assert(json[r'apiKey'] != null, 'Required key "ApiKeyCreateResponseDto[apiKey]" has a null value in JSON.');
assert(json.containsKey(r'secret'), 'Required key "ApiKeyCreateResponseDto[secret]" is missing from JSON.');
assert(json[r'secret'] != null, 'Required key "ApiKeyCreateResponseDto[secret]" has a null value in JSON.');
return true;
}());
return ApiKeyCreateResponseDto(
apiKey: ApiKeyResponseDto.fromJson(json[r'apiKey'])!,
secret: mapValueOfType<String>(json, r'secret')!,
+17
View File
@@ -77,6 +77,23 @@ class ApiKeyResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'createdAt'), 'Required key "ApiKeyResponseDto[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "ApiKeyResponseDto[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "ApiKeyResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "ApiKeyResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'name'), 'Required key "ApiKeyResponseDto[name]" is missing from JSON.');
assert(json[r'name'] != null, 'Required key "ApiKeyResponseDto[name]" has a null value in JSON.');
assert(json.containsKey(r'permissions'), 'Required key "ApiKeyResponseDto[permissions]" is missing from JSON.');
assert(json[r'permissions'] != null, 'Required key "ApiKeyResponseDto[permissions]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "ApiKeyResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "ApiKeyResponseDto[updatedAt]" has a null value in JSON.');
return true;
}());
return ApiKeyResponseDto(
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
id: mapValueOfType<String>(json, r'id')!,
+20 -11
View File
@@ -13,8 +13,8 @@ part of openapi.api;
class ApiKeyUpdateDto {
/// Returns a new [ApiKeyUpdateDto] instance.
ApiKeyUpdateDto({
this.name,
this.permissions = const [],
this.name = const Optional.absent(),
this.permissions = const Optional.present(const []),
});
/// API key name
@@ -24,10 +24,10 @@ class ApiKeyUpdateDto {
/// 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;
Optional<String?> name;
/// List of permissions
List<Permission> permissions;
Optional<List<Permission>?> permissions;
@override
bool operator ==(Object other) => identical(this, other) || other is ApiKeyUpdateDto &&
@@ -45,12 +45,14 @@ class ApiKeyUpdateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.name != null) {
json[r'name'] = this.name;
} else {
// json[r'name'] = null;
if (this.name.isPresent) {
final value = this.name.value;
json[r'name'] = value;
}
if (this.permissions.isPresent) {
final value = this.permissions.value;
json[r'permissions'] = value;
}
json[r'permissions'] = this.permissions;
return json;
}
@@ -62,9 +64,16 @@ class ApiKeyUpdateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return ApiKeyUpdateDto(
name: mapValueOfType<String>(json, r'name'),
permissions: Permission.listFromJson(json[r'permissions']),
name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
permissions: json.containsKey(r'permissions') ? Optional.present(Permission.listFromJson(json[r'permissions'])) : const Optional.absent(),
);
}
return null;
+15 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class AssetBulkDeleteDto {
/// Returns a new [AssetBulkDeleteDto] instance.
AssetBulkDeleteDto({
this.force,
this.force = const Optional.absent(),
this.ids = const [],
});
@@ -24,7 +24,7 @@ class AssetBulkDeleteDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? force;
Optional<bool?> force;
/// IDs to process
List<String> ids;
@@ -45,10 +45,9 @@ class AssetBulkDeleteDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.force != null) {
json[r'force'] = this.force;
} else {
// json[r'force'] = null;
if (this.force.isPresent) {
final value = this.force.value;
json[r'force'] = value;
}
json[r'ids'] = this.ids;
return json;
@@ -62,8 +61,17 @@ class AssetBulkDeleteDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'ids'), 'Required key "AssetBulkDeleteDto[ids]" is missing from JSON.');
assert(json[r'ids'] != null, 'Required key "AssetBulkDeleteDto[ids]" has a null value in JSON.');
return true;
}());
return AssetBulkDeleteDto(
force: mapValueOfType<bool>(json, r'force'),
force: json.containsKey(r'force') ? Optional.present(mapValueOfType<bool>(json, r'force')) : const Optional.absent(),
ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [],
+69 -70
View File
@@ -13,17 +13,17 @@ part of openapi.api;
class AssetBulkUpdateDto {
/// Returns a new [AssetBulkUpdateDto] instance.
AssetBulkUpdateDto({
this.dateTimeOriginal,
this.dateTimeRelative,
this.description,
this.duplicateId,
this.dateTimeOriginal = const Optional.absent(),
this.dateTimeRelative = const Optional.absent(),
this.description = const Optional.absent(),
this.duplicateId = const Optional.absent(),
this.ids = const [],
this.isFavorite,
this.latitude,
this.longitude,
this.rating,
this.timeZone,
this.visibility,
this.isFavorite = const Optional.absent(),
this.latitude = const Optional.absent(),
this.longitude = const Optional.absent(),
this.rating = const Optional.absent(),
this.timeZone = const Optional.absent(),
this.visibility = const Optional.absent(),
});
/// Original date and time
@@ -33,7 +33,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? dateTimeOriginal;
Optional<String?> dateTimeOriginal;
/// Relative time offset in seconds
///
@@ -45,7 +45,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? dateTimeRelative;
Optional<int?> dateTimeRelative;
/// Asset description
///
@@ -54,10 +54,10 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? description;
Optional<String?> description;
/// Duplicate ID
String? duplicateId;
Optional<String?> duplicateId;
/// Asset IDs to update
List<String> ids;
@@ -69,7 +69,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isFavorite;
Optional<bool?> isFavorite;
/// Latitude coordinate
///
@@ -81,7 +81,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? latitude;
Optional<num?> latitude;
/// Longitude coordinate
///
@@ -93,13 +93,13 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? longitude;
Optional<num?> longitude;
/// Rating in range [1-5], or null for unrated
///
/// Minimum value: -1
/// Maximum value: 5
int? rating;
Optional<int?> rating;
/// Time zone (IANA timezone)
///
@@ -108,7 +108,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? timeZone;
Optional<String?> timeZone;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -116,7 +116,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetVisibility? visibility;
Optional<AssetVisibility?> visibility;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetBulkUpdateDto &&
@@ -152,56 +152,46 @@ class AssetBulkUpdateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.dateTimeOriginal != null) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal;
} else {
// json[r'dateTimeOriginal'] = null;
if (this.dateTimeOriginal.isPresent) {
final value = this.dateTimeOriginal.value;
json[r'dateTimeOriginal'] = value;
}
if (this.dateTimeRelative != null) {
json[r'dateTimeRelative'] = this.dateTimeRelative;
} else {
// json[r'dateTimeRelative'] = null;
if (this.dateTimeRelative.isPresent) {
final value = this.dateTimeRelative.value;
json[r'dateTimeRelative'] = value;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
// json[r'description'] = null;
if (this.description.isPresent) {
final value = this.description.value;
json[r'description'] = value;
}
if (this.duplicateId != null) {
json[r'duplicateId'] = this.duplicateId;
} else {
// json[r'duplicateId'] = null;
if (this.duplicateId.isPresent) {
final value = this.duplicateId.value;
json[r'duplicateId'] = value;
}
json[r'ids'] = this.ids;
if (this.isFavorite != null) {
json[r'isFavorite'] = this.isFavorite;
} else {
// json[r'isFavorite'] = null;
if (this.isFavorite.isPresent) {
final value = this.isFavorite.value;
json[r'isFavorite'] = value;
}
if (this.latitude != null) {
json[r'latitude'] = this.latitude;
} else {
// json[r'latitude'] = null;
if (this.latitude.isPresent) {
final value = this.latitude.value;
json[r'latitude'] = value;
}
if (this.longitude != null) {
json[r'longitude'] = this.longitude;
} else {
// json[r'longitude'] = null;
if (this.longitude.isPresent) {
final value = this.longitude.value;
json[r'longitude'] = value;
}
if (this.rating != null) {
json[r'rating'] = this.rating;
} else {
// json[r'rating'] = null;
if (this.rating.isPresent) {
final value = this.rating.value;
json[r'rating'] = value;
}
if (this.timeZone != null) {
json[r'timeZone'] = this.timeZone;
} else {
// json[r'timeZone'] = null;
if (this.timeZone.isPresent) {
final value = this.timeZone.value;
json[r'timeZone'] = value;
}
if (this.visibility != null) {
json[r'visibility'] = this.visibility;
} else {
// json[r'visibility'] = null;
if (this.visibility.isPresent) {
final value = this.visibility.value;
json[r'visibility'] = value;
}
return json;
}
@@ -214,20 +204,29 @@ class AssetBulkUpdateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'ids'), 'Required key "AssetBulkUpdateDto[ids]" is missing from JSON.');
assert(json[r'ids'] != null, 'Required key "AssetBulkUpdateDto[ids]" has a null value in JSON.');
return true;
}());
return AssetBulkUpdateDto(
dateTimeOriginal: mapValueOfType<String>(json, r'dateTimeOriginal'),
dateTimeRelative: mapValueOfType<int>(json, r'dateTimeRelative'),
description: mapValueOfType<String>(json, r'description'),
duplicateId: mapValueOfType<String>(json, r'duplicateId'),
dateTimeOriginal: json.containsKey(r'dateTimeOriginal') ? Optional.present(mapValueOfType<String>(json, r'dateTimeOriginal')) : const Optional.absent(),
dateTimeRelative: json.containsKey(r'dateTimeRelative') ? Optional.present(json[r'dateTimeRelative'] == null ? null : int.parse('${json[r'dateTimeRelative']}')) : const Optional.absent(),
description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
duplicateId: json.containsKey(r'duplicateId') ? Optional.present(mapValueOfType<String>(json, r'duplicateId')) : const Optional.absent(),
ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [],
isFavorite: mapValueOfType<bool>(json, r'isFavorite'),
latitude: num.parse('${json[r'latitude']}'),
longitude: num.parse('${json[r'longitude']}'),
rating: mapValueOfType<int>(json, r'rating'),
timeZone: mapValueOfType<String>(json, r'timeZone'),
visibility: AssetVisibility.fromJson(json[r'visibility']),
isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
latitude: json.containsKey(r'latitude') ? Optional.present(json[r'latitude'] == null ? null : num.parse('${json[r'latitude']}')) : const Optional.absent(),
longitude: json.containsKey(r'longitude') ? Optional.present(json[r'longitude'] == null ? null : num.parse('${json[r'longitude']}')) : const Optional.absent(),
rating: json.containsKey(r'rating') ? Optional.present(json[r'rating'] == null ? null : int.parse('${json[r'rating']}')) : const Optional.absent(),
timeZone: json.containsKey(r'timeZone') ? Optional.present(mapValueOfType<String>(json, r'timeZone')) : const Optional.absent(),
visibility: json.containsKey(r'visibility') ? Optional.present(AssetVisibility.fromJson(json[r'visibility'])) : const Optional.absent(),
);
}
return null;
@@ -45,6 +45,15 @@ class AssetBulkUploadCheckDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assets'), 'Required key "AssetBulkUploadCheckDto[assets]" is missing from JSON.');
assert(json[r'assets'] != null, 'Required key "AssetBulkUploadCheckDto[assets]" has a null value in JSON.');
return true;
}());
return AssetBulkUploadCheckDto(
assets: AssetBulkUploadCheckItem.listFromJson(json[r'assets']),
);
@@ -52,6 +52,17 @@ class AssetBulkUploadCheckItem {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'checksum'), 'Required key "AssetBulkUploadCheckItem[checksum]" is missing from JSON.');
assert(json[r'checksum'] != null, 'Required key "AssetBulkUploadCheckItem[checksum]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckItem[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckItem[id]" has a null value in JSON.');
return true;
}());
return AssetBulkUploadCheckItem(
checksum: mapValueOfType<String>(json, r'checksum')!,
id: mapValueOfType<String>(json, r'id')!,
@@ -45,6 +45,15 @@ class AssetBulkUploadCheckResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'results'), 'Required key "AssetBulkUploadCheckResponseDto[results]" is missing from JSON.');
assert(json[r'results'] != null, 'Required key "AssetBulkUploadCheckResponseDto[results]" has a null value in JSON.');
return true;
}());
return AssetBulkUploadCheckResponseDto(
results: AssetBulkUploadCheckResult.listFromJson(json[r'results']),
);
+29 -21
View File
@@ -14,10 +14,10 @@ class AssetBulkUploadCheckResult {
/// Returns a new [AssetBulkUploadCheckResult] instance.
AssetBulkUploadCheckResult({
required this.action,
this.assetId,
this.assetId = const Optional.absent(),
required this.id,
this.isTrashed,
this.reason,
this.isTrashed = const Optional.absent(),
this.reason = const Optional.absent(),
});
AssetUploadAction action;
@@ -29,7 +29,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? assetId;
Optional<String?> assetId;
/// Asset ID
String id;
@@ -41,7 +41,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isTrashed;
Optional<bool?> isTrashed;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -49,7 +49,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetRejectReason? reason;
Optional<AssetRejectReason?> reason;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckResult &&
@@ -74,21 +74,18 @@ class AssetBulkUploadCheckResult {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'action'] = this.action;
if (this.assetId != null) {
json[r'assetId'] = this.assetId;
} else {
// json[r'assetId'] = null;
if (this.assetId.isPresent) {
final value = this.assetId.value;
json[r'assetId'] = value;
}
json[r'id'] = this.id;
if (this.isTrashed != null) {
json[r'isTrashed'] = this.isTrashed;
} else {
// json[r'isTrashed'] = null;
if (this.isTrashed.isPresent) {
final value = this.isTrashed.value;
json[r'isTrashed'] = value;
}
if (this.reason != null) {
json[r'reason'] = this.reason;
} else {
// json[r'reason'] = null;
if (this.reason.isPresent) {
final value = this.reason.value;
json[r'reason'] = value;
}
return json;
}
@@ -101,12 +98,23 @@ class AssetBulkUploadCheckResult {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'action'), 'Required key "AssetBulkUploadCheckResult[action]" is missing from JSON.');
assert(json[r'action'] != null, 'Required key "AssetBulkUploadCheckResult[action]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckResult[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckResult[id]" has a null value in JSON.');
return true;
}());
return AssetBulkUploadCheckResult(
action: AssetUploadAction.fromJson(json[r'action'])!,
assetId: mapValueOfType<String>(json, r'assetId'),
assetId: json.containsKey(r'assetId') ? Optional.present(mapValueOfType<String>(json, r'assetId')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!,
isTrashed: mapValueOfType<bool>(json, r'isTrashed'),
reason: AssetRejectReason.fromJson(json[r'reason']),
isTrashed: json.containsKey(r'isTrashed') ? Optional.present(mapValueOfType<bool>(json, r'isTrashed')) : const Optional.absent(),
reason: json.containsKey(r'reason') ? Optional.present(AssetRejectReason.fromJson(json[r'reason'])) : const Optional.absent(),
);
}
return null;
+46 -20
View File
@@ -13,32 +13,32 @@ part of openapi.api;
class AssetCopyDto {
/// Returns a new [AssetCopyDto] instance.
AssetCopyDto({
this.albums = true,
this.favorite = true,
this.sharedLinks = true,
this.sidecar = true,
this.albums = const Optional.present(true),
this.favorite = const Optional.present(true),
this.sharedLinks = const Optional.present(true),
this.sidecar = const Optional.present(true),
required this.sourceId,
this.stack = true,
this.stack = const Optional.present(true),
required this.targetId,
});
/// Copy album associations
bool albums;
Optional<bool?> albums;
/// Copy favorite status
bool favorite;
Optional<bool?> favorite;
/// Copy shared links
bool sharedLinks;
Optional<bool?> sharedLinks;
/// Copy sidecar file
bool sidecar;
Optional<bool?> sidecar;
/// Source asset ID
String sourceId;
/// Copy stack association
bool stack;
Optional<bool?> stack;
/// Target asset ID
String targetId;
@@ -69,12 +69,27 @@ class AssetCopyDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albums'] = this.albums;
json[r'favorite'] = this.favorite;
json[r'sharedLinks'] = this.sharedLinks;
json[r'sidecar'] = this.sidecar;
if (this.albums.isPresent) {
final value = this.albums.value;
json[r'albums'] = value;
}
if (this.favorite.isPresent) {
final value = this.favorite.value;
json[r'favorite'] = value;
}
if (this.sharedLinks.isPresent) {
final value = this.sharedLinks.value;
json[r'sharedLinks'] = value;
}
if (this.sidecar.isPresent) {
final value = this.sidecar.value;
json[r'sidecar'] = value;
}
json[r'sourceId'] = this.sourceId;
json[r'stack'] = this.stack;
if (this.stack.isPresent) {
final value = this.stack.value;
json[r'stack'] = value;
}
json[r'targetId'] = this.targetId;
return json;
}
@@ -87,13 +102,24 @@ class AssetCopyDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'sourceId'), 'Required key "AssetCopyDto[sourceId]" is missing from JSON.');
assert(json[r'sourceId'] != null, 'Required key "AssetCopyDto[sourceId]" has a null value in JSON.');
assert(json.containsKey(r'targetId'), 'Required key "AssetCopyDto[targetId]" is missing from JSON.');
assert(json[r'targetId'] != null, 'Required key "AssetCopyDto[targetId]" has a null value in JSON.');
return true;
}());
return AssetCopyDto(
albums: mapValueOfType<bool>(json, r'albums') ?? true,
favorite: mapValueOfType<bool>(json, r'favorite') ?? true,
sharedLinks: mapValueOfType<bool>(json, r'sharedLinks') ?? true,
sidecar: mapValueOfType<bool>(json, r'sidecar') ?? true,
albums: json.containsKey(r'albums') ? Optional.present(mapValueOfType<bool>(json, r'albums')) : const Optional.absent(),
favorite: json.containsKey(r'favorite') ? Optional.present(mapValueOfType<bool>(json, r'favorite')) : const Optional.absent(),
sharedLinks: json.containsKey(r'sharedLinks') ? Optional.present(mapValueOfType<bool>(json, r'sharedLinks')) : const Optional.absent(),
sidecar: json.containsKey(r'sidecar') ? Optional.present(mapValueOfType<bool>(json, r'sidecar')) : const Optional.absent(),
sourceId: mapValueOfType<String>(json, r'sourceId')!,
stack: mapValueOfType<bool>(json, r'stack') ?? true,
stack: json.containsKey(r'stack') ? Optional.present(mapValueOfType<bool>(json, r'stack')) : const Optional.absent(),
targetId: mapValueOfType<String>(json, r'targetId')!,
);
}
+11
View File
@@ -50,6 +50,17 @@ class AssetEditActionItemDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemDto[action]" is missing from JSON.');
assert(json[r'action'] != null, 'Required key "AssetEditActionItemDto[action]" has a null value in JSON.');
assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemDto[parameters]" is missing from JSON.');
assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemDto[parameters]" has a null value in JSON.');
return true;
}());
return AssetEditActionItemDto(
action: AssetEditAction.fromJson(json[r'action'])!,
parameters: json[r'parameters'],
@@ -91,6 +91,25 @@ class AssetEditActionItemDtoParameters {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'height'), 'Required key "AssetEditActionItemDtoParameters[height]" is missing from JSON.');
assert(json[r'height'] != null, 'Required key "AssetEditActionItemDtoParameters[height]" has a null value in JSON.');
assert(json.containsKey(r'width'), 'Required key "AssetEditActionItemDtoParameters[width]" is missing from JSON.');
assert(json[r'width'] != null, 'Required key "AssetEditActionItemDtoParameters[width]" has a null value in JSON.');
assert(json.containsKey(r'x'), 'Required key "AssetEditActionItemDtoParameters[x]" is missing from JSON.');
assert(json[r'x'] != null, 'Required key "AssetEditActionItemDtoParameters[x]" has a null value in JSON.');
assert(json.containsKey(r'y'), 'Required key "AssetEditActionItemDtoParameters[y]" is missing from JSON.');
assert(json[r'y'] != null, 'Required key "AssetEditActionItemDtoParameters[y]" has a null value in JSON.');
assert(json.containsKey(r'angle'), 'Required key "AssetEditActionItemDtoParameters[angle]" is missing from JSON.');
assert(json[r'angle'] != null, 'Required key "AssetEditActionItemDtoParameters[angle]" has a null value in JSON.');
assert(json.containsKey(r'axis'), 'Required key "AssetEditActionItemDtoParameters[axis]" is missing from JSON.');
assert(json[r'axis'] != null, 'Required key "AssetEditActionItemDtoParameters[axis]" has a null value in JSON.');
return true;
}());
return AssetEditActionItemDtoParameters(
height: mapValueOfType<int>(json, r'height')!,
width: mapValueOfType<int>(json, r'width')!,
@@ -57,6 +57,19 @@ class AssetEditActionItemResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemResponseDto[action]" is missing from JSON.');
assert(json[r'action'] != null, 'Required key "AssetEditActionItemResponseDto[action]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetEditActionItemResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetEditActionItemResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemResponseDto[parameters]" is missing from JSON.');
assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemResponseDto[parameters]" has a null value in JSON.');
return true;
}());
return AssetEditActionItemResponseDto(
action: AssetEditAction.fromJson(json[r'action'])!,
id: mapValueOfType<String>(json, r'id')!,
+9
View File
@@ -45,6 +45,15 @@ class AssetEditsCreateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'edits'), 'Required key "AssetEditsCreateDto[edits]" is missing from JSON.');
assert(json[r'edits'] != null, 'Required key "AssetEditsCreateDto[edits]" has a null value in JSON.');
return true;
}());
return AssetEditsCreateDto(
edits: AssetEditActionItemDto.listFromJson(json[r'edits']),
);
+11
View File
@@ -52,6 +52,17 @@ class AssetEditsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetEditsResponseDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetEditsResponseDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'edits'), 'Required key "AssetEditsResponseDto[edits]" is missing from JSON.');
assert(json[r'edits'] != null, 'Required key "AssetEditsResponseDto[edits]" has a null value in JSON.');
return true;
}());
return AssetEditsResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
edits: AssetEditActionItemResponseDto.listFromJson(json[r'edits']),
+23
View File
@@ -112,6 +112,29 @@ class AssetFaceCreateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetFaceCreateDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetFaceCreateDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'height'), 'Required key "AssetFaceCreateDto[height]" is missing from JSON.');
assert(json[r'height'] != null, 'Required key "AssetFaceCreateDto[height]" has a null value in JSON.');
assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceCreateDto[imageHeight]" is missing from JSON.');
assert(json[r'imageHeight'] != null, 'Required key "AssetFaceCreateDto[imageHeight]" has a null value in JSON.');
assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceCreateDto[imageWidth]" is missing from JSON.');
assert(json[r'imageWidth'] != null, 'Required key "AssetFaceCreateDto[imageWidth]" has a null value in JSON.');
assert(json.containsKey(r'personId'), 'Required key "AssetFaceCreateDto[personId]" is missing from JSON.');
assert(json[r'personId'] != null, 'Required key "AssetFaceCreateDto[personId]" has a null value in JSON.');
assert(json.containsKey(r'width'), 'Required key "AssetFaceCreateDto[width]" is missing from JSON.');
assert(json[r'width'] != null, 'Required key "AssetFaceCreateDto[width]" has a null value in JSON.');
assert(json.containsKey(r'x'), 'Required key "AssetFaceCreateDto[x]" is missing from JSON.');
assert(json[r'x'] != null, 'Required key "AssetFaceCreateDto[x]" has a null value in JSON.');
assert(json.containsKey(r'y'), 'Required key "AssetFaceCreateDto[y]" is missing from JSON.');
assert(json[r'y'] != null, 'Required key "AssetFaceCreateDto[y]" has a null value in JSON.');
return true;
}());
return AssetFaceCreateDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
height: mapValueOfType<int>(json, r'height')!,
+9
View File
@@ -45,6 +45,15 @@ class AssetFaceDeleteDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'force'), 'Required key "AssetFaceDeleteDto[force]" is missing from JSON.');
assert(json[r'force'] != null, 'Required key "AssetFaceDeleteDto[force]" has a null value in JSON.');
return true;
}());
return AssetFaceDeleteDto(
force: mapValueOfType<bool>(json, r'force')!,
);
+29 -8
View File
@@ -21,7 +21,7 @@ class AssetFaceResponseDto {
required this.imageHeight,
required this.imageWidth,
required this.person,
this.sourceType,
this.sourceType = const Optional.absent(),
});
/// Bounding box X1 coordinate
@@ -71,7 +71,7 @@ class AssetFaceResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
SourceType? sourceType;
Optional<SourceType?> sourceType;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetFaceResponseDto &&
@@ -113,12 +113,11 @@ class AssetFaceResponseDto {
if (this.person != null) {
json[r'person'] = this.person;
} else {
// json[r'person'] = null;
json[r'person'] = null;
}
if (this.sourceType != null) {
json[r'sourceType'] = this.sourceType;
} else {
// json[r'sourceType'] = null;
if (this.sourceType.isPresent) {
final value = this.sourceType.value;
json[r'sourceType'] = value;
}
return json;
}
@@ -131,6 +130,28 @@ class AssetFaceResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'boundingBoxX1'), 'Required key "AssetFaceResponseDto[boundingBoxX1]" is missing from JSON.');
assert(json[r'boundingBoxX1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX1]" has a null value in JSON.');
assert(json.containsKey(r'boundingBoxX2'), 'Required key "AssetFaceResponseDto[boundingBoxX2]" is missing from JSON.');
assert(json[r'boundingBoxX2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX2]" has a null value in JSON.');
assert(json.containsKey(r'boundingBoxY1'), 'Required key "AssetFaceResponseDto[boundingBoxY1]" is missing from JSON.');
assert(json[r'boundingBoxY1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY1]" has a null value in JSON.');
assert(json.containsKey(r'boundingBoxY2'), 'Required key "AssetFaceResponseDto[boundingBoxY2]" is missing from JSON.');
assert(json[r'boundingBoxY2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY2]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetFaceResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetFaceResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceResponseDto[imageHeight]" is missing from JSON.');
assert(json[r'imageHeight'] != null, 'Required key "AssetFaceResponseDto[imageHeight]" has a null value in JSON.');
assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceResponseDto[imageWidth]" is missing from JSON.');
assert(json[r'imageWidth'] != null, 'Required key "AssetFaceResponseDto[imageWidth]" has a null value in JSON.');
assert(json.containsKey(r'person'), 'Required key "AssetFaceResponseDto[person]" is missing from JSON.');
return true;
}());
return AssetFaceResponseDto(
boundingBoxX1: mapValueOfType<int>(json, r'boundingBoxX1')!,
boundingBoxX2: mapValueOfType<int>(json, r'boundingBoxX2')!,
@@ -140,7 +161,7 @@ class AssetFaceResponseDto {
imageHeight: mapValueOfType<int>(json, r'imageHeight')!,
imageWidth: mapValueOfType<int>(json, r'imageWidth')!,
person: PersonResponseDto.fromJson(json[r'person']),
sourceType: SourceType.fromJson(json[r'sourceType']),
sourceType: json.containsKey(r'sourceType') ? Optional.present(SourceType.fromJson(json[r'sourceType'])) : const Optional.absent(),
);
}
return null;
+9
View File
@@ -45,6 +45,15 @@ class AssetFaceUpdateDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'data'), 'Required key "AssetFaceUpdateDto[data]" is missing from JSON.');
assert(json[r'data'] != null, 'Required key "AssetFaceUpdateDto[data]" has a null value in JSON.');
return true;
}());
return AssetFaceUpdateDto(
data: AssetFaceUpdateItem.listFromJson(json[r'data']),
);
+11
View File
@@ -52,6 +52,17 @@ class AssetFaceUpdateItem {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetFaceUpdateItem[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetFaceUpdateItem[assetId]" has a null value in JSON.');
assert(json.containsKey(r'personId'), 'Required key "AssetFaceUpdateItem[personId]" is missing from JSON.');
assert(json[r'personId'] != null, 'Required key "AssetFaceUpdateItem[personId]" has a null value in JSON.');
return true;
}());
return AssetFaceUpdateItem(
assetId: mapValueOfType<String>(json, r'assetId')!,
personId: mapValueOfType<String>(json, r'personId')!,
+9
View File
@@ -45,6 +45,15 @@ class AssetIdsDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetIds'), 'Required key "AssetIdsDto[assetIds]" is missing from JSON.');
assert(json[r'assetIds'] != null, 'Required key "AssetIdsDto[assetIds]" has a null value in JSON.');
return true;
}());
return AssetIdsDto(
assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
+17 -7
View File
@@ -14,7 +14,7 @@ class AssetIdsResponseDto {
/// Returns a new [AssetIdsResponseDto] instance.
AssetIdsResponseDto({
required this.assetId,
this.error,
this.error = const Optional.absent(),
required this.success,
});
@@ -27,7 +27,7 @@ class AssetIdsResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetIdErrorReason? error;
Optional<AssetIdErrorReason?> error;
/// Whether operation succeeded
bool success;
@@ -51,10 +51,9 @@ class AssetIdsResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'assetId'] = this.assetId;
if (this.error != null) {
json[r'error'] = this.error;
} else {
// json[r'error'] = null;
if (this.error.isPresent) {
final value = this.error.value;
json[r'error'] = value;
}
json[r'success'] = this.success;
return json;
@@ -68,9 +67,20 @@ class AssetIdsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetIdsResponseDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetIdsResponseDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'success'), 'Required key "AssetIdsResponseDto[success]" is missing from JSON.');
assert(json[r'success'] != null, 'Required key "AssetIdsResponseDto[success]" has a null value in JSON.');
return true;
}());
return AssetIdsResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
error: AssetIdErrorReason.fromJson(json[r'error']),
error: json.containsKey(r'error') ? Optional.present(AssetIdErrorReason.fromJson(json[r'error'])) : const Optional.absent(),
success: mapValueOfType<bool>(json, r'success')!,
);
}
+11
View File
@@ -51,6 +51,17 @@ class AssetJobsDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetIds'), 'Required key "AssetJobsDto[assetIds]" is missing from JSON.');
assert(json[r'assetIds'] != null, 'Required key "AssetJobsDto[assetIds]" has a null value in JSON.');
assert(json.containsKey(r'name'), 'Required key "AssetJobsDto[name]" is missing from JSON.');
assert(json[r'name'] != null, 'Required key "AssetJobsDto[name]" has a null value in JSON.');
return true;
}());
return AssetJobsDto(
assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
+11
View File
@@ -51,6 +51,17 @@ class AssetMediaResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'id'), 'Required key "AssetMediaResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetMediaResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'status'), 'Required key "AssetMediaResponseDto[status]" is missing from JSON.');
assert(json[r'status'] != null, 'Required key "AssetMediaResponseDto[status]" has a null value in JSON.');
return true;
}());
return AssetMediaResponseDto(
id: mapValueOfType<String>(json, r'id')!,
status: AssetMediaStatus.fromJson(json[r'status'])!,
@@ -45,6 +45,15 @@ class AssetMetadataBulkDeleteDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkDeleteDto[items]" is missing from JSON.');
assert(json[r'items'] != null, 'Required key "AssetMetadataBulkDeleteDto[items]" has a null value in JSON.');
return true;
}());
return AssetMetadataBulkDeleteDto(
items: AssetMetadataBulkDeleteItemDto.listFromJson(json[r'items']),
);
@@ -52,6 +52,17 @@ class AssetMetadataBulkDeleteItemDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkDeleteItemDto[key]" is missing from JSON.');
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[key]" has a null value in JSON.');
return true;
}());
return AssetMetadataBulkDeleteItemDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
key: mapValueOfType<String>(json, r'key')!,
@@ -68,6 +68,21 @@ class AssetMetadataBulkResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkResponseDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkResponseDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkResponseDto[key]" is missing from JSON.');
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkResponseDto[key]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataBulkResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataBulkResponseDto[updatedAt]" has a null value in JSON.');
assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkResponseDto[value]" is missing from JSON.');
assert(json[r'value'] != null, 'Required key "AssetMetadataBulkResponseDto[value]" has a null value in JSON.');
return true;
}());
return AssetMetadataBulkResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
key: mapValueOfType<String>(json, r'key')!,
@@ -45,6 +45,15 @@ class AssetMetadataBulkUpsertDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkUpsertDto[items]" is missing from JSON.');
assert(json[r'items'] != null, 'Required key "AssetMetadataBulkUpsertDto[items]" has a null value in JSON.');
return true;
}());
return AssetMetadataBulkUpsertDto(
items: AssetMetadataBulkUpsertItemDto.listFromJson(json[r'items']),
);
@@ -59,6 +59,19 @@ class AssetMetadataBulkUpsertItemDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkUpsertItemDto[key]" is missing from JSON.');
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[key]" has a null value in JSON.');
assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkUpsertItemDto[value]" is missing from JSON.');
assert(json[r'value'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[value]" has a null value in JSON.');
return true;
}());
return AssetMetadataBulkUpsertItemDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
key: mapValueOfType<String>(json, r'key')!,
@@ -61,6 +61,19 @@ class AssetMetadataResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'key'), 'Required key "AssetMetadataResponseDto[key]" is missing from JSON.');
assert(json[r'key'] != null, 'Required key "AssetMetadataResponseDto[key]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataResponseDto[updatedAt]" has a null value in JSON.');
assert(json.containsKey(r'value'), 'Required key "AssetMetadataResponseDto[value]" is missing from JSON.');
assert(json[r'value'] != null, 'Required key "AssetMetadataResponseDto[value]" has a null value in JSON.');
return true;
}());
return AssetMetadataResponseDto(
key: mapValueOfType<String>(json, r'key')!,
updatedAt: mapDateTime(json, r'updatedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
+9
View File
@@ -45,6 +45,15 @@ class AssetMetadataUpsertDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'items'), 'Required key "AssetMetadataUpsertDto[items]" is missing from JSON.');
assert(json[r'items'] != null, 'Required key "AssetMetadataUpsertDto[items]" has a null value in JSON.');
return true;
}());
return AssetMetadataUpsertDto(
items: AssetMetadataUpsertItemDto.listFromJson(json[r'items']),
);
@@ -52,6 +52,17 @@ class AssetMetadataUpsertItemDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'key'), 'Required key "AssetMetadataUpsertItemDto[key]" is missing from JSON.');
assert(json[r'key'] != null, 'Required key "AssetMetadataUpsertItemDto[key]" has a null value in JSON.');
assert(json.containsKey(r'value'), 'Required key "AssetMetadataUpsertItemDto[value]" is missing from JSON.');
assert(json[r'value'] != null, 'Required key "AssetMetadataUpsertItemDto[value]" has a null value in JSON.');
return true;
}());
return AssetMetadataUpsertItemDto(
key: mapValueOfType<String>(json, r'key')!,
value: mapCastOfType<String, Object>(json, r'value')!,
+43 -10
View File
@@ -127,20 +127,53 @@ class AssetOcrResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetId'), 'Required key "AssetOcrResponseDto[assetId]" is missing from JSON.');
assert(json[r'assetId'] != null, 'Required key "AssetOcrResponseDto[assetId]" has a null value in JSON.');
assert(json.containsKey(r'boxScore'), 'Required key "AssetOcrResponseDto[boxScore]" is missing from JSON.');
assert(json[r'boxScore'] != null, 'Required key "AssetOcrResponseDto[boxScore]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetOcrResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetOcrResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'text'), 'Required key "AssetOcrResponseDto[text]" is missing from JSON.');
assert(json[r'text'] != null, 'Required key "AssetOcrResponseDto[text]" has a null value in JSON.');
assert(json.containsKey(r'textScore'), 'Required key "AssetOcrResponseDto[textScore]" is missing from JSON.');
assert(json[r'textScore'] != null, 'Required key "AssetOcrResponseDto[textScore]" has a null value in JSON.');
assert(json.containsKey(r'x1'), 'Required key "AssetOcrResponseDto[x1]" is missing from JSON.');
assert(json[r'x1'] != null, 'Required key "AssetOcrResponseDto[x1]" has a null value in JSON.');
assert(json.containsKey(r'x2'), 'Required key "AssetOcrResponseDto[x2]" is missing from JSON.');
assert(json[r'x2'] != null, 'Required key "AssetOcrResponseDto[x2]" has a null value in JSON.');
assert(json.containsKey(r'x3'), 'Required key "AssetOcrResponseDto[x3]" is missing from JSON.');
assert(json[r'x3'] != null, 'Required key "AssetOcrResponseDto[x3]" has a null value in JSON.');
assert(json.containsKey(r'x4'), 'Required key "AssetOcrResponseDto[x4]" is missing from JSON.');
assert(json[r'x4'] != null, 'Required key "AssetOcrResponseDto[x4]" has a null value in JSON.');
assert(json.containsKey(r'y1'), 'Required key "AssetOcrResponseDto[y1]" is missing from JSON.');
assert(json[r'y1'] != null, 'Required key "AssetOcrResponseDto[y1]" has a null value in JSON.');
assert(json.containsKey(r'y2'), 'Required key "AssetOcrResponseDto[y2]" is missing from JSON.');
assert(json[r'y2'] != null, 'Required key "AssetOcrResponseDto[y2]" has a null value in JSON.');
assert(json.containsKey(r'y3'), 'Required key "AssetOcrResponseDto[y3]" is missing from JSON.');
assert(json[r'y3'] != null, 'Required key "AssetOcrResponseDto[y3]" has a null value in JSON.');
assert(json.containsKey(r'y4'), 'Required key "AssetOcrResponseDto[y4]" is missing from JSON.');
assert(json[r'y4'] != null, 'Required key "AssetOcrResponseDto[y4]" has a null value in JSON.');
return true;
}());
return AssetOcrResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!,
boxScore: (mapValueOfType<num>(json, r'boxScore')!).toDouble(),
boxScore: mapValueOfType<double>(json, r'boxScore')!,
id: mapValueOfType<String>(json, r'id')!,
text: mapValueOfType<String>(json, r'text')!,
textScore: (mapValueOfType<num>(json, r'textScore')!).toDouble(),
x1: (mapValueOfType<num>(json, r'x1')!).toDouble(),
x2: (mapValueOfType<num>(json, r'x2')!).toDouble(),
x3: (mapValueOfType<num>(json, r'x3')!).toDouble(),
x4: (mapValueOfType<num>(json, r'x4')!).toDouble(),
y1: (mapValueOfType<num>(json, r'y1')!).toDouble(),
y2: (mapValueOfType<num>(json, r'y2')!).toDouble(),
y3: (mapValueOfType<num>(json, r'y3')!).toDouble(),
y4: (mapValueOfType<num>(json, r'y4')!).toDouble(),
textScore: mapValueOfType<double>(json, r'textScore')!,
x1: mapValueOfType<double>(json, r'x1')!,
x2: mapValueOfType<double>(json, r'x2')!,
x3: mapValueOfType<double>(json, r'x3')!,
x4: mapValueOfType<double>(json, r'x4')!,
y1: mapValueOfType<double>(json, r'y1')!,
y2: mapValueOfType<double>(json, r'y2')!,
y3: mapValueOfType<double>(json, r'y3')!,
y4: mapValueOfType<double>(json, r'y4')!,
);
}
return null;
+113 -68
View File
@@ -15,9 +15,9 @@ class AssetResponseDto {
AssetResponseDto({
required this.checksum,
required this.createdAt,
this.duplicateId,
this.duplicateId = const Optional.absent(),
required this.duration,
this.exifInfo,
this.exifInfo = const Optional.absent(),
required this.fileCreatedAt,
required this.fileModifiedAt,
required this.hasMetadata,
@@ -28,18 +28,18 @@ class AssetResponseDto {
required this.isFavorite,
required this.isOffline,
required this.isTrashed,
this.libraryId,
this.livePhotoVideoId,
this.libraryId = const Optional.absent(),
this.livePhotoVideoId = const Optional.absent(),
required this.localDateTime,
required this.originalFileName,
this.originalMimeType,
this.originalMimeType = const Optional.absent(),
required this.originalPath,
this.owner,
this.owner = const Optional.absent(),
required this.ownerId,
this.people = const [],
this.resized,
this.stack,
this.tags = const [],
this.people = const Optional.present(const []),
this.resized = const Optional.absent(),
this.stack = const Optional.absent(),
this.tags = const Optional.present(const []),
required this.thumbhash,
required this.type,
required this.updatedAt,
@@ -54,7 +54,7 @@ class AssetResponseDto {
DateTime createdAt;
/// Duplicate group ID
String? duplicateId;
Optional<String?> duplicateId;
/// Video/gif duration in milliseconds (null for static images)
///
@@ -68,7 +68,7 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ExifResponseDto? exifInfo;
Optional<ExifResponseDto?> exifInfo;
/// The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken.
DateTime fileCreatedAt;
@@ -104,10 +104,10 @@ class AssetResponseDto {
bool isTrashed;
/// Library ID
String? libraryId;
Optional<String?> libraryId;
/// Live photo video ID
String? livePhotoVideoId;
Optional<String?> livePhotoVideoId;
/// The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months.
DateTime localDateTime;
@@ -122,7 +122,7 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? originalMimeType;
Optional<String?> originalMimeType;
/// Original file path
String originalPath;
@@ -133,12 +133,12 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
UserResponseDto? owner;
Optional<UserResponseDto?> owner;
/// Owner user ID
String ownerId;
List<PersonResponseDto> people;
Optional<List<PersonResponseDto>?> people;
/// Is resized
///
@@ -147,11 +147,11 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? resized;
Optional<bool?> resized;
AssetStackResponseDto? stack;
Optional<AssetStackResponseDto?> stack;
List<TagResponseDto> tags;
Optional<List<TagResponseDto>?> tags;
/// Thumbhash for thumbnail generation (base64) also used as the c query param for thumbnail cache busting.
String? thumbhash;
@@ -247,20 +247,18 @@ class AssetResponseDto {
final json = <String, dynamic>{};
json[r'checksum'] = this.checksum;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
if (this.duplicateId != null) {
json[r'duplicateId'] = this.duplicateId;
} else {
// json[r'duplicateId'] = null;
if (this.duplicateId.isPresent) {
final value = this.duplicateId.value;
json[r'duplicateId'] = value;
}
if (this.duration != null) {
json[r'duration'] = this.duration;
} else {
// json[r'duration'] = null;
json[r'duration'] = null;
}
if (this.exifInfo != null) {
json[r'exifInfo'] = this.exifInfo;
} else {
// json[r'exifInfo'] = null;
if (this.exifInfo.isPresent) {
final value = this.exifInfo.value;
json[r'exifInfo'] = value;
}
json[r'fileCreatedAt'] = this.fileCreatedAt.toUtc().toIso8601String();
json[r'fileModifiedAt'] = this.fileModifiedAt.toUtc().toIso8601String();
@@ -268,7 +266,7 @@ class AssetResponseDto {
if (this.height != null) {
json[r'height'] = this.height;
} else {
// json[r'height'] = null;
json[r'height'] = null;
}
json[r'id'] = this.id;
json[r'isArchived'] = this.isArchived;
@@ -276,46 +274,46 @@ class AssetResponseDto {
json[r'isFavorite'] = this.isFavorite;
json[r'isOffline'] = this.isOffline;
json[r'isTrashed'] = this.isTrashed;
if (this.libraryId != null) {
json[r'libraryId'] = this.libraryId;
} else {
// json[r'libraryId'] = null;
if (this.libraryId.isPresent) {
final value = this.libraryId.value;
json[r'libraryId'] = value;
}
if (this.livePhotoVideoId != null) {
json[r'livePhotoVideoId'] = this.livePhotoVideoId;
} else {
// json[r'livePhotoVideoId'] = null;
if (this.livePhotoVideoId.isPresent) {
final value = this.livePhotoVideoId.value;
json[r'livePhotoVideoId'] = value;
}
json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String();
json[r'originalFileName'] = this.originalFileName;
if (this.originalMimeType != null) {
json[r'originalMimeType'] = this.originalMimeType;
} else {
// json[r'originalMimeType'] = null;
if (this.originalMimeType.isPresent) {
final value = this.originalMimeType.value;
json[r'originalMimeType'] = value;
}
json[r'originalPath'] = this.originalPath;
if (this.owner != null) {
json[r'owner'] = this.owner;
} else {
// json[r'owner'] = null;
if (this.owner.isPresent) {
final value = this.owner.value;
json[r'owner'] = value;
}
json[r'ownerId'] = this.ownerId;
json[r'people'] = this.people;
if (this.resized != null) {
json[r'resized'] = this.resized;
} else {
// json[r'resized'] = null;
if (this.people.isPresent) {
final value = this.people.value;
json[r'people'] = value;
}
if (this.stack != null) {
json[r'stack'] = this.stack;
} else {
// json[r'stack'] = null;
if (this.resized.isPresent) {
final value = this.resized.value;
json[r'resized'] = value;
}
if (this.stack.isPresent) {
final value = this.stack.value;
json[r'stack'] = value;
}
if (this.tags.isPresent) {
final value = this.tags.value;
json[r'tags'] = value;
}
json[r'tags'] = this.tags;
if (this.thumbhash != null) {
json[r'thumbhash'] = this.thumbhash;
} else {
// json[r'thumbhash'] = null;
json[r'thumbhash'] = null;
}
json[r'type'] = this.type;
json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
@@ -323,7 +321,7 @@ class AssetResponseDto {
if (this.width != null) {
json[r'width'] = this.width;
} else {
// json[r'width'] = null;
json[r'width'] = null;
}
return json;
}
@@ -336,12 +334,59 @@ class AssetResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'checksum'), 'Required key "AssetResponseDto[checksum]" is missing from JSON.');
assert(json[r'checksum'] != null, 'Required key "AssetResponseDto[checksum]" has a null value in JSON.');
assert(json.containsKey(r'createdAt'), 'Required key "AssetResponseDto[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "AssetResponseDto[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'duration'), 'Required key "AssetResponseDto[duration]" is missing from JSON.');
assert(json.containsKey(r'fileCreatedAt'), 'Required key "AssetResponseDto[fileCreatedAt]" is missing from JSON.');
assert(json[r'fileCreatedAt'] != null, 'Required key "AssetResponseDto[fileCreatedAt]" has a null value in JSON.');
assert(json.containsKey(r'fileModifiedAt'), 'Required key "AssetResponseDto[fileModifiedAt]" is missing from JSON.');
assert(json[r'fileModifiedAt'] != null, 'Required key "AssetResponseDto[fileModifiedAt]" has a null value in JSON.');
assert(json.containsKey(r'hasMetadata'), 'Required key "AssetResponseDto[hasMetadata]" is missing from JSON.');
assert(json[r'hasMetadata'] != null, 'Required key "AssetResponseDto[hasMetadata]" has a null value in JSON.');
assert(json.containsKey(r'height'), 'Required key "AssetResponseDto[height]" is missing from JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'isArchived'), 'Required key "AssetResponseDto[isArchived]" is missing from JSON.');
assert(json[r'isArchived'] != null, 'Required key "AssetResponseDto[isArchived]" has a null value in JSON.');
assert(json.containsKey(r'isEdited'), 'Required key "AssetResponseDto[isEdited]" is missing from JSON.');
assert(json[r'isEdited'] != null, 'Required key "AssetResponseDto[isEdited]" has a null value in JSON.');
assert(json.containsKey(r'isFavorite'), 'Required key "AssetResponseDto[isFavorite]" is missing from JSON.');
assert(json[r'isFavorite'] != null, 'Required key "AssetResponseDto[isFavorite]" has a null value in JSON.');
assert(json.containsKey(r'isOffline'), 'Required key "AssetResponseDto[isOffline]" is missing from JSON.');
assert(json[r'isOffline'] != null, 'Required key "AssetResponseDto[isOffline]" has a null value in JSON.');
assert(json.containsKey(r'isTrashed'), 'Required key "AssetResponseDto[isTrashed]" is missing from JSON.');
assert(json[r'isTrashed'] != null, 'Required key "AssetResponseDto[isTrashed]" has a null value in JSON.');
assert(json.containsKey(r'localDateTime'), 'Required key "AssetResponseDto[localDateTime]" is missing from JSON.');
assert(json[r'localDateTime'] != null, 'Required key "AssetResponseDto[localDateTime]" has a null value in JSON.');
assert(json.containsKey(r'originalFileName'), 'Required key "AssetResponseDto[originalFileName]" is missing from JSON.');
assert(json[r'originalFileName'] != null, 'Required key "AssetResponseDto[originalFileName]" has a null value in JSON.');
assert(json.containsKey(r'originalPath'), 'Required key "AssetResponseDto[originalPath]" is missing from JSON.');
assert(json[r'originalPath'] != null, 'Required key "AssetResponseDto[originalPath]" has a null value in JSON.');
assert(json.containsKey(r'ownerId'), 'Required key "AssetResponseDto[ownerId]" is missing from JSON.');
assert(json[r'ownerId'] != null, 'Required key "AssetResponseDto[ownerId]" has a null value in JSON.');
assert(json.containsKey(r'thumbhash'), 'Required key "AssetResponseDto[thumbhash]" is missing from JSON.');
assert(json.containsKey(r'type'), 'Required key "AssetResponseDto[type]" is missing from JSON.');
assert(json[r'type'] != null, 'Required key "AssetResponseDto[type]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "AssetResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "AssetResponseDto[updatedAt]" has a null value in JSON.');
assert(json.containsKey(r'visibility'), 'Required key "AssetResponseDto[visibility]" is missing from JSON.');
assert(json[r'visibility'] != null, 'Required key "AssetResponseDto[visibility]" has a null value in JSON.');
assert(json.containsKey(r'width'), 'Required key "AssetResponseDto[width]" is missing from JSON.');
return true;
}());
return AssetResponseDto(
checksum: mapValueOfType<String>(json, r'checksum')!,
createdAt: mapDateTime(json, r'createdAt', r'')!,
duplicateId: mapValueOfType<String>(json, r'duplicateId'),
duplicateId: json.containsKey(r'duplicateId') ? Optional.present(mapValueOfType<String>(json, r'duplicateId')) : const Optional.absent(),
duration: mapValueOfType<int>(json, r'duration'),
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']),
exifInfo: json.containsKey(r'exifInfo') ? Optional.present(ExifResponseDto.fromJson(json[r'exifInfo'])) : const Optional.absent(),
fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!,
fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!,
hasMetadata: mapValueOfType<bool>(json, r'hasMetadata')!,
@@ -352,18 +397,18 @@ class AssetResponseDto {
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!,
isOffline: mapValueOfType<bool>(json, r'isOffline')!,
isTrashed: mapValueOfType<bool>(json, r'isTrashed')!,
libraryId: mapValueOfType<String>(json, r'libraryId'),
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
libraryId: json.containsKey(r'libraryId') ? Optional.present(mapValueOfType<String>(json, r'libraryId')) : const Optional.absent(),
livePhotoVideoId: json.containsKey(r'livePhotoVideoId') ? Optional.present(mapValueOfType<String>(json, r'livePhotoVideoId')) : const Optional.absent(),
localDateTime: mapDateTime(json, r'localDateTime', r'')!,
originalFileName: mapValueOfType<String>(json, r'originalFileName')!,
originalMimeType: mapValueOfType<String>(json, r'originalMimeType'),
originalMimeType: json.containsKey(r'originalMimeType') ? Optional.present(mapValueOfType<String>(json, r'originalMimeType')) : const Optional.absent(),
originalPath: mapValueOfType<String>(json, r'originalPath')!,
owner: UserResponseDto.fromJson(json[r'owner']),
owner: json.containsKey(r'owner') ? Optional.present(UserResponseDto.fromJson(json[r'owner'])) : const Optional.absent(),
ownerId: mapValueOfType<String>(json, r'ownerId')!,
people: PersonResponseDto.listFromJson(json[r'people']),
resized: mapValueOfType<bool>(json, r'resized'),
stack: AssetStackResponseDto.fromJson(json[r'stack']),
tags: TagResponseDto.listFromJson(json[r'tags']),
people: json.containsKey(r'people') ? Optional.present(PersonResponseDto.listFromJson(json[r'people'])) : const Optional.absent(),
resized: json.containsKey(r'resized') ? Optional.present(mapValueOfType<bool>(json, r'resized')) : const Optional.absent(),
stack: json.containsKey(r'stack') ? Optional.present(AssetStackResponseDto.fromJson(json[r'stack'])) : const Optional.absent(),
tags: json.containsKey(r'tags') ? Optional.present(TagResponseDto.listFromJson(json[r'tags'])) : const Optional.absent(),
thumbhash: mapValueOfType<String>(json, r'thumbhash'),
type: AssetTypeEnum.fromJson(json[r'type'])!,
updatedAt: mapDateTime(json, r'updatedAt', r'')!,
+13
View File
@@ -62,6 +62,19 @@ class AssetStackResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'assetCount'), 'Required key "AssetStackResponseDto[assetCount]" is missing from JSON.');
assert(json[r'assetCount'] != null, 'Required key "AssetStackResponseDto[assetCount]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "AssetStackResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "AssetStackResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'primaryAssetId'), 'Required key "AssetStackResponseDto[primaryAssetId]" is missing from JSON.');
assert(json[r'primaryAssetId'] != null, 'Required key "AssetStackResponseDto[primaryAssetId]" has a null value in JSON.');
return true;
}());
return AssetStackResponseDto(
assetCount: mapValueOfType<int>(json, r'assetCount')!,
id: mapValueOfType<String>(json, r'id')!,
+13
View File
@@ -68,6 +68,19 @@ class AssetStatsResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'images'), 'Required key "AssetStatsResponseDto[images]" is missing from JSON.');
assert(json[r'images'] != null, 'Required key "AssetStatsResponseDto[images]" has a null value in JSON.');
assert(json.containsKey(r'total'), 'Required key "AssetStatsResponseDto[total]" is missing from JSON.');
assert(json[r'total'] != null, 'Required key "AssetStatsResponseDto[total]" has a null value in JSON.');
assert(json.containsKey(r'videos'), 'Required key "AssetStatsResponseDto[videos]" is missing from JSON.');
assert(json[r'videos'] != null, 'Required key "AssetStatsResponseDto[videos]" has a null value in JSON.');
return true;
}());
return AssetStatsResponseDto(
images: mapValueOfType<int>(json, r'images')!,
total: mapValueOfType<int>(json, r'total')!,
+25 -14
View File
@@ -13,11 +13,11 @@ part of openapi.api;
class AuthStatusResponseDto {
/// Returns a new [AuthStatusResponseDto] instance.
AuthStatusResponseDto({
this.expiresAt,
this.expiresAt = const Optional.absent(),
required this.isElevated,
required this.password,
required this.pinCode,
this.pinExpiresAt,
this.pinExpiresAt = const Optional.absent(),
});
/// Session expiration date
@@ -27,7 +27,7 @@ class AuthStatusResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? expiresAt;
Optional<String?> expiresAt;
/// Is elevated session
bool isElevated;
@@ -45,7 +45,7 @@ class AuthStatusResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? pinExpiresAt;
Optional<String?> pinExpiresAt;
@override
bool operator ==(Object other) => identical(this, other) || other is AuthStatusResponseDto &&
@@ -69,18 +69,16 @@ class AuthStatusResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.expiresAt != null) {
json[r'expiresAt'] = this.expiresAt;
} else {
// json[r'expiresAt'] = null;
if (this.expiresAt.isPresent) {
final value = this.expiresAt.value;
json[r'expiresAt'] = value;
}
json[r'isElevated'] = this.isElevated;
json[r'password'] = this.password;
json[r'pinCode'] = this.pinCode;
if (this.pinExpiresAt != null) {
json[r'pinExpiresAt'] = this.pinExpiresAt;
} else {
// json[r'pinExpiresAt'] = null;
if (this.pinExpiresAt.isPresent) {
final value = this.pinExpiresAt.value;
json[r'pinExpiresAt'] = value;
}
return json;
}
@@ -93,12 +91,25 @@ class AuthStatusResponseDto {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'isElevated'), 'Required key "AuthStatusResponseDto[isElevated]" is missing from JSON.');
assert(json[r'isElevated'] != null, 'Required key "AuthStatusResponseDto[isElevated]" has a null value in JSON.');
assert(json.containsKey(r'password'), 'Required key "AuthStatusResponseDto[password]" is missing from JSON.');
assert(json[r'password'] != null, 'Required key "AuthStatusResponseDto[password]" has a null value in JSON.');
assert(json.containsKey(r'pinCode'), 'Required key "AuthStatusResponseDto[pinCode]" is missing from JSON.');
assert(json[r'pinCode'] != null, 'Required key "AuthStatusResponseDto[pinCode]" has a null value in JSON.');
return true;
}());
return AuthStatusResponseDto(
expiresAt: mapValueOfType<String>(json, r'expiresAt'),
expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapValueOfType<String>(json, r'expiresAt')) : const Optional.absent(),
isElevated: mapValueOfType<bool>(json, r'isElevated')!,
password: mapValueOfType<bool>(json, r'password')!,
pinCode: mapValueOfType<bool>(json, r'pinCode')!,
pinExpiresAt: mapValueOfType<String>(json, r'pinExpiresAt'),
pinExpiresAt: json.containsKey(r'pinExpiresAt') ? Optional.present(mapValueOfType<String>(json, r'pinExpiresAt')) : const Optional.absent(),
);
}
return null;
+13 -7
View File
@@ -13,7 +13,7 @@ part of openapi.api;
class AvatarUpdate {
/// Returns a new [AvatarUpdate] instance.
AvatarUpdate({
this.color,
this.color = const Optional.absent(),
});
///
@@ -22,7 +22,7 @@ class AvatarUpdate {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
UserAvatarColor? color;
Optional<UserAvatarColor?> color;
@override
bool operator ==(Object other) => identical(this, other) || other is AvatarUpdate &&
@@ -38,10 +38,9 @@ class AvatarUpdate {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.color != null) {
json[r'color'] = this.color;
} else {
// json[r'color'] = null;
if (this.color.isPresent) {
final value = this.color.value;
json[r'color'] = value;
}
return json;
}
@@ -54,8 +53,15 @@ class AvatarUpdate {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return AvatarUpdate(
color: UserAvatarColor.fromJson(json[r'color']),
color: json.containsKey(r'color') ? Optional.present(UserAvatarColor.fromJson(json[r'color'])) : const Optional.absent(),
);
}
return null;
-132
View File
@@ -1,132 +0,0 @@
//
// 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',
};
}
-99
View File
@@ -1,99 +0,0 @@
//
// 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',
};
}
-88
View File
@@ -1,88 +0,0 @@
//
// 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;
}

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