diff --git a/src/common.rs b/src/common.rs new file mode 100644 index 0000000000..13ad359ae3 --- /dev/null +++ b/src/common.rs @@ -0,0 +1,28 @@ +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +pub enum Scope { + /// Manage your YouTube account + Account, + /// View your YouTube account + AccountReadOnly, + /// Manage your YouTube videos, which includes uploads and meta-data changes + Video, + /// View and manage your assets and associated content on YouTube + Partner, + /// View private information of your YouTube channel relevant during the + /// audit process with a YouTube partner. + Audit, +} + +impl Str for Scope { + fn as_slice(&self) -> &str { + match *self { + Scope::Account => "https://www.googleapis.com/auth/youtube", + Scope::AccountReadOnly => "https://www.googleapis.com/auth/youtube.readonly", + Scope::Video => "https://www.googleapis.com/auth/youtube.upload", + Scope::Partner => "https://www.googleapis.com/auth/youtubepartner", + Scope::Audit => "https://www.googleapis.com/auth/youtubepartner-channel-audit", + } + } +} \ No newline at end of file diff --git a/src/videos.rs b/src/videos.rs new file mode 100644 index 0000000000..684f0ecf61 --- /dev/null +++ b/src/videos.rs @@ -0,0 +1,35 @@ +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::marker::PhantomData; + +use hyper; + +pub struct VideosService<'a, C, NC> + where NC: 'a, + C: 'a { + + client: &'a RefCell, + + _m: PhantomData +} + +impl<'a, C, NC> VideosService<'a, C, NC> + where NC: hyper::net::NetworkConnector, + C: BorrowMut> + 'a { + + pub fn new(client: &'a RefCell) -> VideosService<'a, C, NC> { + VideosService { + client: client, + _m: PhantomData, + } + } +} + + + +#[cfg(test)] +mod tests { + + + +} \ No newline at end of file