Added explicit type for job count
This commit is contained in:
parent
46994c3355
commit
471a60dcb0
4 changed files with 21 additions and 26 deletions
|
@ -8,11 +8,11 @@ import 'package:openapi/api.dart';
|
|||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**active** | **num** | |
|
||||
**completed** | **num** | |
|
||||
**failed** | **num** | |
|
||||
**delayed** | **num** | |
|
||||
**waiting** | **num** | |
|
||||
**active** | **int** | |
|
||||
**completed** | **int** | |
|
||||
**failed** | **int** | |
|
||||
**delayed** | **int** | |
|
||||
**waiting** | **int** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
|
|
@ -20,15 +20,15 @@ class JobCounts {
|
|||
required this.waiting,
|
||||
});
|
||||
|
||||
num active;
|
||||
int active;
|
||||
|
||||
num completed;
|
||||
int completed;
|
||||
|
||||
num failed;
|
||||
int failed;
|
||||
|
||||
num delayed;
|
||||
int delayed;
|
||||
|
||||
num waiting;
|
||||
int waiting;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobCounts &&
|
||||
|
@ -79,21 +79,11 @@ class JobCounts {
|
|||
}());
|
||||
|
||||
return JobCounts(
|
||||
active: json[r'active'] == null
|
||||
? null
|
||||
: num.parse(json[r'active'].toString()),
|
||||
completed: json[r'completed'] == null
|
||||
? null
|
||||
: num.parse(json[r'completed'].toString()),
|
||||
failed: json[r'failed'] == null
|
||||
? null
|
||||
: num.parse(json[r'failed'].toString()),
|
||||
delayed: json[r'delayed'] == null
|
||||
? null
|
||||
: num.parse(json[r'delayed'].toString()),
|
||||
waiting: json[r'waiting'] == null
|
||||
? null
|
||||
: num.parse(json[r'waiting'].toString()),
|
||||
active: mapValueOfType<int>(json, r'active')!,
|
||||
completed: mapValueOfType<int>(json, r'completed')!,
|
||||
failed: mapValueOfType<int>(json, r'failed')!,
|
||||
delayed: mapValueOfType<int>(json, r'delayed')!,
|
||||
waiting: mapValueOfType<int>(json, r'waiting')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class JobCounts {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
active!: number;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
completed!: number;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
failed!: number;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
delayed!: number;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
waiting!: number;
|
||||
}
|
||||
export class AllJobStatusResponseDto {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue