feat(server): make is favorite optional on asset upload (#4865)

* feat(server): make isFavorite optional

* chore: open api

* chore: e2e
This commit is contained in:
Jason Rasmussen 2023-11-06 09:04:39 -05:00 committed by GitHub
parent 9e7a32804b
commit 279481ad54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 61 additions and 58 deletions

View file

@ -1855,7 +1855,7 @@ export interface ImportAssetDto {
* @type {boolean} * @type {boolean}
* @memberof ImportAssetDto * @memberof ImportAssetDto
*/ */
'isFavorite': boolean; 'isFavorite'?: boolean;
/** /**
* *
* @type {boolean} * @type {boolean}
@ -7868,11 +7868,11 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
* @param {string} deviceId * @param {string} deviceId
* @param {string} fileCreatedAt * @param {string} fileCreatedAt
* @param {string} fileModifiedAt * @param {string} fileModifiedAt
* @param {boolean} isFavorite
* @param {string} [key] * @param {string} [key]
* @param {string} [duration] * @param {string} [duration]
* @param {boolean} [isArchived] * @param {boolean} [isArchived]
* @param {boolean} [isExternal] * @param {boolean} [isExternal]
* @param {boolean} [isFavorite]
* @param {boolean} [isOffline] * @param {boolean} [isOffline]
* @param {boolean} [isReadOnly] * @param {boolean} [isReadOnly]
* @param {boolean} [isVisible] * @param {boolean} [isVisible]
@ -7882,7 +7882,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'assetData' is not null or undefined // verify required parameter 'assetData' is not null or undefined
assertParamExists('uploadFile', 'assetData', assetData) assertParamExists('uploadFile', 'assetData', assetData)
// verify required parameter 'deviceAssetId' is not null or undefined // verify required parameter 'deviceAssetId' is not null or undefined
@ -7893,8 +7893,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt) assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt)
// verify required parameter 'fileModifiedAt' is not null or undefined // verify required parameter 'fileModifiedAt' is not null or undefined
assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt) assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt)
// verify required parameter 'isFavorite' is not null or undefined
assertParamExists('uploadFile', 'isFavorite', isFavorite)
const localVarPath = `/asset/upload`; const localVarPath = `/asset/upload`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@ -8335,11 +8333,11 @@ export const AssetApiFp = function(configuration?: Configuration) {
* @param {string} deviceId * @param {string} deviceId
* @param {string} fileCreatedAt * @param {string} fileCreatedAt
* @param {string} fileModifiedAt * @param {string} fileModifiedAt
* @param {boolean} isFavorite
* @param {string} [key] * @param {string} [key]
* @param {string} [duration] * @param {string} [duration]
* @param {boolean} [isArchived] * @param {boolean} [isArchived]
* @param {boolean} [isExternal] * @param {boolean} [isExternal]
* @param {boolean} [isFavorite]
* @param {boolean} [isOffline] * @param {boolean} [isOffline]
* @param {boolean} [isReadOnly] * @param {boolean} [isReadOnly]
* @param {boolean} [isVisible] * @param {boolean} [isVisible]
@ -8349,8 +8347,8 @@ export const AssetApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssetFileUploadResponseDto>> { async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssetFileUploadResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
}, },
} }
@ -8626,7 +8624,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError} * @throws {RequiredError}
*/ */
uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise<AssetFileUploadResponseDto> { uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise<AssetFileUploadResponseDto> {
return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath));
}, },
}; };
}; };
@ -9274,13 +9272,6 @@ export interface AssetApiUploadFileRequest {
*/ */
readonly fileModifiedAt: string readonly fileModifiedAt: string
/**
*
* @type {boolean}
* @memberof AssetApiUploadFile
*/
readonly isFavorite: boolean
/** /**
* *
* @type {string} * @type {string}
@ -9309,6 +9300,13 @@ export interface AssetApiUploadFileRequest {
*/ */
readonly isExternal?: boolean readonly isExternal?: boolean
/**
*
* @type {boolean}
* @memberof AssetApiUploadFile
*/
readonly isFavorite?: boolean
/** /**
* *
* @type {boolean} * @type {boolean}
@ -9681,7 +9679,7 @@ export class AssetApi extends BaseAPI {
* @memberof AssetApi * @memberof AssetApi
*/ */
public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) { public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) {
return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath));
} }
} }

