Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement video API (closes #15) #45

Merged
merged 32 commits into from
Feb 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e8795f1
video.edit method
kstep Feb 4, 2016
8ae59b7
video.add method
kstep Feb 4, 2016
74fe25d
add video permission to get and search
kstep Feb 4, 2016
3fd28aa
video.save method
kstep Feb 4, 2016
bc0cf63
video.delete method
kstep Feb 4, 2016
a3852f9
video.restore method
kstep Feb 4, 2016
1a83110
video.getUserVideos method
kstep Feb 4, 2016
77ab082
video.getAlbums method
kstep Feb 6, 2016
43e536b
video.getAlbumById method
kstep Feb 6, 2016
70b474d
video.addAlbum method
kstep Feb 6, 2016
84bb843
video.editAlbum method
kstep Feb 6, 2016
7ff92a8
video.deleteAlbum method
kstep Feb 6, 2016
446a91d
video.reorderAlbums method
kstep Feb 6, 2016
940daf9
video.reorderVideos method
kstep Feb 6, 2016
6c2e2fa
video.addToAlbum method
kstep Feb 6, 2016
38de64a
video.removeFromAlbum method
kstep Feb 6, 2016
e30f2c3
add required parameter missing error code
kstep Feb 6, 2016
b9143ee
video.getAlbumsByVideo method
kstep Feb 6, 2016
40206dd
video.getComments method
kstep Feb 6, 2016
09c163d
video.createComment method
kstep Feb 6, 2016
b91df26
video.deleteComment method
kstep Feb 6, 2016
09d0470
video.restoreComment method
kstep Feb 6, 2016
e8819f5
video.editComment method
kstep Feb 6, 2016
e498cef
video.getTags method
kstep Feb 6, 2016
c2fc36d
video.putTag method
kstep Feb 6, 2016
96cdb45
video.removeTag method
kstep Feb 6, 2016
906aff8
video.getNewTags method
kstep Feb 6, 2016
c0c1405
video.hideCatalogSection method
kstep Feb 6, 2016
2f68532
video.getCatalog method
kstep Feb 6, 2016
a67451d
video.getCatalogSection method
kstep Feb 7, 2016
7709707
video.report method
kstep Feb 7, 2016
dbd2bd0
video.reportComment method
kstep Feb 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,17 @@ pub enum ErrorCode {
GoodsNotFound, // 20
GoodsUnvailable, // 21
UserNotFound, // 22
RequiredParameterMissing, // 100
UserMenuAccessDenied, // 148
AccessDenied, // 204
PostAddAccessDenied, // 214
AdsPostWasRecentlyAdded, // 219,
TooManyRecipients, // 220,
HyperlinksForbidden, // 222
UserDisabledTrackBroadcast, // 221
AlbumsNumberLimitReached, // 302
VideoAlreadyAdded, // 800
VideoCommentsClosed, // 801
App(u32), // 100-999
Unknown(u32), // other
}
Expand All @@ -240,13 +244,17 @@ impl From<u32> for ErrorCode {
20 => GoodsNotFound,
21 => GoodsUnvailable,
22 => UserNotFound,
100 => RequiredParameterMissing,
148 => UserMenuAccessDenied,
204 => AccessDenied,
214 => PostAddAccessDenied,
219 => AdsPostWasRecentlyAdded,
220 => TooManyRecipients,
222 => HyperlinksForbidden,
221 => UserDisabledTrackBroadcast,
302 => AlbumsNumberLimitReached,
800 => VideoAlreadyAdded,
801 => VideoCommentsClosed,
v @ 100...999 => App(v),
v @ _ => Unknown(v),
}
Expand All @@ -268,13 +276,17 @@ impl Into<u32> for ErrorCode {
GoodsNotFound => 20,
GoodsUnvailable => 21,
UserNotFound => 22,
RequiredParameterMissing => 100,
UserMenuAccessDenied => 148,
AccessDenied => 204,
PostAddAccessDenied => 214,
AdsPostWasRecentlyAdded => 219,
TooManyRecipients => 220,
HyperlinksForbidden => 222,
UserDisabledTrackBroadcast => 221,
AlbumsNumberLimitReached => 302,
VideoAlreadyAdded => 800,
VideoCommentsClosed => 801,
App(v) => v,
Unknown(v) => v,
}
Expand All @@ -297,13 +309,17 @@ impl fmt::Display for ErrorCode {
GoodsNotFound => f.write_str("goods not found"),
GoodsUnvailable => f.write_str("goods unavailable"),
UserNotFound => f.write_str("user not found"),
RequiredParameterMissing => f.write_str("one of required parameters is missing"),
UserMenuAccessDenied => f.write_str("access to the menu of the user denied"),
AccessDenied => f.write_str("access denied"),
PostAddAccessDenied => f.write_str("access to adding post denied"),
AdsPostWasRecentlyAdded => f.write_str("ads post was recently added"),
TooManyRecipients => f.write_str("too many recipients"),
HyperlinksForbidden => f.write_str("hyperlinks are forbidden"),
UserDisabledTrackBroadcast => f.write_str("user disabled track name broadcast"),
AlbumsNumberLimitReached => f.write_str("albums number limit is reached"),
VideoAlreadyAdded => f.write_str("video is already added"),
VideoCommentsClosed => f.write_str("comments for this video are closed"),
App(v) => write!(f, "application error #{}", v),
Unknown(v) => write!(f, "unknown error #{}", v),
}
Expand Down Expand Up @@ -359,3 +375,30 @@ impl AsRef<str> for Sort {
}
}
}

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
#[repr(u8)]
pub enum ReportReason {
Spam = 0,
ChildPorn = 1,
Extremism = 2,
Violence = 3,
Drugs = 4,
AdultOnly = 5,
Offence = 6,
}

impl AsRef<str> for ReportReason {
fn as_ref(&self) -> &str {
use self::ReportReason::*;
match *self {
Spam => "0",
ChildPorn => "1",
Extremism => "2",
Violence => "3",
Drugs => "4",
AdultOnly => "5",
Offence => "6",
}
}
}
10 changes: 0 additions & 10 deletions src/photos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,3 @@ impl AsRef<str> for Sort {
}
}
}

pub enum ReportReason {
Spam = 0,
ChildPorn = 1,
Extremism = 2,
Violence = 3,
Drugs = 4,
AdultOnly = 5,
Offence = 6,
}
Loading