Use nulls, make-sql

This commit is contained in:
Min Idzelis
2025-05-03 02:06:34 +00:00
parent 0ed2a2fd2e
commit aea2c9506d
19 changed files with 186 additions and 205 deletions

View File

@@ -479,10 +479,10 @@ Class | Method | HTTP request | Description
- [TestEmailResponseDto](doc//TestEmailResponseDto.md)
- [TimeBucketAssetResponseDto](doc//TimeBucketAssetResponseDto.md)
- [TimeBucketAssetResponseDtoDurationInner](doc//TimeBucketAssetResponseDtoDurationInner.md)
- [TimeBucketAssetResponseDtoStackInner](doc//TimeBucketAssetResponseDtoStackInner.md)
- [TimeBucketResponseDto](doc//TimeBucketResponseDto.md)
- [TimeBucketsResponseDto](doc//TimeBucketsResponseDto.md)
- [TimelineAssetDescriptionDto](doc//TimelineAssetDescriptionDto.md)
- [TimelineStackResponseDto](doc//TimelineStackResponseDto.md)
- [ToneMapping](doc//ToneMapping.md)
- [TranscodeHWAccel](doc//TranscodeHWAccel.md)
- [TranscodePolicy](doc//TranscodePolicy.md)

View File

@@ -283,10 +283,10 @@ part 'model/template_response_dto.dart';
part 'model/test_email_response_dto.dart';
part 'model/time_bucket_asset_response_dto.dart';
part 'model/time_bucket_asset_response_dto_duration_inner.dart';
part 'model/time_bucket_asset_response_dto_stack_inner.dart';
part 'model/time_bucket_response_dto.dart';
part 'model/time_buckets_response_dto.dart';
part 'model/timeline_asset_description_dto.dart';
part 'model/timeline_stack_response_dto.dart';
part 'model/tone_mapping.dart';
part 'model/transcode_hw_accel.dart';
part 'model/transcode_policy.dart';

View File

@@ -622,14 +622,14 @@ class ApiClient {
return TimeBucketAssetResponseDto.fromJson(value);
case 'TimeBucketAssetResponseDtoDurationInner':
return TimeBucketAssetResponseDtoDurationInner.fromJson(value);
case 'TimeBucketAssetResponseDtoStackInner':
return TimeBucketAssetResponseDtoStackInner.fromJson(value);
case 'TimeBucketResponseDto':
return TimeBucketResponseDto.fromJson(value);
case 'TimeBucketsResponseDto':
return TimeBucketsResponseDto.fromJson(value);
case 'TimelineAssetDescriptionDto':
return TimelineAssetDescriptionDto.fromJson(value);
case 'TimelineStackResponseDto':
return TimelineStackResponseDto.fromJson(value);
case 'ToneMapping':
return ToneMappingTypeTransformer().decode(value);
case 'TranscodeHWAccel':

View File

@@ -56,7 +56,7 @@ class TimeBucketAssetResponseDto {
List<num> ratio;
List<TimelineStackResponseDto> stack;
List<TimeBucketAssetResponseDtoStackInner> stack;
List<TimeBucketAssetResponseDtoDurationInner> thumbhash;
@@ -158,7 +158,7 @@ class TimeBucketAssetResponseDto {
ratio: json[r'ratio'] is Iterable
? (json[r'ratio'] as Iterable).cast<num>().toList(growable: false)
: const [],
stack: TimelineStackResponseDto.listFromJson(json[r'stack']),
stack: TimeBucketAssetResponseDtoStackInner.listFromJson(json[r'stack']),
thumbhash: TimeBucketAssetResponseDtoDurationInner.listFromJson(json[r'thumbhash']),
);
}

View File

@@ -0,0 +1,91 @@
//
// 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 TimeBucketAssetResponseDtoStackInner {
/// Returns a new [TimeBucketAssetResponseDtoStackInner] instance.
TimeBucketAssetResponseDtoStackInner({
});
@override
bool operator ==(Object other) => identical(this, other) || other is TimeBucketAssetResponseDtoStackInner &&
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
@override
String toString() => 'TimeBucketAssetResponseDtoStackInner[]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
return json;
}
/// Returns a new [TimeBucketAssetResponseDtoStackInner] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TimeBucketAssetResponseDtoStackInner? fromJson(dynamic value) {
upgradeDto(value, "TimeBucketAssetResponseDtoStackInner");
if (value is Map) {
final json = value.cast<String, dynamic>();
return TimeBucketAssetResponseDtoStackInner(
);
}
return null;
}
static List<TimeBucketAssetResponseDtoStackInner> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TimeBucketAssetResponseDtoStackInner>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TimeBucketAssetResponseDtoStackInner.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TimeBucketAssetResponseDtoStackInner> mapFromJson(dynamic json) {
final map = <String, TimeBucketAssetResponseDtoStackInner>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TimeBucketAssetResponseDtoStackInner.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TimeBucketAssetResponseDtoStackInner-objects as value to a dart map
static Map<String, List<TimeBucketAssetResponseDtoStackInner>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TimeBucketAssetResponseDtoStackInner>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = TimeBucketAssetResponseDtoStackInner.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@@ -1,115 +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 TimelineStackResponseDto {
/// Returns a new [TimelineStackResponseDto] instance.
TimelineStackResponseDto({
required this.assetCount,
required this.id,
required this.primaryAssetId,
});
num assetCount;
String id;
String primaryAssetId;
@override
bool operator ==(Object other) => identical(this, other) || other is TimelineStackResponseDto &&
other.assetCount == assetCount &&
other.id == id &&
other.primaryAssetId == primaryAssetId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetCount.hashCode) +
(id.hashCode) +
(primaryAssetId.hashCode);
@override
String toString() => 'TimelineStackResponseDto[assetCount=$assetCount, id=$id, primaryAssetId=$primaryAssetId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'assetCount'] = this.assetCount;
json[r'id'] = this.id;
json[r'primaryAssetId'] = this.primaryAssetId;
return json;
}
/// Returns a new [TimelineStackResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TimelineStackResponseDto? fromJson(dynamic value) {
upgradeDto(value, "TimelineStackResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return TimelineStackResponseDto(
assetCount: num.parse('${json[r'assetCount']}'),
id: mapValueOfType<String>(json, r'id')!,
primaryAssetId: mapValueOfType<String>(json, r'primaryAssetId')!,
);
}
return null;
}
static List<TimelineStackResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TimelineStackResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TimelineStackResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TimelineStackResponseDto> mapFromJson(dynamic json) {
final map = <String, TimelineStackResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TimelineStackResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TimelineStackResponseDto-objects as value to a dart map
static Map<String, List<TimelineStackResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TimelineStackResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = TimelineStackResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'assetCount',
'id',
'primaryAssetId',
};
}