-
Notifications
You must be signed in to change notification settings - Fork 83
/
VideoUpdateMetadata.cs
130 lines (107 loc) · 3.76 KB
/
VideoUpdateMetadata.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using JetBrains.Annotations;
using System.Collections.Generic;
using VimeoDotNet.Enums;
namespace VimeoDotNet.Models
{
/// <summary>
/// Video update metadata model
/// </summary>
public class VideoUpdateMetadata
{
/// <summary>
/// The new title for the video
/// </summary>
[PublicAPI]
public string Name { get; set; }
/// <summary>
/// The new description for the video
/// </summary>
[PublicAPI]
public string Description { get; set; }
/// <summary>
/// The new privacy setting for the video.
/// Content-type application/json is the only valid type for type "users",
/// basic users can not set privacy to unlisted.
/// </summary>
[PublicAPI]
public VideoPrivacyEnum? Privacy { get; set; }
/// <summary>
/// The videos new embed settings. Whitelist allows you to define all valid embed domains.
/// Check out our docs for adding and removing domains.
/// </summary>
[PublicAPI]
public VideoEmbedPrivacyEnum? EmbedPrivacy { get; set; }
/// <summary>
/// Enable or disable the review page
/// </summary>
[PublicAPI]
public bool? ReviewLinkEnabled { get; set; }
/// <summary>
/// When you set privacy to password, you must provide the password as an additional parameter
/// </summary>
[PublicAPI]
public string Password { get; set; }
/// <summary>
/// The privacy for who can comment on the video.
/// </summary>
[PublicAPI]
public VideoCommentsEnum? Comments { get; set; }
/// <summary>
/// Enable or disable the ability for anyone to add the video to an album, channel, or group.
/// </summary>
[PublicAPI]
public bool? AllowAddToAlbumChannelGroup { get; set; }
/// <summary>
/// Enable or disable the ability for anyone to download video.
/// </summary>
[PublicAPI]
public bool? AllowDownloadVideo { get; set; }
[PublicAPI]
[CanBeNull]
public SpatialUpdateMetadata Spatial { get; set; }
/// <inheritdoc />
[PublicAPI]
public IDictionary<string, string> GetParameterValues()
{
var parameters = new Dictionary<string, string>();
if (Name != null)
{
parameters["name"] = Name.Trim();
}
if (Description != null)
{
parameters["description"] = Description.Trim();
}
if (Privacy != null)
{
parameters["privacy.view"] = Privacy.ToString().ToLower();
}
if (Privacy == VideoPrivacyEnum.Password)
{
parameters["password"] = Password;
}
if (EmbedPrivacy != null)
{
parameters["privacy.embed"] = EmbedPrivacy.ToString().ToLower();
}
if (Comments != null)
{
parameters["privacy.comments"] = Comments.ToString().ToLower();
}
if (ReviewLinkEnabled.HasValue)
{
parameters["review_page"] = ReviewLinkEnabled.Value ? "true" : "false";
}
if (AllowDownloadVideo.HasValue)
{
parameters["privacy.download"] = AllowDownloadVideo.Value ? "true" : "false";
}
if (AllowAddToAlbumChannelGroup.HasValue)
{
parameters["privacy.add"] = AllowAddToAlbumChannelGroup.Value ? "true" : "false";
}
Spatial?.SetParameterValues(parameters, "spatial");
return parameters;
}
}
}