Skip to content

Commit

Permalink
feat: support multiArchiveTag on archive responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Feb 29, 2024
1 parent 142c988 commit d9b38c2
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"hasVideo": true
}
],
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4"
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4",
"multiArchiveTag": "custom-tag"
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ internal static void VerifyArchive(Archive success)
success.Url.Should()
.Be(
"https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4");
success.MultiArchiveTag.Should().Be("custom-tag");
success.Streams.Length.Should().Be(1);
success.Streams[0].StreamId.Should().Be("abc123");
success.Streams[0].HasAudio.Should().BeTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"hasVideo": true
}
],
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4"
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4",
"multiArchiveTag": "custom-tag"
}
1 change: 1 addition & 0 deletions Vonage.Test/Video/Archives/GetArchive/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ internal static void VerifyArchive(Archive success)
success.Url.Should()
.Be(
"https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4");
success.MultiArchiveTag.Should().Be("custom-tag");
success.Streams.Length.Should().Be(1);
success.Streams[0].StreamId.Should().Be("abc123");
success.Streams[0].HasAudio.Should().BeTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"hasVideo": true
}
],
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4"
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4",
"multiArchiveTag": "custom-tag"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ internal static void VerifyArchives(GetArchivesResponse success)
success.Items[0].Url.Should()
.Be(
"https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4");
success.Items[0].MultiArchiveTag.Should().Be("custom-tag");
success.Items[0].Streams.Length.Should().Be(1);
success.Items[0].Streams[0].StreamId.Should().Be("abc123");
success.Items[0].Streams[0].HasAudio.Should().BeTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"hasVideo": true
}
],
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4"
"url": "https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4",
"multiArchiveTag": "custom-tag"
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ internal static void VerifyArchive(Archive success)
success.Url.Should()
.Be(
"https://tokbox.com.archive2.s3.amazonaws.com/123456/09141e29-8770-439b-b180-337d7e637545/archive.mp4");
success.MultiArchiveTag.Should().Be("custom-tag");
success.Streams.Length.Should().Be(1);
success.Streams[0].StreamId.Should().Be("abc123");
success.Streams[0].HasAudio.Should().BeTrue();
Expand Down
12 changes: 11 additions & 1 deletion Vonage/Video/Archives/Archive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ public struct Archive
/// </summary>
public string Url { get; }

/// <summary>
/// Set this to support recording multiple archives for the same session simultaneously. Set this to a unique string
/// for each simultaneous archive of an ongoing session. You must also set this option when manually starting an
/// archive in a session that is automatically archived. If you do not specify a unique multiArchiveTag, you can only
/// record one archive at a time for a given session.
/// </summary>
public string MultiArchiveTag { get; }

/// <summary>
/// Creates an archive.
/// </summary>
Expand Down Expand Up @@ -162,10 +170,11 @@ public struct Archive
/// The download URL is obfuscated, and the file is only available from the URL for 10 minutes.
/// </param>
/// <param name="streams">The collection of streams.</param>
/// <param name="multiArchiveTag">Set this to support recording multiple archives for the same session simultaneously. Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive in a session that is automatically archived. If you do not specify a unique multiArchiveTag, you can only record one archive at a time for a given session.</param>
[JsonConstructor]
public Archive(long createdAt, int duration, bool hasAudio, bool hasVideo, string id, string name,
string applicationId, string reason, RenderResolution resolution, string sessionId, int size, string status,
string streamMode, string url, Stream[] streams)
string streamMode, string url, Stream[] streams, string multiArchiveTag)
{
this.CreatedAt = createdAt;
this.Duration = duration;
Expand All @@ -182,6 +191,7 @@ public struct Archive
this.StreamMode = streamMode;
this.Url = url;
this.Streams = streams;
this.MultiArchiveTag = multiArchiveTag;
}

/// <summary>
Expand Down

0 comments on commit d9b38c2

Please sign in to comment.