manager-app/manager_api_new/lib/model/schedule_notification_request.dart

76 lines
2.0 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 ScheduleNotificationRequest {
ScheduleNotificationRequest({
this.title,
this.body,
this.scheduledAt,
});
String? title;
String? body;
DateTime? scheduledAt;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ScheduleNotificationRequest &&
other.title == title &&
other.body == body &&
other.scheduledAt == scheduledAt;
@override
int get hashCode =>
(title == null ? 0 : title!.hashCode) +
(body == null ? 0 : body!.hashCode) +
(scheduledAt == null ? 0 : scheduledAt!.hashCode);
@override
String toString() => 'ScheduleNotificationRequest[title=$title, body=$body, scheduledAt=$scheduledAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'title'] = title;
json[r'body'] = body;
if (scheduledAt != null) {
json[r'scheduledAt'] = scheduledAt!.toUtc().toIso8601String();
}
return json;
}
static ScheduleNotificationRequest? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return ScheduleNotificationRequest(
title: mapValueOfType<String>(json, r'title'),
body: mapValueOfType<String>(json, r'body'),
scheduledAt: mapDateTime(json, r'scheduledAt', r''),
);
}
return null;
}
static List<ScheduleNotificationRequest> listFromJson(dynamic json, {bool growable = false}) {
final result = <ScheduleNotificationRequest>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ScheduleNotificationRequest.fromJson(row);
if (value != null) result.add(value);
}
}
return result.toList(growable: growable);
}
static const requiredKeys = <String>{};
}