SimpleCloudNotifier/flutter/lib/models/subscription.dart

32 lines
1016 B
Dart
Raw Normal View History

2024-02-18 17:36:58 +01:00
class Subscription {
final String subscriptionID;
final String subscriberUserID;
final String channelOwnerUserID;
final String channelID;
final String channelInternalName;
final String timestampCreated;
final bool confirmed;
const Subscription({
required this.subscriptionID,
required this.subscriberUserID,
required this.channelOwnerUserID,
required this.channelID,
required this.channelInternalName,
required this.timestampCreated,
required this.confirmed,
});
factory Subscription.fromJson(Map<String, dynamic> json) {
2024-05-25 18:09:39 +02:00
return Subscription(
2024-05-25 21:36:05 +02:00
subscriptionID: json['subscription_id'] as String,
subscriberUserID: json['subscriber_user_id'] as String,
channelOwnerUserID: json['channel_owner_user_id'] as String,
channelID: json['channel_id'] as String,
channelInternalName: json['channel_internal_name'] as String,
timestampCreated: json['timestamp_created'] as String,
confirmed: json['confirmed'] as bool,
2024-05-25 18:09:39 +02:00
);
2024-02-18 17:36:58 +01:00
}
}