From 2531011fc579df4edc38b15de459c135975fa077 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 10 Mar 2015 11:55:11 +0100 Subject: [PATCH] fix(resource): now with flattened activities That way, we don't have recursive method builders, but instead flatten the hierarchy. In our case, this is easier and means less to type. E.g. `hub.user().message().import(...)` now is `hub.user().message_import(...)` In go it would look like this though `hub.user.messages.import(...) which is neater. We will never have that though, as it will initialize a massive amount of data right on the stack, even though only some of it is ever used ... . --- gen/youtube3/README.md | 14 +- gen/youtube3/src/lib.rs | 798 +++++++++++++++++++-------------------- src/mako/lib/lib.mako | 2 +- src/mako/lib/mbuild.mako | 11 +- src/mako/lib/util.py | 10 +- 5 files changed, 424 insertions(+), 411 deletions(-) diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 6be2ab1876b..bf12382d73e 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -54,13 +54,13 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.live_broadcasts().control(...).doit() -let r = hub.live_broadcasts().insert(...).doit() -let r = hub.live_broadcasts().list(...).doit() -let r = hub.live_broadcasts().transition(...).doit() -let r = hub.live_broadcasts().update(...).doit() -let r = hub.live_broadcasts().delete(...).doit() -let r = hub.live_broadcasts().bind(...).doit() +let r = hub.live_broadcast().control(...).doit() +let r = hub.live_broadcast().insert(...).doit() +let r = hub.live_broadcast().list(...).doit() +let r = hub.live_broadcast().transition(...).doit() +let r = hub.live_broadcast().update(...).doit() +let r = hub.live_broadcast().delete(...).doit() +let r = hub.live_broadcast().bind(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index dcea51183d1..bf7bd91707c 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -51,13 +51,13 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.live_broadcasts().control(...).doit() -//! let r = hub.live_broadcasts().insert(...).doit() -//! let r = hub.live_broadcasts().list(...).doit() -//! let r = hub.live_broadcasts().transition(...).doit() -//! let r = hub.live_broadcasts().update(...).doit() -//! let r = hub.live_broadcasts().delete(...).doit() -//! let r = hub.live_broadcasts().bind(...).doit() +//! let r = hub.live_broadcast().control(...).doit() +//! let r = hub.live_broadcast().insert(...).doit() +//! let r = hub.live_broadcast().list(...).doit() +//! let r = hub.live_broadcast().transition(...).doit() +//! let r = hub.live_broadcast().update(...).doit() +//! let r = hub.live_broadcast().delete(...).doit() +//! let r = hub.live_broadcast().bind(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -254,55 +254,55 @@ impl<'a, C, NC, A> YouTube } } - pub fn activities(&'a self) -> ActivityMethodsBuilder<'a, C, NC, A> { + pub fn activity(&'a self) -> ActivityMethodsBuilder<'a, C, NC, A> { ActivityMethodsBuilder { hub: &self } } - pub fn channel_banners(&'a self) -> ChannelBannerMethodsBuilder<'a, C, NC, A> { + pub fn channel_banner(&'a self) -> ChannelBannerMethodsBuilder<'a, C, NC, A> { ChannelBannerMethodsBuilder { hub: &self } } - pub fn channel_sections(&'a self) -> ChannelSectionMethodsBuilder<'a, C, NC, A> { + pub fn channel_section(&'a self) -> ChannelSectionMethodsBuilder<'a, C, NC, A> { ChannelSectionMethodsBuilder { hub: &self } } - pub fn channels(&'a self) -> ChannelMethodsBuilder<'a, C, NC, A> { + pub fn channel(&'a self) -> ChannelMethodsBuilder<'a, C, NC, A> { ChannelMethodsBuilder { hub: &self } } - pub fn guide_categories(&'a self) -> GuideCategoryMethodsBuilder<'a, C, NC, A> { + pub fn guide_category(&'a self) -> GuideCategoryMethodsBuilder<'a, C, NC, A> { GuideCategoryMethodsBuilder { hub: &self } } - pub fn i18n_languages(&'a self) -> I18nLanguageMethodsBuilder<'a, C, NC, A> { + pub fn i18n_language(&'a self) -> I18nLanguageMethodsBuilder<'a, C, NC, A> { I18nLanguageMethodsBuilder { hub: &self } } - pub fn i18n_regions(&'a self) -> I18nRegionMethodsBuilder<'a, C, NC, A> { + pub fn i18n_region(&'a self) -> I18nRegionMethodsBuilder<'a, C, NC, A> { I18nRegionMethodsBuilder { hub: &self } } - pub fn live_broadcasts(&'a self) -> LiveBroadcastMethodsBuilder<'a, C, NC, A> { + pub fn live_broadcast(&'a self) -> LiveBroadcastMethodsBuilder<'a, C, NC, A> { LiveBroadcastMethodsBuilder { hub: &self } } - pub fn live_streams(&'a self) -> LiveStreamMethodsBuilder<'a, C, NC, A> { + pub fn live_stream(&'a self) -> LiveStreamMethodsBuilder<'a, C, NC, A> { LiveStreamMethodsBuilder { hub: &self } } - pub fn playlist_items(&'a self) -> PlaylistItemMethodsBuilder<'a, C, NC, A> { + pub fn playlist_item(&'a self) -> PlaylistItemMethodsBuilder<'a, C, NC, A> { PlaylistItemMethodsBuilder { hub: &self } } - pub fn playlists(&'a self) -> PlaylistMethodsBuilder<'a, C, NC, A> { + pub fn playlist(&'a self) -> PlaylistMethodsBuilder<'a, C, NC, A> { PlaylistMethodsBuilder { hub: &self } } pub fn search(&'a self) -> SearchMethodsBuilder<'a, C, NC, A> { SearchMethodsBuilder { hub: &self } } - pub fn subscriptions(&'a self) -> SubscriptionMethodsBuilder<'a, C, NC, A> { + pub fn subscription(&'a self) -> SubscriptionMethodsBuilder<'a, C, NC, A> { SubscriptionMethodsBuilder { hub: &self } } - pub fn thumbnails(&'a self) -> ThumbnailMethodsBuilder<'a, C, NC, A> { + pub fn thumbnail(&'a self) -> ThumbnailMethodsBuilder<'a, C, NC, A> { ThumbnailMethodsBuilder { hub: &self } } - pub fn video_categories(&'a self) -> VideoCategoryMethodsBuilder<'a, C, NC, A> { + pub fn video_category(&'a self) -> VideoCategoryMethodsBuilder<'a, C, NC, A> { VideoCategoryMethodsBuilder { hub: &self } } - pub fn videos(&'a self) -> VideoMethodsBuilder<'a, C, NC, A> { + pub fn video(&'a self) -> VideoMethodsBuilder<'a, C, NC, A> { VideoMethodsBuilder { hub: &self } } - pub fn watermarks(&'a self) -> WatermarkMethodsBuilder<'a, C, NC, A> { + pub fn watermark(&'a self) -> WatermarkMethodsBuilder<'a, C, NC, A> { WatermarkMethodsBuilder { hub: &self } } } @@ -318,7 +318,7 @@ impl<'a, C, NC, A> YouTube #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoConversionPings { /// Pings that the app shall fire for a video (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 ping: Vec, } impl Part for VideoConversionPings {} @@ -345,7 +345,7 @@ pub struct SubscriptionListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of subscriptions that match the request criteria. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -395,7 +395,7 @@ pub struct LiveBroadcastSnippet { /// 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. 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, + pub thumbnail: Option, } impl Part for LiveBroadcastSnippet {} @@ -408,7 +408,7 @@ impl Part for LiveBroadcastSnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoFileDetails { /// The uploaded video file's combined (video and audio) bitrate in bits per second. - pub bitrate_bps: Option, + pub bitrate_bp: 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. @@ -421,15 +421,15 @@ pub struct VideoFileDetails { /// - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM pub creation_time: Option, /// The length of the uploaded video in milliseconds. - pub duration_ms: Option, + pub duration_m: Option, /// The uploaded file's name. This field is present whether a video file or another type of file was uploaded. 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. 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, + pub video_stream: Vec, /// 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, + pub audio_stream: Vec, } impl Part for VideoFileDetails {} @@ -475,11 +475,11 @@ impl Part for PlaylistLocalization {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct Playlist { /// The status object contains status information for the playlist. - pub status: Option, + pub statu: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlist". pub kind: Option, /// The contentDetails object contains information like video count. - pub content_details: Option, + pub content_detail: Option, /// The snippet object contains basic details about the playlist, such as its title and description. pub snippet: Option, /// The player object contains information that you would use to play the playlist in an embedded player. @@ -489,7 +489,7 @@ pub struct Playlist { /// The ID that YouTube uses to uniquely identify the playlist. pub id: Option, /// Localizations for different languages - pub localizations: HashMap, + pub localization: HashMap, } impl RequestValue for Playlist {} @@ -502,14 +502,14 @@ impl Playlist { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } + if self.statu.is_some() { r = r + "status,"; } if self.kind.is_some() { r = r + "kind,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.player.is_some() { r = r + "player,"; } if self.etag.is_some() { r = r + "etag,"; } if self.id.is_some() { r = r + "id,"; } - if self.localizations.len() > 0 { r = r + "localizations,"; } + if self.localization.len() > 0 { r = r + "localizations,"; } r.pop(); r } @@ -536,7 +536,7 @@ pub struct PlaylistItemListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of playlist items that match the request criteria. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -572,11 +572,11 @@ impl Part for PropertyValue {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] 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. - pub offset_ms: Option, + pub offset_m: 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. pub type_: Option, /// Defines the duration in milliseconds for which the promotion should be displayed. If missing, the client should use the default. - pub duration_ms: Option, + pub duration_m: Option, } impl Part for InvideoTiming {} @@ -591,7 +591,7 @@ pub struct PlaylistSnippet { /// The playlist's description. pub description: Option, /// Keyword tags associated with the playlist. - pub tags: Vec, + pub tag: Vec, /// The ID that YouTube uses to uniquely identify the channel that published the playlist. 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. @@ -605,7 +605,7 @@ pub struct PlaylistSnippet { /// Localized title and description, read-only. pub localized: Option, /// A map of thumbnail images associated with the playlist. 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, + pub thumbnail: Option, } impl Part for PlaylistSnippet {} @@ -646,7 +646,7 @@ impl Part for ChannelAuditDetails {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct LiveStream { /// The status object contains information about live stream's status. - pub status: Option, + pub statu: Option, /// The snippet object contains basic details about the stream, including its channel, title, and description. pub snippet: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveStream". @@ -654,7 +654,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. - pub content_details: Option, + pub content_detail: 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, /// The ID that YouTube assigns to uniquely identify the stream. @@ -671,11 +671,11 @@ impl LiveStream { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } + if self.statu.is_some() { r = r + "status,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } if self.etag.is_some() { r = r + "etag,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } if self.cdn.is_some() { r = r + "cdn,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); @@ -698,7 +698,7 @@ pub struct ThumbnailSetResponse { /// Serialized EventId of the request which produced this response. pub event_id: Option, /// A list of thumbnails. - pub items: Vec, + pub item: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#thumbnailSetResponse". pub kind: Option, /// Etag of this resource. @@ -734,7 +734,7 @@ pub struct ChannelSettings { /// 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. - pub moderate_comments: Option, + pub moderate_comment: Option, /// Whether the tab to browse the videos should be displayed. pub show_browse_view: Option, /// Title for the featured channels tab. @@ -744,15 +744,15 @@ pub struct ChannelSettings { /// The trailer of the channel, for users that are not subscribers. pub unsubscribed_trailer: Option, /// The list of featured channels. - pub featured_channels_urls: Vec, + pub featured_channels_url: Vec, /// A prominent color that can be rendered on this channel page. pub profile_color: Option, /// Which content tab users should see when viewing the channel. pub default_tab: Option, /// Lists keywords associated with the channel, comma-separated. - pub keywords: Option, + pub keyword: Option, /// Whether related channels should be proposed. - pub show_related_channels: Option, + pub show_related_channel: Option, /// The ID for a Google Analytics account to track and measure traffic to the channels. pub tracking_analytics_account_id: Option, } @@ -813,7 +813,7 @@ pub struct VideoGetRatingResponse { /// Serialized EventId of the request which produced this response. pub event_id: Option, /// A list of ratings that match the request criteria. - pub items: Vec, + pub item: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". pub kind: Option, /// Etag of this resource. @@ -877,7 +877,7 @@ impl Part for I18nLanguageSnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct SubscriptionSnippet { /// 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, + pub thumbnail: Option, /// The subscription's title. pub title: Option, /// The id object contains information about the channel that the user subscribed to. @@ -902,9 +902,9 @@ impl Part for SubscriptionSnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct ChannelSectionContentDetails { /// The channel ids for type multiple_channels. - pub channels: Vec, + pub channel: Vec, /// The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed. - pub playlists: Vec, + pub playlist: Vec, } impl Part for ChannelSectionContentDetails {} @@ -925,7 +925,7 @@ pub struct I18nRegionListResponse { /// Serialized EventId of the request which produced this response. 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 item: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegionListResponse". pub kind: Option, /// Etag of this resource. @@ -958,7 +958,7 @@ pub struct LiveStreamListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of live streams that match the request criteria. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -1004,7 +1004,7 @@ pub struct ChannelBrandingSettings { /// Branding properties for the channel view. pub channel: Option, /// Additional experimental branding properties. - pub hints: Vec, + pub hint: Vec, } impl Part for ChannelBrandingSettings {} @@ -1031,7 +1031,7 @@ pub struct PlaylistListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of playlists that match the request criteria. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -1066,7 +1066,7 @@ pub struct InvideoBranding { /// no description provided pub timing: Option, /// no description provided - pub image_bytes: Option, + pub image_byte: Option, } impl RequestValue for InvideoBranding {} @@ -1081,7 +1081,7 @@ impl InvideoBranding { if self.position.is_some() { r = r + "position,"; } if self.image_url.is_some() { r = r + "imageUrl,"; } if self.timing.is_some() { r = r + "timing,"; } - if self.image_bytes.is_some() { r = r + "imageBytes,"; } + if self.image_byte.is_some() { r = r + "imageBytes,"; } r.pop(); r } @@ -1094,7 +1094,7 @@ impl InvideoBranding { #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct PlaylistItemStatus { /// This resource's privacy status. - pub privacy_status: Option, + pub privacy_statu: Option, } impl Part for PlaylistItemStatus {} @@ -1124,7 +1124,7 @@ pub struct InvideoPromotion { /// The default temporal position within the video where the promoted item will be displayed. Can be overriden by more specific timing in the item. pub default_timing: Option, /// List of promoted items in decreasing priority. - pub items: Vec, + pub item: Vec, /// Indicates whether the channel's promotional campaign uses "smart timing." This feature attempts to show promotions at a point in the video when they are more likely to be clicked and less likely to disrupt the viewing experience. This feature also picks up a single promotion to show on each video. pub use_smart_timing: Option, /// The spatial position within the video where the promoted item will be displayed. @@ -1159,7 +1159,7 @@ impl Part for InvideoPromotion {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct PlaylistItem { /// The status object contains information about the playlist item's privacy status. - pub status: Option, + pub statu: Option, /// The snippet object contains basic details about the playlist item, such as its title and position in the playlist. pub snippet: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistItem". @@ -1167,7 +1167,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. - pub content_details: Option, + pub content_detail: Option, /// The ID that YouTube uses to uniquely identify the playlist item. pub id: Option, } @@ -1182,11 +1182,11 @@ impl PlaylistItem { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } + if self.statu.is_some() { r = r + "status,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } if self.etag.is_some() { r = r + "etag,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); r @@ -1214,7 +1214,7 @@ pub struct GuideCategoryListResponse { /// The visitorId identifies the visitor. 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 item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -1275,7 +1275,7 @@ impl Part for ChannelSectionSnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct ChannelContentDetails { /// no description provided - pub related_playlists: HashMap, + pub related_playlist: HashMap, /// The googlePlusUserId object identifies the Google+ profile ID associated with this channel. pub google_plus_user_id: Option, } @@ -1325,7 +1325,7 @@ pub struct ThumbnailDetails { /// The medium quality image for this resource. pub medium: Option, /// The maximum resolution quality image for this resource. - pub maxres: Option, + pub maxre: Option, /// The standard quality image for this resource. pub standard: Option, } @@ -1340,7 +1340,7 @@ impl Part for ThumbnailDetails {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoMonetizationDetails { /// The value of access indicates whether the video can be monetized or not. - pub access: Option, + pub acces: Option, } impl Part for VideoMonetizationDetails {} @@ -1400,7 +1400,7 @@ impl Part for ActivityContentDetailsSubscription {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] 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 ping: Vec, } impl Part for ChannelConversionPings {} @@ -1490,7 +1490,7 @@ pub struct VideoProcessingDetails { /// 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. 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. - pub processing_status: Option, + pub processing_statu: 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. 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. @@ -1498,7 +1498,7 @@ pub struct VideoProcessingDetails { /// This value indicates whether thumbnail images have been generated for the video. 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. - pub processing_progress: Option, + pub processing_progres: 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. pub tag_suggestions_availability: Option, } @@ -1513,11 +1513,11 @@ impl Part for VideoProcessingDetails {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct LiveBroadcastStatus { /// The broadcast's recording status. - pub recording_status: Option, + pub recording_statu: 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. - pub privacy_status: Option, + pub privacy_statu: Option, /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. - pub life_cycle_status: Option, + pub life_cycle_statu: Option, /// Priority of the live broadcast event (internal state). pub live_broadcast_priority: Option, } @@ -1560,45 +1560,45 @@ impl Part for SubscriptionContentDetails {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct Video { /// The status object contains information about the video's uploading, processing, and privacy statuses. - pub status: Option, + pub statu: Option, /// The topicDetails object encapsulates information about Freebase topics associated with the video. - pub topic_details: Option, + pub topic_detail: Option, /// The monetizationDetails object encapsulates information about the monetization status of the video. - pub monetization_details: Option, + pub monetization_detail: 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, + pub suggestion: Option, /// Age restriction details related to a video. 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. - pub file_details: Option, + pub file_detail: 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 localization: HashMap, /// 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. - pub live_streaming_details: Option, + pub live_streaming_detail: 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. - pub processing_details: Option, + pub processing_detail: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#video". pub kind: Option, /// The statistics object contains statistics about the video. - pub statistics: Option, + pub statistic: Option, /// The contentDetails object contains information about the video content, including the length of the video and its aspect ratio. - pub content_details: Option, + pub content_detail: Option, /// The conversionPings object encapsulates information about url pings that need to be respected by the App in different video contexts. - pub conversion_pings: Option, + pub conversion_ping: Option, /// The snippet object contains basic details about the video, such as its title, description, and category. pub snippet: Option, /// Etag of this resource. pub etag: Option, /// The projectDetails object contains information about the project specific video metadata. - pub project_details: Option, + pub project_detail: Option, /// The recordingDetails object encapsulates information about the location, date and address where the video was recorded. - pub recording_details: Option, + pub recording_detail: Option, } impl RequestValue for Video {} @@ -1611,25 +1611,25 @@ impl Video { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } - if self.topic_details.is_some() { r = r + "topicDetails,"; } - if self.monetization_details.is_some() { r = r + "monetizationDetails,"; } - if self.suggestions.is_some() { r = r + "suggestions,"; } + if self.statu.is_some() { r = r + "status,"; } + if self.topic_detail.is_some() { r = r + "topicDetails,"; } + if self.monetization_detail.is_some() { r = r + "monetizationDetails,"; } + if self.suggestion.is_some() { r = r + "suggestions,"; } if self.age_gating.is_some() { r = r + "ageGating,"; } - if self.file_details.is_some() { r = r + "fileDetails,"; } + if self.file_detail.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.live_streaming_details.is_some() { r = r + "liveStreamingDetails,"; } - if self.processing_details.is_some() { r = r + "processingDetails,"; } + if self.localization.len() > 0 { r = r + "localizations,"; } + if self.live_streaming_detail.is_some() { r = r + "liveStreamingDetails,"; } + if self.processing_detail.is_some() { r = r + "processingDetails,"; } if self.kind.is_some() { r = r + "kind,"; } - if self.statistics.is_some() { r = r + "statistics,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } - if self.conversion_pings.is_some() { r = r + "conversionPings,"; } + if self.statistic.is_some() { r = r + "statistics,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } + if self.conversion_ping.is_some() { r = r + "conversionPings,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.etag.is_some() { r = r + "etag,"; } - if self.project_details.is_some() { r = r + "projectDetails,"; } - if self.recording_details.is_some() { r = r + "recordingDetails,"; } + if self.project_detail.is_some() { r = r + "projectDetails,"; } + if self.recording_detail.is_some() { r = r + "recordingDetails,"; } r.pop(); r } @@ -1691,7 +1691,7 @@ pub struct ChannelSnippet { /// The date and time that the channel was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. pub published_at: Option, /// A map of thumbnail images associated with the channel. 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, + pub thumbnail: Option, /// The channel's title. pub title: Option, /// Localized title and description, read-only. @@ -1805,7 +1805,7 @@ pub struct Subscription { /// Etag of this resource. pub etag: Option, /// The contentDetails object contains basic statistics about the subscription. - pub content_details: Option, + pub content_detail: Option, /// The subscriberSnippet object contains basic details about the sbuscriber. pub subscriber_snippet: Option, /// The ID that YouTube uses to uniquely identify the subscription. @@ -1825,7 +1825,7 @@ impl Subscription { if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } if self.etag.is_some() { r = r + "etag,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } if self.subscriber_snippet.is_some() { r = r + "subscriberSnippet,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); @@ -1917,7 +1917,7 @@ pub struct VideoSnippet { /// The video's description. pub description: Option, /// A list of keyword tags associated with the video. Tags may contain spaces. This field is only visible to the video's uploader. - pub tags: Vec, + pub tag: Vec, /// The ID that YouTube uses to uniquely identify the channel that the video was uploaded to. pub channel_id: Option, /// The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. @@ -1927,7 +1927,7 @@ pub struct VideoSnippet { /// The language of the videos's default snippet. pub default_language: 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, + pub thumbnail: Option, /// The video's title. pub title: Option, /// The YouTube video category associated with the video. @@ -1948,7 +1948,7 @@ impl Part for VideoSnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoProjectDetails { /// A list of project tags associated with the video during the upload. - pub tags: Vec, + pub tag: Vec, } impl Part for VideoProjectDetails {} @@ -1987,7 +1987,7 @@ pub struct LiveBroadcastContentDetails { /// This setting indicates whether the broadcast video can be played in an embedded player. If you choose to archive the video (using the enableArchive property), this setting will also apply to the archived video. pub enable_embed: Option, /// This setting indicates whether closed captioning is enabled for this broadcast. The ingestion URL of the closed captions is returned through the liveStreams API. - pub enable_closed_captions: Option, + pub enable_closed_caption: Option, /// This setting indicates whether YouTube should enable content encryption for the broadcast. pub enable_content_encryption: Option, /// Automatically start recording after the event goes live. The default value for this property is true. @@ -2020,13 +2020,13 @@ pub struct VideoStatus { /// This value indicates if the video can be embedded on another website. pub embeddable: Option, /// The video's privacy status. - pub privacy_status: Option, + pub privacy_statu: Option, /// The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. pub publish_at: Option, /// This value indicates if the extended video statistics on the watch page can be viewed by everyone. Note that the view count, likes, etc will still be visible if this is disabled. pub public_stats_viewable: Option, /// The status of the uploaded video. - pub upload_status: Option, + pub upload_statu: Option, /// This value explains why YouTube rejected an uploaded video. This property is only present if the uploadStatus property indicates that the upload was rejected. pub rejection_reason: Option, /// This value explains why a video failed to upload. This property is only present if the uploadStatus property indicates that the upload failed. @@ -2070,7 +2070,7 @@ pub struct ChannelSectionListResponse { /// Serialized EventId of the request which produced this response. pub event_id: Option, /// A list of ChannelSections that match the request criteria. - pub items: Vec, + pub item: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#channelSectionListResponse". pub kind: Option, /// Etag of this resource. @@ -2089,7 +2089,7 @@ impl ResponseResult for ChannelSectionListResponse {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct MonitorStreamInfo { /// If you have set the enableMonitorStream property to true, then this property determines the length of the live broadcast delay. - pub broadcast_stream_delay_ms: Option, + pub broadcast_stream_delay_m: Option, /// HTML code that embeds a player that plays the monitor stream. pub embed_html: Option, /// This value determines whether the monitor stream is enabled for the broadcast. If the monitor stream is enabled, then YouTube will broadcast the event content on a special stream intended only for the broadcaster's consumption. The broadcaster can use the stream to review the event content and also to identify the optimal times to insert cuepoints. @@ -2118,7 +2118,7 @@ pub struct I18nLanguageListResponse { /// Serialized EventId of the request which produced this response. pub event_id: Option, /// A list of supported i18n languages. In this map, the i18n language ID is the map key, and its value is the corresponding i18nLanguage resource. - pub items: Vec, + pub item: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nLanguageListResponse". pub kind: Option, /// Etag of this resource. @@ -2166,7 +2166,7 @@ impl Part for LocalizedProperty {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct LiveBroadcast { /// The status object contains information about the event's status. - pub status: Option, + pub statu: Option, /// The snippet object contains basic details about the event, including its title, description, start time, and end time. pub snippet: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveBroadcast". @@ -2174,7 +2174,7 @@ pub struct LiveBroadcast { /// Etag of this resource. pub etag: Option, /// The contentDetails object contains information about the event's video content, such as whether the content can be shown in an embedded video player or if it will be archived and therefore available for viewing after the event has concluded. - pub content_details: Option, + pub content_detail: Option, /// The ID that YouTube assigns to uniquely identify the broadcast. pub id: Option, } @@ -2189,11 +2189,11 @@ impl LiveBroadcast { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } + if self.statu.is_some() { r = r + "status,"; } if self.snippet.is_some() { r = r + "snippet,"; } if self.kind.is_some() { r = r + "kind,"; } if self.etag.is_some() { r = r + "etag,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } if self.id.is_some() { r = r + "id,"; } r.pop(); r @@ -2207,21 +2207,21 @@ impl LiveBroadcast { #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoFileDetailsVideoStream { /// The video stream's bitrate, in bits per second. - pub bitrate_bps: Option, + pub bitrate_bp: Option, /// A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code. pub vendor: Option, /// The video codec that the stream uses. pub codec: Option, /// The encoded video content's width in pixels. You can calculate the video's encoding aspect ratio as width_pixels / height_pixels. - pub width_pixels: Option, + pub width_pixel: Option, /// The encoded video content's height in pixels. - pub height_pixels: Option, + pub height_pixel: Option, /// The video content's display aspect ratio, which specifies the aspect ratio in which the video should be displayed. pub aspect_ratio: Option, /// The amount that YouTube needs to rotate the original source content to properly display the video. pub rotation: Option, /// The video stream's frame rate, in frames per second. - pub frame_rate_fps: Option, + pub frame_rate_fp: Option, } impl Part for VideoFileDetailsVideoStream {} @@ -2264,33 +2264,33 @@ impl Resource for Thumbnail {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct Channel { /// The status object encapsulates information about the privacy status of the channel. - pub status: Option, + pub statu: Option, /// The invideoPromotion object encapsulates information about promotion campaign associated with the channel. pub invideo_promotion: Option, /// Identifies what kind of resource this is. Value: the fixed string "youtube#channel". pub kind: Option, /// The statistics object encapsulates statistics for the channel. - pub statistics: Option, + pub statistic: Option, /// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. - pub content_owner_details: Option, + pub content_owner_detail: Option, /// The topicDetails object encapsulates information about Freebase topics associated with the channel. - pub topic_details: Option, + pub topic_detail: Option, /// The contentDetails object encapsulates information about the channel's content. - pub content_details: Option, + pub content_detail: Option, /// The brandingSettings object encapsulates information about the branding of the channel. - pub branding_settings: Option, + pub branding_setting: Option, /// The conversionPings object encapsulates information about conversion pings that need to be respected by the channel. - pub conversion_pings: Option, + pub conversion_ping: Option, /// The snippet object contains basic details about the channel, such as its title, description, and thumbnail images. pub snippet: Option, /// The auditionDetails object encapsulates channel data that is relevant for YouTube Partners during the audition process. - pub audit_details: Option, + pub audit_detail: Option, /// Etag of this resource. pub etag: Option, /// The ID that YouTube uses to uniquely identify the channel. pub id: Option, /// Localizations for different languages - pub localizations: HashMap, + pub localization: HashMap, } impl RequestValue for Channel {} @@ -2303,20 +2303,20 @@ impl Channel { /// the parts you want to see in the server response. fn to_parts(&self) -> String { let mut r = String::new(); - if self.status.is_some() { r = r + "status,"; } + if self.statu.is_some() { r = r + "status,"; } if self.invideo_promotion.is_some() { r = r + "invideoPromotion,"; } if self.kind.is_some() { r = r + "kind,"; } - if self.statistics.is_some() { r = r + "statistics,"; } - if self.content_owner_details.is_some() { r = r + "contentOwnerDetails,"; } - if self.topic_details.is_some() { r = r + "topicDetails,"; } - if self.content_details.is_some() { r = r + "contentDetails,"; } - if self.branding_settings.is_some() { r = r + "brandingSettings,"; } - if self.conversion_pings.is_some() { r = r + "conversionPings,"; } + if self.statistic.is_some() { r = r + "statistics,"; } + if self.content_owner_detail.is_some() { r = r + "contentOwnerDetails,"; } + if self.topic_detail.is_some() { r = r + "topicDetails,"; } + if self.content_detail.is_some() { r = r + "contentDetails,"; } + if self.branding_setting.is_some() { r = r + "brandingSettings,"; } + if self.conversion_ping.is_some() { r = r + "conversionPings,"; } if self.snippet.is_some() { r = r + "snippet,"; } - if self.audit_details.is_some() { r = r + "auditDetails,"; } + if self.audit_detail.is_some() { r = r + "auditDetails,"; } if self.etag.is_some() { r = r + "etag,"; } if self.id.is_some() { r = r + "id,"; } - if self.localizations.len() > 0 { r = r + "localizations,"; } + if self.localization.len() > 0 { r = r + "localizations,"; } r.pop(); r } @@ -2438,7 +2438,7 @@ pub struct VideoCategoryListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of video categories that can be associated with YouTube videos. In this map, the video category ID is the map key, and its value is the corresponding videoCategory resource. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -2459,7 +2459,7 @@ impl ResponseResult for VideoCategoryListResponse {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct ActivitySnippet { /// A map of thumbnail images associated with the resource that is primarily associated with the activity. 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, + pub thumbnail: Option, /// The title of the resource primarily associated with the activity. pub title: Option, /// The ID that YouTube uses to uniquely identify the channel associated with the activity. @@ -2486,7 +2486,7 @@ impl Part for ActivitySnippet {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoProcessingDetailsProcessingProgress { /// An estimate of the amount of time, in millseconds, that YouTube needs to finish processing the video. - pub time_left_ms: Option, + pub time_left_m: Option, /// The number of parts of the video that YouTube has already processed. You can estimate the percentage of the video that YouTube has already processed by calculating: /// 100 * parts_processed / parts_total /// @@ -2520,7 +2520,7 @@ pub struct SearchListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of results that match the search criteria. - pub items: Vec, + pub item: Vec, /// no description provided pub token_pagination: Option, /// Etag of this resource. @@ -2541,7 +2541,7 @@ impl ResponseResult for SearchListResponse {} #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct ChannelTopicDetails { /// A list of Freebase topic IDs associated with the channel. You can retrieve information about each topic using the Freebase Topic API. - pub topic_ids: Vec, + pub topic_id: Vec, } impl Part for ChannelTopicDetails {} @@ -2568,7 +2568,7 @@ pub struct VideoListResponse { /// The visitorId identifies the visitor. pub visitor_id: Option, /// A list of videos that match the request criteria. - pub items: Vec