156 lines
4.5 KiB
Dart
156 lines
4.5 KiB
Dart
//
|
|
// 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 SubscriptionPlanDTO {
|
|
/// Returns a new [SubscriptionPlanDTO] instance.
|
|
SubscriptionPlanDTO({
|
|
this.id,
|
|
required this.name,
|
|
this.storageQuotaBytes,
|
|
this.aiRequestsPerMonth,
|
|
this.statsHistoryDays,
|
|
this.hasAdvancedStats,
|
|
});
|
|
|
|
String? id;
|
|
|
|
String name;
|
|
|
|
int? storageQuotaBytes;
|
|
|
|
int? aiRequestsPerMonth;
|
|
|
|
int? statsHistoryDays;
|
|
|
|
bool? hasAdvancedStats;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is SubscriptionPlanDTO &&
|
|
other.id == id &&
|
|
other.name == name &&
|
|
other.storageQuotaBytes == storageQuotaBytes &&
|
|
other.aiRequestsPerMonth == aiRequestsPerMonth &&
|
|
other.statsHistoryDays == statsHistoryDays &&
|
|
other.hasAdvancedStats == hasAdvancedStats;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(id == null ? 0 : id!.hashCode) +
|
|
(name.hashCode) +
|
|
(storageQuotaBytes == null ? 0 : storageQuotaBytes!.hashCode) +
|
|
(aiRequestsPerMonth == null ? 0 : aiRequestsPerMonth!.hashCode) +
|
|
(statsHistoryDays == null ? 0 : statsHistoryDays!.hashCode) +
|
|
(hasAdvancedStats == null ? 0 : hasAdvancedStats!.hashCode);
|
|
|
|
@override
|
|
String toString() =>
|
|
'SubscriptionPlanDTO[id=$id, name=$name, storageQuotaBytes=$storageQuotaBytes, aiRequestsPerMonth=$aiRequestsPerMonth, statsHistoryDays=$statsHistoryDays, hasAdvancedStats=$hasAdvancedStats]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.id != null) {
|
|
json[r'id'] = this.id;
|
|
} else {
|
|
json[r'id'] = null;
|
|
}
|
|
json[r'name'] = this.name;
|
|
if (this.storageQuotaBytes != null) {
|
|
json[r'storageQuotaBytes'] = this.storageQuotaBytes;
|
|
} else {
|
|
json[r'storageQuotaBytes'] = null;
|
|
}
|
|
if (this.aiRequestsPerMonth != null) {
|
|
json[r'aiRequestsPerMonth'] = this.aiRequestsPerMonth;
|
|
} else {
|
|
json[r'aiRequestsPerMonth'] = null;
|
|
}
|
|
if (this.statsHistoryDays != null) {
|
|
json[r'statsHistoryDays'] = this.statsHistoryDays;
|
|
} else {
|
|
json[r'statsHistoryDays'] = null;
|
|
}
|
|
if (this.hasAdvancedStats != null) {
|
|
json[r'hasAdvancedStats'] = this.hasAdvancedStats;
|
|
} else {
|
|
json[r'hasAdvancedStats'] = null;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static SubscriptionPlanDTO? fromJson(dynamic value) {
|
|
if (value is Map) {
|
|
final json = value.cast<String, dynamic>();
|
|
return SubscriptionPlanDTO(
|
|
id: mapValueOfType<String>(json, r'id'),
|
|
name: mapValueOfType<String>(json, r'name') ?? '',
|
|
storageQuotaBytes: mapValueOfType<int>(json, r'storageQuotaBytes'),
|
|
aiRequestsPerMonth: mapValueOfType<int>(json, r'aiRequestsPerMonth'),
|
|
statsHistoryDays: mapValueOfType<int>(json, r'statsHistoryDays'),
|
|
hasAdvancedStats: mapValueOfType<bool>(json, r'hasAdvancedStats'),
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<SubscriptionPlanDTO> listFromJson(
|
|
dynamic json, {
|
|
bool growable = false,
|
|
}) {
|
|
final result = <SubscriptionPlanDTO>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = SubscriptionPlanDTO.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, SubscriptionPlanDTO> mapFromJson(dynamic json) {
|
|
final map = <String, SubscriptionPlanDTO>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
final value = SubscriptionPlanDTO.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
static Map<String, List<SubscriptionPlanDTO>> mapListFromJson(
|
|
dynamic json, {
|
|
bool growable = false,
|
|
}) {
|
|
final map = <String, List<SubscriptionPlanDTO>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = SubscriptionPlanDTO.listFromJson(
|
|
entry.value,
|
|
growable: growable,
|
|
);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
static const requiredKeys = <String>{'name'};
|
|
}
|