chore: open api
This commit is contained in:
parent
b7b3735c40
commit
947132ac77
9 changed files with 37 additions and 55 deletions
14
cli/src/api/open-api/api.ts
generated
14
cli/src/api/open-api/api.ts
generated
|
@ -1900,8 +1900,8 @@ export const RuleKey = {
|
|||
City: 'city',
|
||||
State: 'state',
|
||||
Country: 'country',
|
||||
Make: 'make',
|
||||
Model: 'model',
|
||||
CameraMake: 'camera-make',
|
||||
CameraModel: 'camera-model',
|
||||
Location: 'location'
|
||||
} as const;
|
||||
|
||||
|
@ -1934,10 +1934,10 @@ export interface RuleResponseDto {
|
|||
'ownerId': string;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @type {string}
|
||||
* @memberof RuleResponseDto
|
||||
*/
|
||||
'value': object;
|
||||
'value': string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3074,13 +3074,13 @@ export interface UpdateRuleDto {
|
|||
* @type {RuleKey}
|
||||
* @memberof UpdateRuleDto
|
||||
*/
|
||||
'key'?: RuleKey;
|
||||
'key': RuleKey;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @type {string}
|
||||
* @memberof UpdateRuleDto
|
||||
*/
|
||||
'value'?: object;
|
||||
'value': string;
|
||||
}
|
||||
|
||||
|
||||
|
|
2
mobile/openapi/doc/RuleResponseDto.md
generated
2
mobile/openapi/doc/RuleResponseDto.md
generated
|
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
|||
**id** | **String** | |
|
||||
**key** | [**RuleKey**](RuleKey.md) | |
|
||||
**ownerId** | **String** | |
|
||||
**value** | [**Object**](.md) | |
|
||||
**value** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
|
4
mobile/openapi/doc/UpdateRuleDto.md
generated
4
mobile/openapi/doc/UpdateRuleDto.md
generated
|
@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
|
|||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**key** | [**RuleKey**](RuleKey.md) | | [optional]
|
||||
**value** | [**Object**](.md) | | [optional]
|
||||
**key** | [**RuleKey**](RuleKey.md) | |
|
||||
**value** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
|
12
mobile/openapi/lib/model/rule_key.dart
generated
12
mobile/openapi/lib/model/rule_key.dart
generated
|
@ -28,8 +28,8 @@ class RuleKey {
|
|||
static const city = RuleKey._(r'city');
|
||||
static const state = RuleKey._(r'state');
|
||||
static const country = RuleKey._(r'country');
|
||||
static const make = RuleKey._(r'make');
|
||||
static const model = RuleKey._(r'model');
|
||||
static const cameraMake = RuleKey._(r'camera-make');
|
||||
static const cameraModel = RuleKey._(r'camera-model');
|
||||
static const location = RuleKey._(r'location');
|
||||
|
||||
/// List of all possible values in this [enum][RuleKey].
|
||||
|
@ -39,8 +39,8 @@ class RuleKey {
|
|||
city,
|
||||
state,
|
||||
country,
|
||||
make,
|
||||
model,
|
||||
cameraMake,
|
||||
cameraModel,
|
||||
location,
|
||||
];
|
||||
|
||||
|
@ -85,8 +85,8 @@ class RuleKeyTypeTransformer {
|
|||
case r'city': return RuleKey.city;
|
||||
case r'state': return RuleKey.state;
|
||||
case r'country': return RuleKey.country;
|
||||
case r'make': return RuleKey.make;
|
||||
case r'model': return RuleKey.model;
|
||||
case r'camera-make': return RuleKey.cameraMake;
|
||||
case r'camera-model': return RuleKey.cameraModel;
|
||||
case r'location': return RuleKey.location;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
|
|
4
mobile/openapi/lib/model/rule_response_dto.dart
generated
4
mobile/openapi/lib/model/rule_response_dto.dart
generated
|
@ -25,7 +25,7 @@ class RuleResponseDto {
|
|||
|
||||
String ownerId;
|
||||
|
||||
Object value;
|
||||
String value;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RuleResponseDto &&
|
||||
|
@ -65,7 +65,7 @@ class RuleResponseDto {
|
|||
id: mapValueOfType<String>(json, r'id')!,
|
||||
key: RuleKey.fromJson(json[r'key'])!,
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
value: mapValueOfType<Object>(json, r'value')!,
|
||||
value: mapValueOfType<String>(json, r'value')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
38
mobile/openapi/lib/model/update_rule_dto.dart
generated
38
mobile/openapi/lib/model/update_rule_dto.dart
generated
|
@ -13,25 +13,13 @@ part of openapi.api;
|
|||
class UpdateRuleDto {
|
||||
/// Returns a new [UpdateRuleDto] instance.
|
||||
UpdateRuleDto({
|
||||
this.key,
|
||||
this.value,
|
||||
required this.key,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
RuleKey? key;
|
||||
RuleKey key;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
Object? value;
|
||||
String value;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateRuleDto &&
|
||||
|
@ -41,24 +29,16 @@ class UpdateRuleDto {
|
|||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(key == null ? 0 : key!.hashCode) +
|
||||
(value == null ? 0 : value!.hashCode);
|
||||
(key.hashCode) +
|
||||
(value.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateRuleDto[key=$key, value=$value]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.key != null) {
|
||||
json[r'key'] = this.key;
|
||||
} else {
|
||||
// json[r'key'] = null;
|
||||
}
|
||||
if (this.value != null) {
|
||||
json[r'value'] = this.value;
|
||||
} else {
|
||||
// json[r'value'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
@ -70,8 +50,8 @@ class UpdateRuleDto {
|
|||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return UpdateRuleDto(
|
||||
key: RuleKey.fromJson(json[r'key']),
|
||||
value: mapValueOfType<Object>(json, r'value'),
|
||||
key: RuleKey.fromJson(json[r'key'])!,
|
||||
value: mapValueOfType<String>(json, r'value')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
@ -119,6 +99,8 @@ class UpdateRuleDto {
|
|||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'key',
|
||||
'value',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
2
mobile/openapi/test/rule_response_dto_test.dart
generated
2
mobile/openapi/test/rule_response_dto_test.dart
generated
|
@ -31,7 +31,7 @@ void main() {
|
|||
// TODO
|
||||
});
|
||||
|
||||
// Object value
|
||||
// String value
|
||||
test('to test the property `value`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
|
2
mobile/openapi/test/update_rule_dto_test.dart
generated
2
mobile/openapi/test/update_rule_dto_test.dart
generated
|
@ -21,7 +21,7 @@ void main() {
|
|||
// TODO
|
||||
});
|
||||
|
||||
// Object value
|
||||
// String value
|
||||
test('to test the property `value`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
|
14
web/src/api/open-api/api.ts
generated
14
web/src/api/open-api/api.ts
generated
|
@ -1900,8 +1900,8 @@ export const RuleKey = {
|
|||
City: 'city',
|
||||
State: 'state',
|
||||
Country: 'country',
|
||||
Make: 'make',
|
||||
Model: 'model',
|
||||
CameraMake: 'camera-make',
|
||||
CameraModel: 'camera-model',
|
||||
Location: 'location'
|
||||
} as const;
|
||||
|
||||
|
@ -1934,10 +1934,10 @@ export interface RuleResponseDto {
|
|||
'ownerId': string;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @type {string}
|
||||
* @memberof RuleResponseDto
|
||||
*/
|
||||
'value': object;
|
||||
'value': string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3074,13 +3074,13 @@ export interface UpdateRuleDto {
|
|||
* @type {RuleKey}
|
||||
* @memberof UpdateRuleDto
|
||||
*/
|
||||
'key'?: RuleKey;
|
||||
'key': RuleKey;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @type {string}
|
||||
* @memberof UpdateRuleDto
|
||||
*/
|
||||
'value'?: object;
|
||||
'value': string;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue