1
+ import 'dart:ui' ;
2
+
1
3
import 'package:json_annotation/json_annotation.dart' ;
4
+
5
+ import 'metadata.dart' ;
2
6
import 'video_assets.dart' ;
3
7
import 'video_source.dart' ;
4
- import 'metadata.dart' ;
5
8
6
9
part 'video.g.dart' ;
7
10
11
+ /// The origin of the last update on the video's `language` attribute.
12
+ enum LanguageOrigin {
13
+ /// The language was set by the API.
14
+ @JsonValue ("api" )
15
+ api,
16
+
17
+ /// The language was done automatically by the API.
18
+ @JsonValue ("auto" )
19
+ auto
20
+ }
21
+
22
+ /// Json converter for [Locale] objects.
23
+ class _JsonLocaleConverter extends JsonConverter <Locale , String > {
24
+ const _JsonLocaleConverter ();
25
+
26
+ @override
27
+ Locale fromJson (String json) {
28
+ return Locale (json);
29
+ }
30
+
31
+ @override
32
+ String toJson (Locale object) {
33
+ return object.toLanguageTag ();
34
+ }
35
+ }
36
+
8
37
/// A video from api.video
9
38
@JsonSerializable ()
10
39
class Video {
@@ -26,6 +55,22 @@ class Video {
26
55
/// The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
27
56
final DateTime ? updatedAt;
28
57
58
+ /// The date and time the video was discarded.
59
+ final DateTime ? discardedAt;
60
+
61
+ /// The date and time the video will be permanently deleted.
62
+ final DateTime ? deletedAt;
63
+
64
+ /// Returns `true` for videos you discarded.
65
+ final bool ? discarded;
66
+
67
+ /// Returns the language of a video in [IETF language tag] (https://en.wikipedia.org/wiki/IETF_language_tag) format.
68
+ @_JsonLocaleConverter ()
69
+ final Locale ? language;
70
+
71
+ /// Returns the origin of the last update on the video's `language` attribute.
72
+ final LanguageOrigin ? languageOrigin;
73
+
29
74
/// One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
30
75
final List <String >? tags;
31
76
@@ -52,12 +97,17 @@ class Video {
52
97
final bool ? mp4Support;
53
98
54
99
/// Creates a [Video] .
55
- Video (this .videoId,
100
+ const Video (this .videoId,
56
101
{this .createdAt,
57
102
this .title,
58
103
this .description,
59
104
this .publishedAt,
60
105
this .updatedAt,
106
+ this .discardedAt,
107
+ this .deletedAt,
108
+ this .discarded,
109
+ this .language,
110
+ this .languageOrigin,
61
111
this .tags,
62
112
this .metadata,
63
113
this .source,
0 commit comments