timeOfRequest -> requestedAt

This commit is contained in:
Fynn Petersen-Frey 2023-11-29 19:46:21 +01:00
parent 061c567468
commit e033e9aad2
9 changed files with 20 additions and 20 deletions

View file

@ -964,7 +964,7 @@ export interface AuditDeletesResponseDto {
* @type {string}
* @memberof AuditDeletesResponseDto
*/
'timeOfRequest'?: string;
'requestedAt'?: string;
}
/**
*

View file

@ -54,15 +54,15 @@ class AssetService {
final deleted = await _apiService.auditApi
.getAuditDeletes(EntityType.ASSET, since, userId: user.id);
if (deleted == null || deleted.needsFullSync) {
return (null, null, deleted?.timeOfRequest);
return (null, null, deleted?.requestedAt);
}
final assetDto = await _apiService.assetApi
.getAllAssets(userId: user.id, updatedAfter: since);
if (assetDto == null) return (null, null, deleted.timeOfRequest);
if (assetDto == null) return (null, null, deleted.requestedAt);
return (
assetDto.map(Asset.remote).toList(),
deleted.ids,
deleted.timeOfRequest
deleted.requestedAt
);
}

View file

@ -10,7 +10,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ids** | **List<String>** | | [default to const []]
**needsFullSync** | **bool** | |
**timeOfRequest** | [**DateTime**](DateTime.md) | | [optional]
**requestedAt** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -15,7 +15,7 @@ class AuditDeletesResponseDto {
AuditDeletesResponseDto({
this.ids = const [],
required this.needsFullSync,
this.timeOfRequest,
this.requestedAt,
});
List<String> ids;
@ -28,32 +28,32 @@ class AuditDeletesResponseDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? timeOfRequest;
DateTime? requestedAt;
@override
bool operator ==(Object other) => identical(this, other) || other is AuditDeletesResponseDto &&
other.ids == ids &&
other.needsFullSync == needsFullSync &&
other.timeOfRequest == timeOfRequest;
other.requestedAt == requestedAt;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(ids.hashCode) +
(needsFullSync.hashCode) +
(timeOfRequest == null ? 0 : timeOfRequest!.hashCode);
(requestedAt == null ? 0 : requestedAt!.hashCode);
@override
String toString() => 'AuditDeletesResponseDto[ids=$ids, needsFullSync=$needsFullSync, timeOfRequest=$timeOfRequest]';
String toString() => 'AuditDeletesResponseDto[ids=$ids, needsFullSync=$needsFullSync, requestedAt=$requestedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'ids'] = this.ids;
json[r'needsFullSync'] = this.needsFullSync;
if (this.timeOfRequest != null) {
json[r'timeOfRequest'] = this.timeOfRequest!.toUtc().toIso8601String();
if (this.requestedAt != null) {
json[r'requestedAt'] = this.requestedAt!.toUtc().toIso8601String();
} else {
// json[r'timeOfRequest'] = null;
// json[r'requestedAt'] = null;
}
return json;
}
@ -70,7 +70,7 @@ class AuditDeletesResponseDto {
? (json[r'ids'] as List).cast<String>()
: const [],
needsFullSync: mapValueOfType<bool>(json, r'needsFullSync')!,
timeOfRequest: mapDateTime(json, r'timeOfRequest', ''),
requestedAt: mapDateTime(json, r'requestedAt', ''),
);
}
return null;

View file

@ -26,8 +26,8 @@ void main() {
// TODO
});
// DateTime timeOfRequest
test('to test the property `timeOfRequest`', () async {
// DateTime requestedAt
test('to test the property `requestedAt`', () async {
// TODO
});

View file

@ -6827,7 +6827,7 @@
"needsFullSync": {
"type": "boolean"
},
"timeOfRequest": {
"requestedAt": {
"format": "date-time",
"type": "string"
}

View file

@ -30,7 +30,7 @@ export enum PathEntityType {
export class AuditDeletesResponseDto {
needsFullSync!: boolean;
ids!: string[];
timeOfRequest?: Date;
requestedAt?: Date;
}
export class FileReportDto {

View file

@ -61,7 +61,7 @@ export class AuditService {
});
return {
timeOfRequest: now.toJSDate(),
requestedAt: now.toJSDate(),
needsFullSync: duration > AUDIT_LOG_MAX_DURATION,
ids: audits.map(({ entityId }) => entityId),
};

View file

@ -964,7 +964,7 @@ export interface AuditDeletesResponseDto {
* @type {string}
* @memberof AuditDeletesResponseDto
*/
'timeOfRequest'?: string;
'requestedAt'?: string;
}
/**
*