@@ -26,7 +26,7 @@ class ListArchivesFilter(BaseModel):
26
26
"""
27
27
28
28
offset : Optional [int ] = None
29
- page_size : Optional [int ] = Field (1000 , serialization_alias = 'count' )
29
+ page_size : Optional [int ] = Field (100 , serialization_alias = 'count' )
30
30
session_id : Optional [str ] = None
31
31
32
32
@@ -44,54 +44,81 @@ class ArchiveStream(BaseModel):
44
44
has_video : Optional [bool ] = Field (None , validation_alias = 'hasVideo' )
45
45
46
46
47
+ class Transcription (BaseModel ):
48
+ """Model for transcription options for an archive.
49
+
50
+ Args:
51
+ status (str, Optional): The status of the transcription.
52
+ reason (str, Optional): May give a brief reason for the transcription status.
53
+ """
54
+
55
+ status : Optional [str ] = None
56
+ reason : Optional [str ] = None
57
+
58
+
47
59
class Archive (BaseModel ):
48
60
"""Model for an archive.
49
61
50
62
Args:
63
+ id (str, Optional): The unique archive ID.
64
+ status (ArchiveStatus, Optional): The status of the archive.
65
+ name (str, Optional): The name of the archive.
66
+ reason (str, Optional): May give a brief reason for the archive status.
67
+ session_id (str, Optional): The session ID of the Vonage Video session.
68
+ application_id (str, Optional): The Vonage application ID.
51
69
created_at (int, Optional): The timestamp when the archive when the archive
52
70
started recording, expressed in milliseconds since the Unix epoch.
71
+ size (int, Optional): The size of the archive.
53
72
duration (int, Optional): The duration of the archive in seconds.
54
73
For archives that have are being recorded, this value is set to 0.
74
+ output_mode (OutputMode, Optional): The output mode of the archive.
75
+ stream_mode (StreamMode, Optional): Whether streams included in the archive
76
+ are selected automatically (`auto`, the default) or manually (`manual`).
55
77
has_audio (bool, Optional): Whether the archive will record audio.
56
78
has_video (bool, Optional): Whether the archive will record video.
57
- id (str, Optional): The unique archive ID.
79
+ has_transcription (bool, Optional): Whether audio will be transcribed.
80
+ sha256_sum (str, Optional): The SHA-256 hash of the archive.
81
+ password (str, Optional): The password for the archive.
82
+ updated_at (int, Optional): The timestamp when the archive was last updated,
83
+ expressed in milliseconds since the Unix epoch.
58
84
multi_archive_tag (str, Optional): Set this to support recording multiple
59
85
archives for the same session simultaneously. Set this to a unique string
60
86
for each simultaneous archive of an ongoing session.
61
- name (str, Optional): The name of the archive.
62
- application_id (str, Optional): The Vonage application ID.
63
- reason (str, Optional): This is set when the `status` is `stopped` or `failed`.
87
+ event (str, Optional): The event that triggered the response.
64
88
resolution (VideoResolution, Optional): The resolution of the archive.
65
- session_id (str, Optional): The session ID of the Vonage Video session.
66
- size (int, Optional): The size of the archive.
67
- status (ArchiveStatus, Optional): The status of the archive.
68
- stream_mode (StreamMode, Optional): Whether streams included in the archive
69
- are selected automatically (`auto`, the default) or manually (`manual`).
70
89
streams (List[ArchiveStream], Optional): The streams in the archive.
71
90
url (str, Optional): The download URL of the available archive file.
72
91
This is only set for an archive with the status set to `available`.
92
+ transcription (Transcription, Optional): Transcription options for the archive.
73
93
"""
74
94
75
- created_at : Optional [int ] = Field (None , validation_alias = 'createdAt' )
76
- duration : Optional [int ] = None
77
- has_audio : Optional [bool ] = Field (None , validation_alias = 'hasAudio' )
78
- has_video : Optional [bool ] = Field (None , validation_alias = 'hasVideo' )
79
95
id : Optional [str ] = None
80
- multi_archive_tag : Optional [str ] = Field ( None , validation_alias = 'multiArchiveTag' )
96
+ status : Optional [ArchiveStatus ] = None
81
97
name : Optional [str ] = None
82
- application_id : Optional [str ] = Field (None , validation_alias = 'applicationId' )
83
98
reason : Optional [str ] = None
84
- resolution : Optional [VideoResolution ] = None
85
99
session_id : Optional [str ] = Field (None , validation_alias = 'sessionId' )
100
+ application_id : Optional [str ] = Field (None , validation_alias = 'applicationId' )
101
+ created_at : Optional [int ] = Field (None , validation_alias = 'createdAt' )
86
102
size : Optional [int ] = None
87
- status : Optional [ArchiveStatus ] = None
103
+ duration : Optional [int ] = None
104
+ output_mode : Optional [OutputMode ] = Field (None , validation_alias = 'outputMode' )
88
105
stream_mode : Optional [StreamMode ] = Field (None , validation_alias = 'streamMode' )
106
+ has_audio : Optional [bool ] = Field (None , validation_alias = 'hasAudio' )
107
+ has_video : Optional [bool ] = Field (None , validation_alias = 'hasVideo' )
108
+ has_transcription : Optional [bool ] = Field (None , validation_alias = 'hasTranscription' )
109
+ sha256_sum : Optional [str ] = Field (None , validation_alias = 'sha256sum' )
110
+ password : Optional [str ] = None
111
+ updated_at : Optional [int ] = Field (None , validation_alias = 'updatedAt' )
112
+ multi_archive_tag : Optional [str ] = Field (None , validation_alias = 'multiArchiveTag' )
113
+ event : Optional [str ] = None
114
+ resolution : Optional [VideoResolution ] = None
89
115
streams : Optional [List [ArchiveStream ]] = None
90
116
url : Optional [str ] = None
117
+ transcription : Optional [Transcription ] = None
91
118
92
119
93
- class Layout (BaseModel ):
94
- """Model for layout options for an archive.
120
+ class ComposedLayout (BaseModel ):
121
+ """Model for layout options for a composed archive.
95
122
96
123
Args:
97
124
type (str): Specify this to assign the initial layout type for the archive.
@@ -154,7 +181,10 @@ class CreateArchiveRequest(BaseModel):
154
181
session_id : str = Field (..., serialization_alias = 'sessionId' )
155
182
has_audio : Optional [bool ] = Field (None , serialization_alias = 'hasAudio' )
156
183
has_video : Optional [bool ] = Field (None , serialization_alias = 'hasVideo' )
157
- layout : Optional [Layout ] = None
184
+ has_transcription : Optional [bool ] = Field (
185
+ None , serialization_alias = 'hasTranscription'
186
+ )
187
+ layout : Optional [ComposedLayout ] = None
158
188
multi_archive_tag : Optional [str ] = Field (None , serialization_alias = 'multiArchiveTag' )
159
189
name : Optional [str ] = None
160
190
output_mode : Optional [OutputMode ] = Field (None , serialization_alias = 'outputMode' )
@@ -180,3 +210,25 @@ def no_layout_or_resolution_for_individual_archives(self):
180
210
'The `layout` property cannot be set for `archive_mode: \' individual\' `.'
181
211
)
182
212
return self
213
+
214
+ @model_validator (mode = 'after' )
215
+ def transcription_only_for_individual_archives (self ):
216
+ if self .output_mode == OutputMode .COMPOSED and self .has_transcription is True :
217
+ raise IndividualArchivePropertyError (
218
+ 'The `has_transcription` property can only be set for `archive_mode: \' individual\' `.'
219
+ )
220
+ return self
221
+
222
+
223
+ class AddStreamRequest (BaseModel ):
224
+ """Model for adding a stream to an archive.
225
+
226
+ Args:
227
+ stream_id (str): ID of the stream to add to the archive.
228
+ has_audio (bool, Optional): Whether the stream has audio.
229
+ has_video (bool, Optional): Whether the stream has video.
230
+ """
231
+
232
+ stream_id : str = Field (..., serialization_alias = 'addStream' )
233
+ has_audio : Optional [bool ] = Field (None , serialization_alias = 'hasAudio' )
234
+ has_video : Optional [bool ] = Field (None , serialization_alias = 'hasVideo' )
0 commit comments