View file

@ -1696,7 +1696,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **uploadFile** # **uploadFile**
> AssetFileUploadResponseDto uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData) > AssetFileUploadResponseDto uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData)
@ -1724,11 +1724,11 @@ final deviceAssetId = deviceAssetId_example; // String |
final deviceId = deviceId_example; // String | final deviceId = deviceId_example; // String |
final fileCreatedAt = 2013-10-20T19:20:30+01:00; // DateTime | final fileCreatedAt = 2013-10-20T19:20:30+01:00; // DateTime |
final fileModifiedAt = 2013-10-20T19:20:30+01:00; // DateTime | final fileModifiedAt = 2013-10-20T19:20:30+01:00; // DateTime |
final isFavorite = true; // bool |
final key = key_example; // String | final key = key_example; // String |
final duration = duration_example; // String | final duration = duration_example; // String |
final isArchived = true; // bool | final isArchived = true; // bool |
final isExternal = true; // bool | final isExternal = true; // bool |
final isFavorite = true; // bool |
final isOffline = true; // bool | final isOffline = true; // bool |
final isReadOnly = true; // bool | final isReadOnly = true; // bool |
final isVisible = true; // bool | final isVisible = true; // bool |
@ -1737,7 +1737,7 @@ final livePhotoData = BINARY_DATA_HERE; // MultipartFile |
final sidecarData = BINARY_DATA_HERE; // MultipartFile | final sidecarData = BINARY_DATA_HERE; // MultipartFile |
try { try {
final result = api_instance.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData); final result = api_instance.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling AssetApi->uploadFile: $e\n'); print('Exception when calling AssetApi->uploadFile: $e\n');
@ -1753,11 +1753,11 @@ Name | Type | Description | Notes
**deviceId** | **String**| | **deviceId** | **String**| |
**fileCreatedAt** | **DateTime**| | **fileCreatedAt** | **DateTime**| |
**fileModifiedAt** | **DateTime**| | **fileModifiedAt** | **DateTime**| |
**isFavorite** | **bool**| |
**key** | **String**| | [optional] **key** | **String**| | [optional]
**duration** | **String**| | [optional] **duration** | **String**| | [optional]
**isArchived** | **bool**| | [optional] **isArchived** | **bool**| | [optional]
**isExternal** | **bool**| | [optional] **isExternal** | **bool**| | [optional]
**isFavorite** | **bool**| | [optional]
**isOffline** | **bool**| | [optional] **isOffline** | **bool**| | [optional]
**isReadOnly** | **bool**| | [optional] **isReadOnly** | **bool**| | [optional]
**isVisible** | **bool**| | [optional] **isVisible** | **bool**| | [optional]

View file

@ -16,7 +16,7 @@ Name | Type | Description | Notes
**fileModifiedAt** | [**DateTime**](DateTime.md) | | **fileModifiedAt** | [**DateTime**](DateTime.md) | |
**isArchived** | **bool** | | [optional] **isArchived** | **bool** | | [optional]
**isExternal** | **bool** | | [optional] **isExternal** | **bool** | | [optional]
**isFavorite** | **bool** | | **isFavorite** | **bool** | | [optional]
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**isReadOnly** | **bool** | | [optional] [default to true] **isReadOnly** | **bool** | | [optional] [default to true]
**isVisible** | **bool** | | [optional] **isVisible** | **bool** | | [optional]

View file

@ -1660,8 +1660,6 @@ class AssetApi {
/// ///
/// * [DateTime] fileModifiedAt (required): /// * [DateTime] fileModifiedAt (required):
/// ///
/// * [bool] isFavorite (required):
///
/// * [String] key: /// * [String] key:
/// ///
/// * [String] duration: /// * [String] duration:
@ -1670,6 +1668,8 @@ class AssetApi {
/// ///
/// * [bool] isExternal: /// * [bool] isExternal:
/// ///
/// * [bool] isFavorite:
///
/// * [bool] isOffline: /// * [bool] isOffline:
/// ///
/// * [bool] isReadOnly: /// * [bool] isReadOnly:
@ -1681,7 +1681,7 @@ class AssetApi {
/// * [MultipartFile] livePhotoData: /// * [MultipartFile] livePhotoData:
/// ///
/// * [MultipartFile] sidecarData: /// * [MultipartFile] sidecarData:
Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async { Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final path = r'/asset/upload'; final path = r'/asset/upload';
@ -1790,8 +1790,6 @@ class AssetApi {
/// ///
/// * [DateTime] fileModifiedAt (required): /// * [DateTime] fileModifiedAt (required):
/// ///
/// * [bool] isFavorite (required):
///
/// * [String] key: /// * [String] key:
/// ///
/// * [String] duration: /// * [String] duration:
@ -1800,6 +1798,8 @@ class AssetApi {
/// ///
/// * [bool] isExternal: /// * [bool] isExternal:
/// ///
/// * [bool] isFavorite:
///
/// * [bool] isOffline: /// * [bool] isOffline:
/// ///
/// * [bool] isReadOnly: /// * [bool] isReadOnly:
@ -1811,8 +1811,8 @@ class AssetApi {
/// * [MultipartFile] livePhotoData: /// * [MultipartFile] livePhotoData:
/// ///
/// * [MultipartFile] sidecarData: /// * [MultipartFile] sidecarData:
Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async { Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, ); final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isFavorite: isFavorite, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }

View file

@ -21,7 +21,7 @@ class ImportAssetDto {
required this.fileModifiedAt, required this.fileModifiedAt,
this.isArchived, this.isArchived,
this.isExternal, this.isExternal,
required this.isFavorite, this.isFavorite,
this.isOffline, this.isOffline,
this.isReadOnly = true, this.isReadOnly = true,
this.isVisible, this.isVisible,
@ -63,7 +63,13 @@ class ImportAssetDto {
/// ///
bool? isExternal; bool? isExternal;
bool isFavorite; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isFavorite;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -127,7 +133,7 @@ class ImportAssetDto {
(fileModifiedAt.hashCode) + (fileModifiedAt.hashCode) +
(isArchived == null ? 0 : isArchived!.hashCode) + (isArchived == null ? 0 : isArchived!.hashCode) +
(isExternal == null ? 0 : isExternal!.hashCode) + (isExternal == null ? 0 : isExternal!.hashCode) +
(isFavorite.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) + (isOffline == null ? 0 : isOffline!.hashCode) +
(isReadOnly.hashCode) + (isReadOnly.hashCode) +
(isVisible == null ? 0 : isVisible!.hashCode) + (isVisible == null ? 0 : isVisible!.hashCode) +
@ -159,7 +165,11 @@ class ImportAssetDto {
} else { } else {
// json[r'isExternal'] = null; // json[r'isExternal'] = null;
} }
if (this.isFavorite != null) {
json[r'isFavorite'] = this.isFavorite; json[r'isFavorite'] = this.isFavorite;
} else {
// json[r'isFavorite'] = null;
}
if (this.isOffline != null) { if (this.isOffline != null) {
json[r'isOffline'] = this.isOffline; json[r'isOffline'] = this.isOffline;
} else { } else {
@ -200,7 +210,7 @@ class ImportAssetDto {
fileModifiedAt: mapDateTime(json, r'fileModifiedAt', '')!, fileModifiedAt: mapDateTime(json, r'fileModifiedAt', '')!,
isArchived: mapValueOfType<bool>(json, r'isArchived'), isArchived: mapValueOfType<bool>(json, r'isArchived'),
isExternal: mapValueOfType<bool>(json, r'isExternal'), isExternal: mapValueOfType<bool>(json, r'isExternal'),
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!, isFavorite: mapValueOfType<bool>(json, r'isFavorite'),
isOffline: mapValueOfType<bool>(json, r'isOffline'), isOffline: mapValueOfType<bool>(json, r'isOffline'),
isReadOnly: mapValueOfType<bool>(json, r'isReadOnly') ?? true, isReadOnly: mapValueOfType<bool>(json, r'isReadOnly') ?? true,
isVisible: mapValueOfType<bool>(json, r'isVisible'), isVisible: mapValueOfType<bool>(json, r'isVisible'),
@ -258,7 +268,6 @@ class ImportAssetDto {
'deviceId', 'deviceId',
'fileCreatedAt', 'fileCreatedAt',
'fileModifiedAt', 'fileModifiedAt',
'isFavorite',
}; };
} }

View file

@ -172,7 +172,7 @@ void main() {
// TODO // TODO
}); });
//Future<AssetFileUploadResponseDto> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, bool isFavorite, { String key, String duration, bool isArchived, bool isExternal, bool isOffline, bool isReadOnly, bool isVisible, String libraryId, MultipartFile livePhotoData, MultipartFile sidecarData }) async //Future<AssetFileUploadResponseDto> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String key, String duration, bool isArchived, bool isExternal, bool isFavorite, bool isOffline, bool isReadOnly, bool isVisible, String libraryId, MultipartFile livePhotoData, MultipartFile sidecarData }) async
test('test uploadFile', () async { test('test uploadFile', () async {
// TODO // TODO
}); });

View file

@ -6655,8 +6655,7 @@
"deviceAssetId", "deviceAssetId",
"deviceId", "deviceId",
"fileCreatedAt", "fileCreatedAt",
"fileModifiedAt", "fileModifiedAt"
"isFavorite"
], ],
"type": "object" "type": "object"
}, },
@ -7143,8 +7142,7 @@
"deviceAssetId", "deviceAssetId",
"deviceId", "deviceId",
"fileCreatedAt", "fileCreatedAt",
"fileModifiedAt", "fileModifiedAt"
"isFavorite"
], ],
"type": "object" "type": "object"
}, },

View file

@ -22,9 +22,10 @@ export class CreateAssetBase {
@Type(() => Date) @Type(() => Date)
fileModifiedAt!: Date; fileModifiedAt!: Date;
@Optional()
@IsBoolean() @IsBoolean()
@Transform(toBoolean) @Transform(toBoolean)
isFavorite!: boolean; isFavorite?: boolean;
@Optional() @Optional()
@IsBoolean() @IsBoolean()

View file

@ -146,7 +146,6 @@ describe(`${AssetController.name} (e2e)`, () => {
{ should: 'require `deviceId`', dto: { ...makeUploadDto({ omit: 'deviceId' }) } }, { should: 'require `deviceId`', dto: { ...makeUploadDto({ omit: 'deviceId' }) } },
{ should: 'require `fileCreatedAt`', dto: { ...makeUploadDto({ omit: 'fileCreatedAt' }) } }, { should: 'require `fileCreatedAt`', dto: { ...makeUploadDto({ omit: 'fileCreatedAt' }) } },
{ should: 'require `fileModifiedAt`', dto: { ...makeUploadDto({ omit: 'fileModifiedAt' }) } }, { should: 'require `fileModifiedAt`', dto: { ...makeUploadDto({ omit: 'fileModifiedAt' }) } },
{ should: 'require `isFavorite`', dto: { ...makeUploadDto({ omit: 'isFavorite' }) } },
{ should: 'require `duration`', dto: { ...makeUploadDto({ omit: 'duration' }) } }, { should: 'require `duration`', dto: { ...makeUploadDto({ omit: 'duration' }) } },
{ should: 'throw if `isFavorite` is not a boolean', dto: { ...makeUploadDto(), isFavorite: 'not-a-boolean' } }, { should: 'throw if `isFavorite` is not a boolean', dto: { ...makeUploadDto(), isFavorite: 'not-a-boolean' } },
{ should: 'throw if `isVisible` is not a boolean', dto: { ...makeUploadDto(), isVisible: 'not-a-boolean' } }, { should: 'throw if `isVisible` is not a boolean', dto: { ...makeUploadDto(), isVisible: 'not-a-boolean' } },

View file

@ -1855,7 +1855,7 @@ export interface ImportAssetDto {
* @type {boolean} * @type {boolean}
* @memberof ImportAssetDto * @memberof ImportAssetDto
*/ */
'isFavorite': boolean; 'isFavorite'?: boolean;
/** /**
* *
* @type {boolean} * @type {boolean}
@ -7868,11 +7868,11 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
* @param {string} deviceId * @param {string} deviceId
* @param {string} fileCreatedAt * @param {string} fileCreatedAt
* @param {string} fileModifiedAt * @param {string} fileModifiedAt
* @param {boolean} isFavorite
* @param {string} [key] * @param {string} [key]
* @param {string} [duration] * @param {string} [duration]
* @param {boolean} [isArchived] * @param {boolean} [isArchived]
* @param {boolean} [isExternal] * @param {boolean} [isExternal]
* @param {boolean} [isFavorite]
* @param {boolean} [isOffline] * @param {boolean} [isOffline]
* @param {boolean} [isReadOnly] * @param {boolean} [isReadOnly]
* @param {boolean} [isVisible] * @param {boolean} [isVisible]
@ -7882,7 +7882,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'assetData' is not null or undefined // verify required parameter 'assetData' is not null or undefined
assertParamExists('uploadFile', 'assetData', assetData) assertParamExists('uploadFile', 'assetData', assetData)
// verify required parameter 'deviceAssetId' is not null or undefined // verify required parameter 'deviceAssetId' is not null or undefined
@ -7893,8 +7893,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration
assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt) assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt)
// verify required parameter 'fileModifiedAt' is not null or undefined // verify required parameter 'fileModifiedAt' is not null or undefined
assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt) assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt)
// verify required parameter 'isFavorite' is not null or undefined
assertParamExists('uploadFile', 'isFavorite', isFavorite)
const localVarPath = `/asset/upload`; const localVarPath = `/asset/upload`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@ -8335,11 +8333,11 @@ export const AssetApiFp = function(configuration?: Configuration) {
* @param {string} deviceId * @param {string} deviceId
* @param {string} fileCreatedAt * @param {string} fileCreatedAt
* @param {string} fileModifiedAt * @param {string} fileModifiedAt
* @param {boolean} isFavorite
* @param {string} [key] * @param {string} [key]
* @param {string} [duration] * @param {string} [duration]
* @param {boolean} [isArchived] * @param {boolean} [isArchived]
* @param {boolean} [isExternal] * @param {boolean} [isExternal]
* @param {boolean} [isFavorite]
* @param {boolean} [isOffline] * @param {boolean} [isOffline]
* @param {boolean} [isReadOnly] * @param {boolean} [isReadOnly]
* @param {boolean} [isVisible] * @param {boolean} [isVisible]
@ -8349,8 +8347,8 @@ export const AssetApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssetFileUploadResponseDto>> { async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssetFileUploadResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
}, },
} }
@ -8626,7 +8624,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError} * @throws {RequiredError}
*/ */
uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise<AssetFileUploadResponseDto> { uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise<AssetFileUploadResponseDto> {
return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath));
}, },
}; };
}; };
@ -9274,13 +9272,6 @@ export interface AssetApiUploadFileRequest {
*/ */
readonly fileModifiedAt: string readonly fileModifiedAt: string
/**
*
* @type {boolean}
* @memberof AssetApiUploadFile
*/
readonly isFavorite: boolean
/** /**
* *
* @type {string} * @type {string}
@ -9309,6 +9300,13 @@ export interface AssetApiUploadFileRequest {
*/ */
readonly isExternal?: boolean readonly isExternal?: boolean
/**
*
* @type {boolean}
* @memberof AssetApiUploadFile
*/
readonly isFavorite?: boolean
/** /**
* *
* @type {boolean} * @type {boolean}
@ -9681,7 +9679,7 @@ export class AssetApi extends BaseAPI {
* @memberof AssetApi * @memberof AssetApi
*/ */
public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) { public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) {
return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath));
} }
} }