diff --git a/Cargo.toml b/Cargo.toml index 5066b65662..8bd1b5a83f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,9 @@ path = "src/rust/lib.rs" [dependencies] hyper = "*" mime = "*" -rustc-serialize = "*" yup-oauth2 = "*" +serde = "*" +serde_macros = "*" [dev-dependencies] yup-hyper-mock = "*" diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index d5c53e3203..c4cf570098 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -97,7 +97,7 @@ google-youtube3 = "0.0.1" ```Rust extern crate hyper; extern crate "yup-oauth2" as oauth2; -extern crate "rustc-serialize" as rustc_serialize; +extern crate serde; extern crate "google-youtube3" as youtube3; use youtube3::Result; use std::default::Default; diff --git a/gen/youtube3/cargo.toml b/gen/youtube3/cargo.toml index 2207e17468..55e93a0548 100644 --- a/gen/youtube3/cargo.toml +++ b/gen/youtube3/cargo.toml @@ -17,5 +17,6 @@ keywords = ["youtube", "google", "protocol", "web", "api"] hyper = "*" mime = "*" url = "*" -rustc-serialize = "*" +serde = "*" +serde_macros = "*" yup-oauth2 = "*" diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index ef0813e1d7..1964436fec 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/src/cmn.rs @@ -45,10 +45,10 @@ impl ReadSeek for T {} /// A utility type which can decode a server response that indicates error -#[derive(RustcDecodable)] +#[derive(Deserialize)] pub struct JsonServerError { - error: String, - error_description: Option + pub error: String, + pub error_description: Option } diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 611211a7c0..20aaa1772d 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -98,7 +98,7 @@ //! ```test_harness,no_run //! extern crate hyper; //! extern crate "yup-oauth2" as oauth2; -//! extern crate "rustc-serialize" as rustc_serialize; +//! extern crate serde; //! extern crate "google-youtube3" as youtube3; //! use youtube3::Result; //! # #[test] fn egal() { @@ -200,10 +200,12 @@ // Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any // unused imports in fully featured APIs. Same with unused_mut ... . #![allow(unused_imports, unused_mut)] - +// Required for serde annotations +#![feature(custom_derive, custom_attribute, plugin)] +#![plugin(serde_macros)] extern crate hyper; -extern crate "rustc-serialize" as rustc_serialize; +extern crate serde; extern crate "yup-oauth2" as oauth2; extern crate mime; extern crate url; @@ -216,7 +218,7 @@ use std::borrow::BorrowMut; use std::default::Default; use std::collections::BTreeMap; use std::marker::PhantomData; -use rustc_serialize::json; +use serde::json; use std::io; use std::fs; use std::old_io::timer::sleep; @@ -286,7 +288,7 @@ impl Default for Scope { /// ```test_harness,no_run /// extern crate hyper; /// extern crate "yup-oauth2" as oauth2; -/// extern crate "rustc-serialize" as rustc_serialize; +/// extern crate serde; /// extern crate "google-youtube3" as youtube3; /// use youtube3::Result; /// # #[test] fn egal() { @@ -427,25 +429,31 @@ impl<'a, C, NC, A> YouTube /// /// * [list subscriptions](struct.SubscriptionListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct SubscriptionListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(alias="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#subscriptionListResponse". pub kind: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, /// A list of subscriptions that match the request criteria. - pub items: Vec, + pub items: Option>, /// no description provided + #[serde(alias="tokenPagination")] pub token_pagination: Option, /// Etag of this resource. pub etag: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(alias="prevPageToken")] pub prev_page_token: Option, /// no description provided + #[serde(alias="pageInfo")] pub page_info: Option, } @@ -456,15 +464,19 @@ impl ResponseResult for SubscriptionListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelAuditDetails { /// Whether or not the channel has any copyright strikes. + #[serde(alias="copyrightStrikesGoodStanding")] pub copyright_strikes_good_standing: Option, /// Whether or not the channel respects the community guidelines. + #[serde(alias="communityGuidelinesGoodStanding")] pub community_guidelines_good_standing: Option, /// Whether or not the channel has any unresolved claims. + #[serde(alias="contentIdClaimsGoodStanding")] pub content_id_claims_good_standing: Option, /// Describes the general state of the channel. This field will always show if there are any issues whatsoever with the channel. Currently this field represents the result of the logical and operation over the community guidelines good standing, the copyright strikes good standing and the content ID claims good standing, but this may change in the future. + #[serde(alias="overallGoodStanding")] pub overall_good_standing: Option, } @@ -492,31 +504,40 @@ impl ChannelAuditDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoFileDetails { /// The uploaded video file's combined (video and audio) bitrate in bits per second. + #[serde(alias="bitrateBps")] pub bitrate_bps: Option, /// The uploaded video file's container format. pub container: Option, /// Geographic coordinates that identify the place where the uploaded video was recorded. Coordinates are defined using WGS 84. + #[serde(alias="recordingLocation")] pub recording_location: Option, /// The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded. + #[serde(alias="fileType")] pub file_type: Option, /// The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: /// - Date only: YYYY-MM-DD /// - Naive time: YYYY-MM-DDTHH:MM:SS /// - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM + #[serde(alias="creationTime")] pub creation_time: Option, /// The length of the uploaded video in milliseconds. + #[serde(alias="durationMs")] pub duration_ms: Option, /// The uploaded file's name. This field is present whether a video file or another type of file was uploaded. + #[serde(alias="fileName")] pub file_name: Option, /// The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded. + #[serde(alias="fileSize")] pub file_size: Option, /// A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream. - pub video_streams: Vec, + #[serde(alias="videoStreams")] + pub video_streams: Option>, /// A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream. - pub audio_streams: Vec, + #[serde(alias="audioStreams")] + pub audio_streams: Option>, } impl Part for VideoFileDetails {} @@ -538,8 +559,8 @@ impl VideoFileDetails { if self.duration_ms.is_some() { r = r + "durationMs,"; } if self.file_name.is_some() { r = r + "fileName,"; } if self.file_size.is_some() { r = r + "fileSize,"; } - if self.video_streams.len() > 0 { r = r + "videoStreams,"; } - if self.audio_streams.len() > 0 { r = r + "audioStreams,"; } + if self.video_streams.is_some() { r = r + "videoStreams,"; } + if self.audio_streams.is_some() { r = r + "audioStreams,"; } r.pop(); r } @@ -549,7 +570,7 @@ impl VideoFileDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistLocalization { /// The localized strings for playlist's description. pub description: Option, @@ -579,9 +600,10 @@ impl PlaylistLocalization { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsComment { /// The resourceId object contains information that identifies the resource associated with the comment. + #[serde(alias="resourceId")] pub resource_id: Option, } @@ -610,25 +632,31 @@ impl ActivityContentDetailsComment { /// /// * [list playlist items](struct.PlaylistItemListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct PlaylistItemListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(alias="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistItemListResponse". pub kind: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, /// A list of playlist items that match the request criteria. - pub items: Vec, + pub items: Option>, /// no description provided + #[serde(alias="tokenPagination")] pub token_pagination: Option, /// Etag of this resource. pub etag: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(alias="prevPageToken")] pub prev_page_token: Option, /// no description provided + #[serde(alias="pageInfo")] pub page_info: Option, } @@ -639,7 +667,7 @@ impl ResponseResult for PlaylistItemListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PropertyValue { /// A property. pub property: Option, @@ -669,13 +697,16 @@ impl PropertyValue { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InvideoTiming { /// Defines the time at which the promotion will appear. Depending on the value of type the value of the offsetMs field will represent a time offset from the start or from the end of the video, expressed in milliseconds. + #[serde(alias="offsetMs")] pub offset_ms: Option, /// Describes a timing type. If the value is offsetFromStart, then the offsetMs field represents an offset from the start of the video. If the value is offsetFromEnd, then the offsetMs field represents an offset from the end of the video. + #[serde(alias="type")] pub type_: Option, /// Defines the duration in milliseconds for which the promotion should be displayed. If missing, the client should use the default. + #[serde(alias="durationMs")] pub duration_ms: Option, } @@ -702,21 +733,25 @@ impl InvideoTiming { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistSnippet { /// The playlist's description. pub description: Option, /// The playlist's title. pub title: Option, /// The ID that YouTube uses to uniquely identify the channel that published the playlist. + #[serde(alias="channelId")] pub channel_id: Option, /// The date and time that the playlist was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="publishedAt")] pub published_at: Option, /// Keyword tags associated with the playlist. - pub tags: Vec, + pub tags: Option>, /// The channel title of the channel that the video belongs to. + #[serde(alias="channelTitle")] pub channel_title: Option, /// The language of the playlist's default title and description. + #[serde(alias="defaultLanguage")] pub default_language: Option, /// Localized title and description, read-only. pub localized: Option, @@ -739,7 +774,7 @@ impl PlaylistSnippet { if self.title.is_some() { r = r + "title,"; } if self.channel_id.is_some() { r = r + "channelId,"; } if self.published_at.is_some() { r = r + "publishedAt,"; } - if self.tags.len() > 0 { r = r + "tags,"; } + if self.tags.is_some() { r = r + "tags,"; } if self.channel_title.is_some() { r = r + "channelTitle,"; } if self.default_language.is_some() { r = r + "defaultLanguage,"; } if self.localized.is_some() { r = r + "localized,"; } @@ -753,9 +788,10 @@ impl PlaylistSnippet { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsLike { /// The resourceId object contains information that identifies the rated resource. + #[serde(alias="resourceId")] pub resource_id: Option, } @@ -787,7 +823,7 @@ impl ActivityContentDetailsLike { /// * [list live streams](struct.LiveStreamListMethodBuilder.html) (none) /// * [insert live streams](struct.LiveStreamInsertMethodBuilder.html) (request|response) /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveStream { /// The status object contains information about live stream's status. pub status: Option, @@ -798,6 +834,7 @@ pub struct LiveStream { /// Etag of this resource. pub etag: Option, /// The content_details object contains information about the stream, including the closed captions ingestion URL. + #[serde(alias="contentDetails")] pub content_details: Option, /// The cdn object defines the live stream's content delivery network (CDN) settings. These settings provide details about the manner in which you stream your content to YouTube. pub cdn: Option, @@ -836,17 +873,19 @@ impl LiveStream { /// /// * [set thumbnails](struct.ThumbnailSetMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct ThumbnailSetResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// A list of thumbnails. - pub items: Vec, + pub items: Option>, /// Identifies what kind of resource this is. Value: the fixed string "youtube#thumbnailSetResponse". pub kind: Option, /// Etag of this resource. pub etag: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, } @@ -857,9 +896,10 @@ impl ResponseResult for ThumbnailSetResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsUpload { /// The ID that YouTube uses to uniquely identify the uploaded video. + #[serde(alias="videoId")] pub video_id: Option, } @@ -883,33 +923,43 @@ impl ActivityContentDetailsUpload { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSettings { /// Specifies the channel description. pub description: Option, /// Specifies the channel title. pub title: Option, /// Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible. + #[serde(alias="moderateComments")] pub moderate_comments: Option, /// Whether the tab to browse the videos should be displayed. + #[serde(alias="showBrowseView")] pub show_browse_view: Option, /// Title for the featured channels tab. + #[serde(alias="featuredChannelsTitle")] pub featured_channels_title: Option, /// no description provided + #[serde(alias="defaultLanguage")] pub default_language: Option, /// The trailer of the channel, for users that are not subscribers. + #[serde(alias="unsubscribedTrailer")] pub unsubscribed_trailer: Option, /// The list of featured channels. - pub featured_channels_urls: Vec, + #[serde(alias="featuredChannelsUrls")] + pub featured_channels_urls: Option>, /// A prominent color that can be rendered on this channel page. + #[serde(alias="profileColor")] pub profile_color: Option, /// Which content tab users should see when viewing the channel. + #[serde(alias="defaultTab")] pub default_tab: Option, /// Lists keywords associated with the channel, comma-separated. pub keywords: Option, /// Whether related channels should be proposed. + #[serde(alias="showRelatedChannels")] pub show_related_channels: Option, /// The ID for a Google Analytics account to track and measure traffic to the channels. + #[serde(alias="trackingAnalyticsAccountId")] pub tracking_analytics_account_id: Option, } @@ -931,7 +981,7 @@ impl ChannelSettings { if self.featured_channels_title.is_some() { r = r + "featuredChannelsTitle,"; } if self.default_language.is_some() { r = r + "defaultLanguage,"; } if self.unsubscribed_trailer.is_some() { r = r + "unsubscribedTrailer,"; } - if self.featured_channels_urls.len() > 0 { r = r + "featuredChannelsUrls,"; } + if self.featured_channels_urls.is_some() { r = r + "featuredChannelsUrls,"; } if self.profile_color.is_some() { r = r + "profileColor,"; } if self.default_tab.is_some() { r = r + "defaultTab,"; } if self.keywords.is_some() { r = r + "keywords,"; } @@ -946,9 +996,10 @@ impl ChannelSettings { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct SearchResultSnippet { /// It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's "none" if there is not any upcoming/active live broadcasts. + #[serde(alias="liveBroadcastContent")] pub live_broadcast_content: Option, /// A description of the search result. pub description: Option, @@ -957,10 +1008,13 @@ pub struct SearchResultSnippet { /// A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. pub thumbnails: Option, /// The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies. + #[serde(alias="channelId")] pub channel_id: Option, /// The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="publishedAt")] pub published_at: Option, /// The title of the channel that published the resource that the search result identifies. + #[serde(alias="channelTitle")] pub channel_title: Option, } @@ -972,17 +1026,20 @@ impl ResponseResult for SearchResultSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IngestionInfo { /// The backup ingestion URL that you should use to stream video to YouTube. You have the option of simultaneously streaming the content that you are sending to the ingestionAddress to this URL. + #[serde(alias="backupIngestionAddress")] pub backup_ingestion_address: Option, /// The HTTP or RTMP stream name that YouTube assigns to the video stream. + #[serde(alias="streamName")] pub stream_name: Option, /// The primary ingestion URL that you should use to stream video to YouTube. You must stream video to this URL. /// /// Depending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format: /// /// STREAM_URL/STREAM_NAME + #[serde(alias="ingestionAddress")] pub ingestion_address: Option, } @@ -1009,13 +1066,15 @@ impl IngestionInfo { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CdnSettings { /// The format of the video stream that you are sending to Youtube. pub format: Option, /// The ingestionInfo object contains information that YouTube provides that you need to transmit your RTMP or HTTP stream to YouTube. + #[serde(alias="ingestionInfo")] pub ingestion_info: Option, /// The method or protocol used to transmit the video stream. + #[serde(alias="ingestionType")] pub ingestion_type: Option, } @@ -1047,17 +1106,19 @@ impl CdnSettings { /// /// * [get rating videos](struct.VideoGetRatingMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct VideoGetRatingResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// A list of ratings that match the request criteria. - pub items: Vec, + pub items: Option>, /// Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". pub kind: Option, /// Etag of this resource. pub etag: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, } @@ -1068,11 +1129,12 @@ impl ResponseResult for VideoGetRatingResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct VideoCategorySnippet { /// no description provided pub assignable: Option, /// The YouTube channel that created the video category. + #[serde(alias="channelId")] pub channel_id: Option, /// The video category's title. pub title: Option, @@ -1086,9 +1148,10 @@ impl ResponseResult for VideoCategorySnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsChannelItem { /// The resourceId object contains information that identifies the resource that was added to the channel. + #[serde(alias="resourceId")] pub resource_id: Option, } @@ -1112,23 +1175,29 @@ impl ActivityContentDetailsChannelItem { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveBroadcastSnippet { /// The date and time that the broadcast actually ended. This information is only available once the broadcast's state is complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="actualEndTime")] pub actual_end_time: Option, /// The broadcast's description. As with the title, you can set this field by modifying the broadcast resource or by setting the description field of the corresponding video resource. pub description: Option, /// The broadcast's title. Note that the broadcast represents exactly one YouTube video. You can set this field by modifying the broadcast resource or by setting the title field of the corresponding video resource. pub title: Option, /// The ID that YouTube uses to uniquely identify the channel that is publishing the broadcast. + #[serde(alias="channelId")] pub channel_id: Option, /// The date and time that the broadcast was added to YouTube's live broadcast schedule. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="publishedAt")] pub published_at: Option, /// The date and time that the broadcast is scheduled to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="scheduledStartTime")] pub scheduled_start_time: Option, /// The date and time that the broadcast actually started. This information is only available once the broadcast's state is live. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="actualStartTime")] pub actual_start_time: Option, /// The date and time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="scheduledEndTime")] pub scheduled_end_time: Option, /// A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. pub thumbnails: Option, @@ -1163,21 +1232,25 @@ impl LiveBroadcastSnippet { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SubscriptionSnippet { /// The subscription's details. pub description: Option, /// The subscription's title. pub title: Option, /// The id object contains information about the channel that the user subscribed to. + #[serde(alias="resourceId")] pub resource_id: Option, /// A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. pub thumbnails: Option, /// The ID that YouTube uses to uniquely identify the subscriber's channel. + #[serde(alias="channelId")] pub channel_id: Option, /// The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="publishedAt")] pub published_at: Option, /// Channel title for the channel that the subscription belongs to. + #[serde(alias="channelTitle")] pub channel_title: Option, } @@ -1208,12 +1281,12 @@ impl SubscriptionSnippet { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSectionContentDetails { /// The channel ids for type multiple_channels. - pub channels: Vec, + pub channels: Option>, /// The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed. - pub playlists: Vec, + pub playlists: Option>, } impl Part for ChannelSectionContentDetails {} @@ -1227,8 +1300,8 @@ impl ChannelSectionContentDetails { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.channels.len() > 0 { r = r + "channels,"; } - if self.playlists.len() > 0 { r = r + "playlists,"; } + if self.channels.is_some() { r = r + "channels,"; } + if self.playlists.is_some() { r = r + "playlists,"; } r.pop(); r } @@ -1243,17 +1316,19 @@ impl ChannelSectionContentDetails { /// /// * [list i18n regions](struct.I18nRegionListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct I18nRegionListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// A list of regions where YouTube is available. In this map, the i18n region ID is the map key, and its value is the corresponding i18nRegion resource. - pub items: Vec, + pub items: Option>, /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegionListResponse". pub kind: Option, /// Etag of this resource. pub etag: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, } @@ -1269,25 +1344,31 @@ impl ResponseResult for I18nRegionListResponse {} /// /// * [list live streams](struct.LiveStreamListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct LiveStreamListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(alias="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveStreamListResponse". pub kind: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, /// A list of live streams that match the request criteria. - pub items: Vec, + pub items: Option>, /// no description provided + #[serde(alias="tokenPagination")] pub token_pagination: Option, /// Etag of this resource. pub etag: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(alias="prevPageToken")] pub prev_page_token: Option, /// no description provided + #[serde(alias="pageInfo")] pub page_info: Option, } @@ -1298,7 +1379,7 @@ impl ResponseResult for LiveStreamListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveStreamContentDetails { /// Indicates whether the stream is reusable, which means that it can be bound to multiple broadcasts. It is common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times. /// @@ -1306,8 +1387,10 @@ pub struct LiveStreamContentDetails { /// - A non-reusable stream can only be bound to one broadcast. /// - A non-reusable stream might be deleted by an automated process after the broadcast ends. /// - The liveStreams.list method does not list non-reusable streams if you call the method and set the mine parameter to true. The only way to use that method to retrieve the resource for a non-reusable stream is to use the id parameter to identify the stream. + #[serde(alias="isReusable")] pub is_reusable: Option, /// The ingestion URL where the closed captions of this stream are sent. + #[serde(alias="closedCaptionsIngestionUrl")] pub closed_captions_ingestion_url: Option, } @@ -1333,7 +1416,7 @@ impl LiveStreamContentDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct I18nLanguageSnippet { /// The human-readable name of the language in the language itself. pub name: Option, @@ -1355,17 +1438,20 @@ impl cmn::Resource for I18nLanguageSnippet {} /// /// * [set watermarks](struct.WatermarkSetMethodBuilder.html) (request) /// -#[derive(Default, Clone, Debug, RustcEncodable)] +#[derive(Default, Clone, Debug, Serialize)] pub struct InvideoBranding { /// no description provided + #[serde(alias="targetChannelId")] pub target_channel_id: Option, /// no description provided pub position: Option, /// no description provided + #[serde(alias="imageUrl")] pub image_url: Option, /// no description provided pub timing: Option, /// no description provided + #[serde(alias="imageBytes")] pub image_bytes: Option, } @@ -1391,9 +1477,10 @@ impl InvideoBranding { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistItemStatus { /// This resource's privacy status. + #[serde(alias="privacyStatus")] pub privacy_status: Option, } @@ -1418,11 +1505,12 @@ impl PlaylistItemStatus { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelConversionPing { /// Defines the context of the ping. pub context: Option, /// The url (without the schema) that the player shall send the ping to. It's at caller's descretion to decide which schema to use (http vs https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must append biscotti authentication (ms param in case of mobile, for example) to this ping. + #[serde(alias="conversionUrl")] pub conversion_url: Option, } @@ -1448,10 +1536,10 @@ impl ChannelConversionPing { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoProjectDetails { /// A list of project tags associated with the video during the upload. - pub tags: Vec, + pub tags: Option>, } impl Part for VideoProjectDetails {} @@ -1465,7 +1553,7 @@ impl VideoProjectDetails { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.tags.len() > 0 { r = r + "tags,"; } + if self.tags.is_some() { r = r + "tags,"; } r.pop(); r } @@ -1492,7 +1580,7 @@ impl VideoProjectDetails { /// * [list playlist items](struct.PlaylistItemListMethodBuilder.html) (none) /// * [delete playlist items](struct.PlaylistItemDeleteMethodBuilder.html) (none) /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistItem { /// The status object contains information about the playlist item's privacy status. pub status: Option, @@ -1503,6 +1591,7 @@ pub struct PlaylistItem { /// Etag of this resource. pub etag: Option, /// The contentDetails object is included in the resource if the included item is a YouTube video. The object contains additional information about the video. + #[serde(alias="contentDetails")] pub content_details: Option, /// The ID that YouTube uses to uniquely identify the playlist item. pub id: Option, @@ -1538,25 +1627,31 @@ impl PlaylistItem { /// /// * [list guide categories](struct.GuideCategoryListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct GuideCategoryListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(alias="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#guideCategoryListResponse". pub kind: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, /// A list of categories that can be associated with YouTube channels. In this map, the category ID is the map key, and its value is the corresponding guideCategory resource. - pub items: Vec, + pub items: Option>, /// no description provided + #[serde(alias="tokenPagination")] pub token_pagination: Option, /// Etag of this resource. pub etag: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(alias="prevPageToken")] pub prev_page_token: Option, /// no description provided + #[serde(alias="pageInfo")] pub page_info: Option, } @@ -1567,7 +1662,7 @@ impl ResponseResult for GuideCategoryListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoLocalization { /// Localized version of the video's description. pub description: Option, @@ -1597,7 +1692,7 @@ impl VideoLocalization { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSectionSnippet { /// The style of the channel section. pub style: Option, @@ -1608,10 +1703,13 @@ pub struct ChannelSectionSnippet { /// The position of the channel section in the channel. pub position: Option, /// The ID that YouTube uses to uniquely identify the channel that published the channel section. + #[serde(alias="channelId")] pub channel_id: Option, /// The type of the channel section. + #[serde(alias="type")] pub type_: Option, /// The language of the channel section's default title and description. + #[serde(alias="defaultLanguage")] pub default_language: Option, } @@ -1642,11 +1740,13 @@ impl ChannelSectionSnippet { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelContentDetails { /// no description provided + #[serde(alias="relatedPlaylists")] pub related_playlists: Option, /// The googlePlusUserId object identifies the Google+ profile ID associated with this channel. + #[serde(alias="googlePlusUserId")] pub google_plus_user_id: Option, } @@ -1672,7 +1772,7 @@ impl ChannelContentDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct TokenPagination; impl Part for TokenPagination {} @@ -1688,7 +1788,7 @@ impl ResponseResult for TokenPagination {} /// /// * [list i18n regions](struct.I18nRegionListMethodBuilder.html) (none) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct I18nRegion { /// The snippet object contains basic details about the i18n region, such as region code and human-readable name. pub snippet: Option, @@ -1708,7 +1808,7 @@ impl cmn::Resource for I18nRegion {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ThumbnailDetails { /// The default image for this resource. pub default: Option, @@ -1747,7 +1847,7 @@ impl ThumbnailDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoMonetizationDetails { /// The value of access indicates whether the video can be monetized or not. pub access: Option, @@ -1774,13 +1874,15 @@ impl VideoMonetizationDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsRecommendation { /// The resourceId object contains information that identifies the recommended resource. + #[serde(alias="resourceId")] pub resource_id: Option, /// The reason that the resource is recommended to the user. pub reason: Option, /// The seedResourceId object contains information about the resource that caused the recommendation. + #[serde(alias="seedResourceId")] pub seed_resource_id: Option, } @@ -1806,11 +1908,13 @@ impl ActivityContentDetailsRecommendation { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoRecordingDetails { /// The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. + #[serde(alias="recordingDate")] pub recording_date: Option, /// The text description of the location where the video was recorded. + #[serde(alias="locationDescription")] pub location_description: Option, /// The geolocation information associated with the video. pub location: Option, @@ -1839,9 +1943,10 @@ impl VideoRecordingDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetailsSubscription { /// The resourceId object contains information that identifies the resource that the user subscribed to. + #[serde(alias="resourceId")] pub resource_id: Option, } @@ -1865,10 +1970,10 @@ impl ActivityContentDetailsSubscription { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelConversionPings { /// Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping. - pub pings: Vec, + pub pings: Option>, } impl Part for ChannelConversionPings {} @@ -1882,7 +1987,7 @@ impl ChannelConversionPings { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.pings.len() > 0 { r = r + "pings,"; } + if self.pings.is_some() { r = r + "pings,"; } r.pop(); r } @@ -1892,15 +1997,17 @@ impl ChannelConversionPings { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetails { /// The comment object contains information about a resource that received a comment. This property is only present if the snippet.type is comment. pub comment: Option, /// The playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem. + #[serde(alias="playlistItem")] pub playlist_item: Option, /// The like object contains information about a resource that received a positive (like) rating. This property is only present if the snippet.type is like. pub like: Option, /// The promotedItem object contains details about a resource which is being promoted. This property is only present if the snippet.type is promotedItem. + #[serde(alias="promotedItem")] pub promoted_item: Option, /// The recommendation object contains information about a recommended resource. This property is only present if the snippet.type is recommendation. pub recommendation: Option, @@ -1911,6 +2018,7 @@ pub struct ActivityContentDetails { /// The social object contains details about a social network post. This property is only present if the snippet.type is social. pub social: Option, /// The channelItem object contains details about a resource which was added to a channel. This property is only present if the snippet.type is channelItem. + #[serde(alias="channelItem")] pub channel_item: Option, /// The bulletin object contains details about a channel bulletin post. This object is only present if the snippet.type is bulletin. pub bulletin: Option, @@ -1953,25 +2061,31 @@ impl ActivityContentDetails { /// /// * [list playlists](struct.PlaylistListMethodBuilder.html) (response) /// -#[derive(Default, Clone, Debug, RustcDecodable)] +#[derive(Default, Clone, Debug, Deserialize)] pub struct PlaylistListResponse { /// Serialized EventId of the request which produced this response. + #[serde(alias="eventId")] pub event_id: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(alias="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistListResponse". pub kind: Option, /// The visitorId identifies the visitor. + #[serde(alias="visitorId")] pub visitor_id: Option, /// A list of playlists that match the request criteria. - pub items: Vec, + pub items: Option>, /// no description provided + #[serde(alias="tokenPagination")] pub token_pagination: Option, /// Etag of this resource. pub etag: Option, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(alias="prevPageToken")] pub prev_page_token: Option, /// no description provided + #[serde(alias="pageInfo")] pub page_info: Option, } @@ -1982,15 +2096,18 @@ impl ResponseResult for PlaylistListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistItemContentDetails { /// A user-generated note for this item. pub note: Option, /// The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0. + #[serde(alias="startAt")] pub start_at: Option, /// The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video. + #[serde(alias="endAt")] pub end_at: Option, /// The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request. + #[serde(alias="videoId")] pub video_id: Option, } @@ -2018,11 +2135,13 @@ impl PlaylistItemContentDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelContentOwnerDetails { /// The ID of the content owner linked to the channel. + #[serde(alias="contentOwner")] pub content_owner: Option, /// The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(alias="timeLinked")] pub time_linked: Option, } @@ -2048,23 +2167,31 @@ impl ChannelContentOwnerDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoProcessingDetails { /// This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request. + #[serde(alias="fileDetailsAvailability")] pub file_details_availability: Option, /// This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(alias="editorSuggestionsAvailability")] pub editor_suggestions_availability: Option, /// The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed. + #[serde(alias="processingStatus")] pub processing_status: Option, /// This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(alias="processingIssuesAvailability")] pub processing_issues_availability: Option, /// The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed. + #[serde(alias="processingFailureReason")] pub processing_failure_reason: Option, /// This value indicates whether thumbnail images have been generated for the video. + #[serde(alias="thumbnailsAvailability")] pub thumbnails_availability: Option, /// The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing. + #[serde(alias="processingProgress")] pub processing_progress: Option, /// This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(alias="tagSuggestionsAvailability")] pub tag_suggestions_availability: Option, } @@ -2096,15 +2223,19 @@ impl VideoProcessingDetails { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveBroadcastStatus { /// The broadcast's recording status. + #[serde(alias="recordingStatus")] pub recording_status: Option, /// The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource. + #[serde(alias="privacyStatus")] pub privacy_status: Option, /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. + #[serde(alias="lifeCycleStatus")] pub life_cycle_status: Option, /// Priority of the live broadcast event (internal state). + #[serde(alias="liveBroadcastPriority")] pub live_broadcast_priority: Option, } @@ -2132,13 +2263,16 @@ impl LiveBroadcastStatus { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SubscriptionContentDetails { /// The number of new items in the subscription since its content was last read. + #[serde(alias="newItemCount")] pub new_item_count: Option, /// The type of activity this subscription is for (only uploads, everything). + #[serde(alias="activityType")] pub activity_type: Option, /// The approximate number of items that the subscription points to. + #[serde(alias="totalItemCount")] pub total_item_count: Option, } @@ -2175,27 +2309,32 @@ impl SubscriptionContentDetails { /// * [update videos](struct.VideoUpdateMethodBuilder.html) (request|response) /// * [delete videos](struct.VideoDeleteMethodBuilder.html) (none) /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Video { /// The status object contains information about the video's uploading, processing, and privacy statuses. pub status: Option, /// The topicDetails object encapsulates information about Freebase topics associated with the video. + #[serde(alias="topicDetails")] pub topic_details: Option, /// The monetizationDetails object encapsulates information about the monetization status of the video. + #[serde(alias="monetizationDetails")] pub monetization_details: Option, /// The suggestions object encapsulates suggestions that identify opportunities to improve the video quality or the metadata for the uploaded video. This data can only be retrieved by the video owner. pub suggestions: Option, /// Age restriction details related to a video. + #[serde(alias="ageGating")] pub age_gating: Option, /// The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner. + #[serde(alias="fileDetails")] pub file_details: Option, /// The player object contains information that you would use to play the video in an embedded player. pub player: Option, /// The ID that YouTube uses to uniquely identify the video. pub id: Option, /// List with all localizations. - pub localizations: HashMap, + pub localizations: Option>, /// The liveStreamingDetails object contains metadata about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast. + #[serde(alias="liveStreamingDetails")] pub live_streaming_details: Option, /// The snippet object contains basic details about the video, such as its title, description, and category. pub snippet: Option, @@ -2204,18 +2343,23 @@ pub struct Video { /// The statistics object contains statistics about the video. pub statistics: Option, /// The projectDetails object contains information about the project specific video metadata. + #[serde(alias="projectDetails")] pub project_details: Option, /// The conversionPings object encapsulates information about url pings that need to be respected by the App in different video contexts. + #[serde(alias="conversionPings")] pub conversion_pings: Option, /// The processingProgress object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video. /// /// The processingProgress object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner. + #[serde(alias="processingDetails")] pub processing_details: Option, /// Etag of this resource. pub etag: Option, /// The contentDetails object contains information about the video content, including the length of the video and its aspect ratio. + #[serde(alias="contentDetails")] pub content_details: Option, /// The recordingDetails object encapsulates information about the location, date and address where the video was recorded. + #[serde(alias="recordingDetails")] pub recording_details: Option, } @@ -2237,7 +2381,7 @@ impl Video { if self.file_details.is_some() { r = r + "fileDetails,"; } if self.player.is_some() { r = r + "player,"; } if self.id.is_some() { r = r + "id,"; } - if self.localizations.len() > 0 { r = r + "localizations,"; } + if self.localizations.is_some() { r = r + "localizations,"; } if self.live_streaming_details.is_some() { r = r + "liveStreamingDetails,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } @@ -2257,7 +2401,7 @@ impl Video { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GeoPoint { /// Latitude in degrees. pub latitude: Option, @@ -2290,7 +2434,7 @@ impl GeoPoint { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelBrandingSettings { /// Branding properties for branding images. pub image: Option, @@ -2299,7 +2443,7 @@ pub struct ChannelBrandingSettings { /// Branding properties for the channel view. pub channel: Option, /// Additional experimental branding properties. - pub hints: Vec, + pub hints: Option>, } impl Part for ChannelBrandingSettings {} @@ -2316,7 +2460,7 @@ impl ChannelBrandingSettings { if self.image.is_some() { r = r + "image,"; } if self.watch.is_some() { r = r + "watch,"; } if self.channel.is_some() { r = r + "channel,"; } - if self.hints.len() > 0 { r = r + "hints,"; } + if self.hints.is_some() { r = r + "hints,"; } r.pop(); r } @@ -2326,9 +2470,10 @@ impl ChannelBrandingSettings { /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(Default, Clone, Debug, RustcEncodable, RustcDecodable)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoPlayer { /// An