From 712fed578a377c27bd6153b098ee4b3244b0355e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 11 Mar 2015 17:07:07 +0100 Subject: [PATCH] feat(json): part 1 to implement 'any' type It is a Json object, with a schema as defined elsewhere. It's quite cool to see this (nearly) working already. However, it will require us to transitively assign the required markers which is based on information we don't currently have. Maybe implementing this could also help to simplify name-clash checks or make them better at least ? --- README.md | 2 - gen/youtube3/src/lib.rs | 3246 +++++++++++++++++++------------------- src/mako/lib/schema.mako | 85 +- src/mako/lib/util.py | 3 +- 4 files changed, 1679 insertions(+), 1657 deletions(-) diff --git a/README.md b/README.md index d33d744a29b..2f867ba808b 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,8 @@ The license of everything not explicitly under a different license are licensed What follows is a list of other material that is licensed differently. -* **./etc/bin/pyratemp.py** is licensed under MIT-like, as shown in [the header][pyratemp-header] of the file. * **./etc/api/\*\*/*.json** are licensed under a [MIT-like google license][google-lic]. [oauth]: https://crates.io/crates/yup-oauth2 -[pyratemp-header]: https://github.com/Byron/youtube-rs/blob/master/etc/bin/pyratemp.py [google-lic]: https://github.com/google/google-api-go-client/blob/master/LICENSE \ No newline at end of file diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 81c82792024..0d1661c72c8 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -321,10 +321,10 @@ impl<'a, C, NC, A> YouTube /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, + /// 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, } impl Part for VideoConversionPings {} @@ -340,26 +340,26 @@ impl Part for VideoConversionPings {} /// * [list](struct.SubscriptionListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct SubscriptionListResponse { - /// Serialized EventId of the request which produced this response. - 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. - 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. - pub visitor_id: Option, - /// A list of subscriptions that match the request criteria. - pub items: Vec, - /// no description provided - 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. - pub prev_page_token: Option, - /// no description provided - pub page_info: Option, + /// Serialized EventId of the request which produced this response. + 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. + 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. + pub visitor_id: Option, + /// A list of subscriptions that match the request criteria. + pub items: Vec, + /// no description provided + 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. + pub prev_page_token: Option, + /// no description provided + pub page_info: Option, } impl ResponseResult for SubscriptionListResponse {} @@ -369,10 +369,10 @@ impl ResponseResult for SubscriptionListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ActivityContentDetailsLike { - /// The resourceId object contains information that identifies the rated resource. - pub resource_id: Option, + /// The resourceId object contains information that identifies the rated resource. + pub resource_id: Option, } impl Part for ActivityContentDetailsLike {} @@ -382,26 +382,26 @@ impl Part for ActivityContentDetailsLike {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - 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. - 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. - 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. - 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. - 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. - 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, + /// 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. + 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. + 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. + 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. + 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. + 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. + 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, } impl Part for LiveBroadcastSnippet {} @@ -411,31 +411,31 @@ impl Part for LiveBroadcastSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoFileDetails { - /// The uploaded video file's combined (video and audio) bitrate in bits per second. - 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. - 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. - 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: + /// The uploaded video file's combined (video and audio) bitrate in bits per second. + 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. + 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. + 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 - pub creation_time: Option, - /// The length of the uploaded video in milliseconds. - pub duration_ms: 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, - /// 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 creation_time: Option, + /// The length of the uploaded video in milliseconds. + pub duration_ms: 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, + /// 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, } impl Part for VideoFileDetails {} @@ -445,12 +445,12 @@ impl Part for VideoFileDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistLocalization { - /// The localized strings for playlist's description. - pub description: Option, - /// The localized strings for playlist's title. - pub title: Option, + /// The localized strings for playlist's description. + pub description: Option, + /// The localized strings for playlist's title. + pub title: Option, } impl Part for PlaylistLocalization {} @@ -478,24 +478,24 @@ impl Part for PlaylistLocalization {} /// * [update](struct.PlaylistUpdateMethodBuilder.html) (request|response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct Playlist { - /// The status object contains status information for the playlist. - pub status: 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, - /// 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. - pub player: Option, - /// Etag of this resource. - pub etag: Option, - /// The ID that YouTube uses to uniquely identify the playlist. - pub id: Option, - /// Localizations for different languages - pub localizations: HashMap, + /// The status object contains status information for the playlist. + pub status: 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, + /// 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. + pub player: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube uses to uniquely identify the playlist. + pub id: Option, + /// Localizations for different languages + pub localizations: HashMap, } impl RequestValue for Playlist {} @@ -503,22 +503,22 @@ impl ResponseResult for Playlist {} impl cmn::Resource for Playlist {} impl Playlist { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// 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.kind.is_some() { r = r + "kind,"; } - if self.content_details.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,"; } - r.pop(); - r - } + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// 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.kind.is_some() { r = r + "kind,"; } + if self.content_details.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,"; } + r.pop(); + r + } } /// There is no detailed description. @@ -531,26 +531,26 @@ impl Playlist { /// * [list](struct.PlaylistItemListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistItemListResponse { - /// Serialized EventId of the request which produced this response. - 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. - 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. - pub visitor_id: Option, - /// A list of playlist items that match the request criteria. - pub items: Vec, - /// no description provided - 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. - pub prev_page_token: Option, - /// no description provided - pub page_info: Option, + /// Serialized EventId of the request which produced this response. + 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. + 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. + pub visitor_id: Option, + /// A list of playlist items that match the request criteria. + pub items: Vec, + /// no description provided + 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. + pub prev_page_token: Option, + /// no description provided + pub page_info: Option, } impl ResponseResult for PlaylistItemListResponse {} @@ -560,12 +560,12 @@ impl ResponseResult for PlaylistItemListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PropertyValue { - /// A property. - pub property: Option, - /// The property's value. - pub value: Option, + /// A property. + pub property: Option, + /// The property's value. + pub value: Option, } impl Part for PropertyValue {} @@ -575,14 +575,14 @@ impl Part for PropertyValue {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, - /// 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, + /// 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, + /// 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, } impl Part for InvideoTiming {} @@ -592,26 +592,26 @@ impl Part for InvideoTiming {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistSnippet { - /// The playlist's description. - pub description: Option, - /// Keyword tags associated with the playlist. - pub tags: 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. - pub published_at: Option, - /// The channel title of the channel that the video belongs to. - pub channel_title: Option, - /// The playlist's title. - pub title: Option, - /// The language of the playlist's default title and description. - pub default_language: Option, - /// 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, + /// The playlist's description. + pub description: Option, + /// Keyword tags associated with the playlist. + pub tags: 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. + pub published_at: Option, + /// The channel title of the channel that the video belongs to. + pub channel_title: Option, + /// The playlist's title. + pub title: Option, + /// The language of the playlist's default title and description. + pub default_language: Option, + /// 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, } impl Part for PlaylistSnippet {} @@ -621,16 +621,16 @@ impl Part for PlaylistSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelAuditDetails { - /// Whether or not the channel has any copyright strikes. - pub copyright_strikes_good_standing: Option, - /// Whether or not the channel respects the community guidelines. - pub community_guidelines_good_standing: Option, - /// Whether or not the channel has any unresolved claims. - 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. - pub overall_good_standing: Option, + /// Whether or not the channel has any copyright strikes. + pub copyright_strikes_good_standing: Option, + /// Whether or not the channel respects the community guidelines. + pub community_guidelines_good_standing: Option, + /// Whether or not the channel has any unresolved claims. + 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. + pub overall_good_standing: Option, } impl Part for ChannelAuditDetails {} @@ -649,22 +649,22 @@ impl Part for ChannelAuditDetails {} /// * [insert](struct.LiveStreamInsertMethodBuilder.html) (request|response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct LiveStream { - /// The status object contains information about live stream's status. - pub status: 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". - pub kind: Option, - /// 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, - /// 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. - pub id: Option, + /// The status object contains information about live stream's status. + pub status: 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". + pub kind: Option, + /// 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, + /// 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. + pub id: Option, } impl RequestValue for LiveStream {} @@ -672,21 +672,21 @@ impl ResponseResult for LiveStream {} impl cmn::Resource for LiveStream {} impl LiveStream { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// 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.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.cdn.is_some() { r = r + "cdn,"; } - if self.id.is_some() { r = r + "id,"; } - r.pop(); - r - } + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// 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.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.cdn.is_some() { r = r + "cdn,"; } + if self.id.is_some() { r = r + "id,"; } + r.pop(); + r + } } /// There is no detailed description. @@ -699,18 +699,18 @@ impl LiveStream { /// * [set](struct.ThumbnailSetMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ThumbnailSetResponse { - /// Serialized EventId of the request which produced this response. - pub event_id: Option, - /// A list of thumbnails. - pub items: Vec, - /// 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. - pub visitor_id: Option, + /// Serialized EventId of the request which produced this response. + pub event_id: Option, + /// A list of thumbnails. + pub items: Vec, + /// 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. + pub visitor_id: Option, } impl ResponseResult for ThumbnailSetResponse {} @@ -720,10 +720,10 @@ impl ResponseResult for ThumbnailSetResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ActivityContentDetailsUpload { - /// The ID that YouTube uses to uniquely identify the uploaded video. - pub video_id: Option, + /// The ID that YouTube uses to uniquely identify the uploaded video. + pub video_id: Option, } impl Part for ActivityContentDetailsUpload {} @@ -733,34 +733,34 @@ impl Part for ActivityContentDetailsUpload {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - pub moderate_comments: Option, - /// Whether the tab to browse the videos should be displayed. - pub show_browse_view: Option, - /// Title for the featured channels tab. - pub featured_channels_title: Option, - /// no description provided - pub default_language: Option, - /// 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, - /// 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, - /// Whether related channels should be proposed. - pub show_related_channels: Option, - /// The ID for a Google Analytics account to track and measure traffic to the channels. - pub tracking_analytics_account_id: Option, + /// 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. + pub moderate_comments: Option, + /// Whether the tab to browse the videos should be displayed. + pub show_browse_view: Option, + /// Title for the featured channels tab. + pub featured_channels_title: Option, + /// no description provided + pub default_language: Option, + /// 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, + /// 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, + /// Whether related channels should be proposed. + pub show_related_channels: Option, + /// The ID for a Google Analytics account to track and measure traffic to the channels. + pub tracking_analytics_account_id: Option, } impl Part for ChannelSettings {} @@ -770,18 +770,18 @@ impl Part for ChannelSettings {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoStatistics { - /// The number of comments for the video. - pub comment_count: Option, - /// The number of times the video has been viewed. - pub view_count: Option, - /// The number of users who currently have the video marked as a favorite video. - pub favorite_count: Option, - /// The number of users who have indicated that they disliked the video by giving it a negative rating. - pub dislike_count: Option, - /// The number of users who have indicated that they liked the video by giving it a positive rating. - pub like_count: Option, + /// The number of comments for the video. + pub comment_count: Option, + /// The number of times the video has been viewed. + pub view_count: Option, + /// The number of users who currently have the video marked as a favorite video. + pub favorite_count: Option, + /// The number of users who have indicated that they disliked the video by giving it a negative rating. + pub dislike_count: Option, + /// The number of users who have indicated that they liked the video by giving it a positive rating. + pub like_count: Option, } impl Part for VideoStatistics {} @@ -791,14 +791,14 @@ impl Part for VideoStatistics {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - pub ingestion_info: Option, - /// The method or protocol used to transmit the video stream. - pub ingestion_type: Option, + /// 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. + pub ingestion_info: Option, + /// The method or protocol used to transmit the video stream. + pub ingestion_type: Option, } impl Part for CdnSettings {} @@ -814,18 +814,18 @@ impl Part for CdnSettings {} /// * [getRating](struct.VideoGetRatingMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, - /// 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. - pub visitor_id: Option, + /// 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, + /// 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. + pub visitor_id: Option, } impl ResponseResult for VideoGetRatingResponse {} @@ -835,14 +835,14 @@ impl ResponseResult for VideoGetRatingResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoCategorySnippet { - /// no description provided - pub assignable: Option, - /// The YouTube channel that created the video category. - pub channel_id: Option, - /// The video category's title. - pub title: Option, + /// no description provided + pub assignable: Option, + /// The YouTube channel that created the video category. + pub channel_id: Option, + /// The video category's title. + pub title: Option, } impl Part for VideoCategorySnippet {} @@ -852,10 +852,10 @@ impl Part for VideoCategorySnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ActivityContentDetailsChannelItem { - /// The resourceId object contains information that identifies the resource that was added to the channel. - pub resource_id: Option, + /// The resourceId object contains information that identifies the resource that was added to the channel. + pub resource_id: Option, } impl Part for ActivityContentDetailsChannelItem {} @@ -865,12 +865,12 @@ impl Part for ActivityContentDetailsChannelItem {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct I18nLanguageSnippet { - /// The human-readable name of the language in the language itself. - pub name: Option, - /// A short BCP-47 code that uniquely identifies a language. - pub hl: Option, + /// The human-readable name of the language in the language itself. + pub name: Option, + /// A short BCP-47 code that uniquely identifies a language. + pub hl: Option, } impl Part for I18nLanguageSnippet {} @@ -880,22 +880,22 @@ impl Part for I18nLanguageSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, - /// The subscription's title. - pub title: Option, - /// The id object contains information about the channel that the user subscribed to. - pub resource_id: Option, - /// The subscription's details. - pub description: Option, - /// The ID that YouTube uses to uniquely identify the subscriber's channel. - 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. - pub published_at: Option, - /// Channel title for the channel that the subscription belongs to. - pub channel_title: 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 subscription's title. + pub title: Option, + /// The id object contains information about the channel that the user subscribed to. + pub resource_id: Option, + /// The subscription's details. + pub description: Option, + /// The ID that YouTube uses to uniquely identify the subscriber's channel. + 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. + pub published_at: Option, + /// Channel title for the channel that the subscription belongs to. + pub channel_title: Option, } impl Part for SubscriptionSnippet {} @@ -905,12 +905,12 @@ impl Part for SubscriptionSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelSectionContentDetails { - /// The channel ids for type multiple_channels. - pub channels: Vec, - /// The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed. - pub playlists: Vec, + /// The channel ids for type multiple_channels. + pub channels: Vec, + /// The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed. + pub playlists: Vec, } impl Part for ChannelSectionContentDetails {} @@ -926,18 +926,18 @@ impl Part for ChannelSectionContentDetails {} /// * [list](struct.I18nRegionListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, - /// 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. - pub visitor_id: Option, + /// 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, + /// 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. + pub visitor_id: Option, } impl ResponseResult for I18nRegionListResponse {} @@ -953,26 +953,26 @@ impl ResponseResult for I18nRegionListResponse {} /// * [list](struct.LiveStreamListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct LiveStreamListResponse { - /// Serialized EventId of the request which produced this response. - 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. - 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. - pub visitor_id: Option, - /// A list of live streams that match the request criteria. - pub items: Vec, - /// no description provided - 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. - pub prev_page_token: Option, - /// no description provided - pub page_info: Option, + /// Serialized EventId of the request which produced this response. + 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. + 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. + pub visitor_id: Option, + /// A list of live streams that match the request criteria. + pub items: Vec, + /// no description provided + 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. + pub prev_page_token: Option, + /// no description provided + pub page_info: Option, } impl ResponseResult for LiveStreamListResponse {} @@ -982,16 +982,16 @@ impl ResponseResult for LiveStreamListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PromotedItem { - /// The temporal position within the video where the promoted item will be displayed. If present, it overrides the default timing. - pub timing: Option, - /// If true, the content owner's name will be used when displaying the promotion. This field can only be set when the update is made on behalf of the content owner. - pub promoted_by_content_owner: Option, - /// A custom message to display for this promotion. This field is currently ignored unless the promoted item is a website. - pub custom_message: Option, - /// Identifies the promoted item. - pub id: Option, + /// The temporal position within the video where the promoted item will be displayed. If present, it overrides the default timing. + pub timing: Option, + /// If true, the content owner's name will be used when displaying the promotion. This field can only be set when the update is made on behalf of the content owner. + pub promoted_by_content_owner: Option, + /// A custom message to display for this promotion. This field is currently ignored unless the promoted item is a website. + pub custom_message: Option, + /// Identifies the promoted item. + pub id: Option, } impl Part for PromotedItem {} @@ -1001,16 +1001,16 @@ impl Part for PromotedItem {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelBrandingSettings { - /// Branding properties for branding images. - pub image: Option, - /// Branding properties for the watch page. - pub watch: Option, - /// Branding properties for the channel view. - pub channel: Option, - /// Additional experimental branding properties. - pub hints: Vec, + /// Branding properties for branding images. + pub image: Option, + /// Branding properties for the watch page. + pub watch: Option, + /// Branding properties for the channel view. + pub channel: Option, + /// Additional experimental branding properties. + pub hints: Vec, } impl Part for ChannelBrandingSettings {} @@ -1026,26 +1026,26 @@ impl Part for ChannelBrandingSettings {} /// * [list](struct.PlaylistListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistListResponse { - /// Serialized EventId of the request which produced this response. - 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. - 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. - pub visitor_id: Option, - /// A list of playlists that match the request criteria. - pub items: Vec, - /// no description provided - 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. - pub prev_page_token: Option, - /// no description provided - pub page_info: Option, + /// Serialized EventId of the request which produced this response. + 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. + 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. + pub visitor_id: Option, + /// A list of playlists that match the request criteria. + pub items: Vec, + /// no description provided + 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. + pub prev_page_token: Option, + /// no description provided + pub page_info: Option, } impl ResponseResult for PlaylistListResponse {} @@ -1061,46 +1061,46 @@ impl ResponseResult for PlaylistListResponse {} /// * [set](struct.WatermarkSetMethodBuilder.html) (request) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct InvideoBranding { - /// no description provided - pub target_channel_id: Option, - /// no description provided - pub position: Option, - /// no description provided - pub image_url: Option, - /// no description provided - pub timing: Option, - /// no description provided - pub image_bytes: Option, + /// no description provided + pub target_channel_id: Option, + /// no description provided + pub position: Option, + /// no description provided + pub image_url: Option, + /// no description provided + pub timing: Option, + /// no description provided + pub image_bytes: Option, } impl RequestValue for InvideoBranding {} impl InvideoBranding { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// the parts you want to see in the server response. - fn to_parts(&self) -> String { - let mut r = String::new(); - if self.target_channel_id.is_some() { r = r + "targetChannelId,"; } - 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,"; } - r.pop(); - r - } + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.target_channel_id.is_some() { r = r + "targetChannelId,"; } + 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,"; } + r.pop(); + r + } } /// Information about the playlist item's privacy status. /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistItemStatus { - /// This resource's privacy status. - pub privacy_status: Option, + /// This resource's privacy status. + pub privacy_status: Option, } impl Part for PlaylistItemStatus {} @@ -1110,12 +1110,12 @@ impl Part for PlaylistItemStatus {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - pub conversion_url: Option, + /// 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. + pub conversion_url: Option, } impl Part for ChannelConversionPing {} @@ -1125,16 +1125,16 @@ impl Part for ChannelConversionPing {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, - /// 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. - pub position: Option, + /// 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, + /// 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. + pub position: Option, } impl Part for InvideoPromotion {} @@ -1162,20 +1162,20 @@ impl Part for InvideoPromotion {} /// * [delete](struct.PlaylistItemDeleteMethodBuilder.html) (none) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct PlaylistItem { - /// The status object contains information about the playlist item's privacy status. - pub status: 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". - pub kind: Option, - /// 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, - /// The ID that YouTube uses to uniquely identify the playlist item. - pub id: Option, + /// The status object contains information about the playlist item's privacy status. + pub status: 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". + pub kind: Option, + /// 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, + /// The ID that YouTube uses to uniquely identify the playlist item. + pub id: Option, } impl RequestValue for PlaylistItem {} @@ -1183,20 +1183,20 @@ impl ResponseResult for PlaylistItem {} impl cmn::Resource for PlaylistItem {} impl PlaylistItem { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// 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.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.id.is_some() { r = r + "id,"; } - r.pop(); - r - } + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// 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.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.id.is_some() { r = r + "id,"; } + r.pop(); + r + } } /// There is no detailed description. @@ -1209,26 +1209,26 @@ impl PlaylistItem { /// * [list](struct.GuideCategoryListMethodBuilder.html) (response) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct GuideCategoryListResponse { - /// Serialized EventId of the request which produced this response. - 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. - 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. - 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, - /// no description provided - 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. - pub prev_page_token: Option, - /// no description provided - pub page_info: Option, + /// Serialized EventId of the request which produced this response. + 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. + 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. + 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, + /// no description provided + 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. + pub prev_page_token: Option, + /// no description provided + pub page_info: Option, } impl ResponseResult for GuideCategoryListResponse {} @@ -1238,12 +1238,12 @@ impl ResponseResult for GuideCategoryListResponse {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoLocalization { - /// Localized version of the video's description. - pub description: Option, - /// Localized version of the video's title. - pub title: Option, + /// Localized version of the video's description. + pub description: Option, + /// Localized version of the video's title. + pub title: Option, } impl Part for VideoLocalization {} @@ -1253,22 +1253,22 @@ impl Part for VideoLocalization {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelSectionSnippet { - /// The style of the channel section. - pub style: Option, - /// Localized title, read-only. - pub localized: Option, - /// The channel section's title for multiple_playlists and multiple_channels. - pub title: Option, - /// 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. - pub channel_id: Option, - /// The type of the channel section. - pub type_: Option, - /// The language of the channel section's default title and description. - pub default_language: Option, + /// The style of the channel section. + pub style: Option, + /// Localized title, read-only. + pub localized: Option, + /// The channel section's title for multiple_playlists and multiple_channels. + pub title: Option, + /// 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. + pub channel_id: Option, + /// The type of the channel section. + pub type_: Option, + /// The language of the channel section's default title and description. + pub default_language: Option, } impl Part for ChannelSectionSnippet {} @@ -1278,12 +1278,12 @@ impl Part for ChannelSectionSnippet {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelContentDetails { - /// no description provided - pub related_playlists: Option, - /// The googlePlusUserId object identifies the Google+ profile ID associated with this channel. - pub google_plus_user_id: Option, + /// no description provided + pub related_playlists: Option, + /// The googlePlusUserId object identifies the Google+ profile ID associated with this channel. + pub google_plus_user_id: Option, } impl Part for ChannelContentDetails {} @@ -1293,7 +1293,7 @@ impl Part for ChannelContentDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct TokenPagination; impl Part for TokenPagination {} @@ -1303,16 +1303,16 @@ impl Part for TokenPagination {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - 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. - 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. - pub video_id: Option, + /// 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. + 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. + 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. + pub video_id: Option, } impl Part for PlaylistItemContentDetails {} @@ -1322,18 +1322,18 @@ impl Part for PlaylistItemContentDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ThumbnailDetails { - /// The default image for this resource. - pub default: Option, - /// The high quality image for this resource. - pub high: Option, - /// The medium quality image for this resource. - pub medium: Option, - /// The maximum resolution quality image for this resource. - pub maxres: Option, - /// The standard quality image for this resource. - pub standard: Option, + /// The default image for this resource. + pub default: Option, + /// The high quality image for this resource. + pub high: Option, + /// The medium quality image for this resource. + pub medium: Option, + /// The maximum resolution quality image for this resource. + pub maxres: Option, + /// The standard quality image for this resource. + pub standard: Option, } impl Part for ThumbnailDetails {} @@ -1343,10 +1343,10 @@ impl Part for ThumbnailDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoMonetizationDetails { - /// The value of access indicates whether the video can be monetized or not. - pub access: Option, + /// The value of access indicates whether the video can be monetized or not. + pub access: Option, } impl Part for VideoMonetizationDetails {} @@ -1356,14 +1356,14 @@ impl Part for VideoMonetizationDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ActivityContentDetailsRecommendation { - /// The resourceId object contains information that identifies the recommended resource. - 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. - pub seed_resource_id: Option, + /// The resourceId object contains information that identifies the recommended resource. + 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. + pub seed_resource_id: Option, } impl Part for ActivityContentDetailsRecommendation {} @@ -1373,14 +1373,14 @@ impl Part for ActivityContentDetailsRecommendation {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - pub recording_date: Option, - /// The text description of the location where the video was recorded. - pub location_description: Option, - /// The geolocation information associated with the video. - pub location: Option, + /// The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. + pub recording_date: Option, + /// The text description of the location where the video was recorded. + pub location_description: Option, + /// The geolocation information associated with the video. + pub location: Option, } impl Part for VideoRecordingDetails {} @@ -1390,10 +1390,10 @@ impl Part for VideoRecordingDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ActivityContentDetailsSubscription { - /// The resourceId object contains information that identifies the resource that the user subscribed to. - pub resource_id: Option, + /// The resourceId object contains information that identifies the resource that the user subscribed to. + pub resource_id: Option, } impl Part for ActivityContentDetailsSubscription {} @@ -1403,10 +1403,10 @@ impl Part for ActivityContentDetailsSubscription {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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, + /// 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, } impl Part for ChannelConversionPings {} @@ -1416,30 +1416,30 @@ impl Part for ChannelConversionPings {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - 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. - 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, - /// The favorite object contains information about a video that was marked as a favorite video. This property is only present if the snippet.type is favorite. - pub favorite: Option, - /// The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload. - pub upload: Option, - /// 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. - 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, - /// The subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription. - pub subscription: Option, + /// 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. + 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. + 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, + /// The favorite object contains information about a video that was marked as a favorite video. This property is only present if the snippet.type is favorite. + pub favorite: Option, + /// The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload. + pub upload: Option, + /// 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. + 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, + /// The subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription. + pub subscription: Option, } impl Part for ActivityContentDetails {} @@ -1455,16 +1455,16 @@ impl Part for ActivityContentDetails {} /// * [list](struct.I18nRegionListMethodBuilder.html) (none) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct I18nRegion { - /// The snippet object contains basic details about the i18n region, such as region code and human-readable name. - pub snippet: Option, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegion". - pub kind: Option, - /// Etag of this resource. - pub etag: Option, - /// The ID that YouTube uses to uniquely identify the i18n region. - pub id: Option, + /// The snippet object contains basic details about the i18n region, such as region code and human-readable name. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegion". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube uses to uniquely identify the i18n region. + pub id: Option, } impl cmn::Resource for I18nRegion {} @@ -1474,12 +1474,12 @@ impl cmn::Resource for I18nRegion {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct ChannelContentOwnerDetails { - /// The ID of the content owner linked to the channel. - 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. - pub time_linked: Option, + /// The ID of the content owner linked to the channel. + 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. + pub time_linked: Option, } impl Part for ChannelContentOwnerDetails {} @@ -1489,24 +1489,24 @@ impl Part for ChannelContentOwnerDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - 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. - 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, - /// 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. - pub processing_failure_reason: Option, - /// 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, - /// 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, + /// 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. + 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. + 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, + /// 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. + pub processing_failure_reason: Option, + /// 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, + /// 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, } impl Part for VideoProcessingDetails {} @@ -1516,16 +1516,16 @@ impl Part for VideoProcessingDetails {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct LiveBroadcastStatus { - /// The broadcast's recording status. - 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. - pub privacy_status: Option, - /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. - pub life_cycle_status: Option, - /// Priority of the live broadcast event (internal state). - pub live_broadcast_priority: Option, + /// The broadcast's recording status. + 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. + pub privacy_status: Option, + /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. + pub life_cycle_status: Option, + /// Priority of the live broadcast event (internal state). + pub live_broadcast_priority: Option, } impl Part for LiveBroadcastStatus {} @@ -1535,14 +1535,14 @@ impl Part for LiveBroadcastStatus {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct SubscriptionContentDetails { - /// The number of new items in the subscription since its content was last read. - pub new_item_count: Option, - /// The type of activity this subscription is for (only uploads, everything). - pub activity_type: Option, - /// The approximate number of items that the subscription points to. - pub total_item_count: Option, + /// The number of new items in the subscription since its content was last read. + pub new_item_count: Option, + /// The type of activity this subscription is for (only uploads, everything). + pub activity_type: Option, + /// The approximate number of items that the subscription points to. + pub total_item_count: Option, } impl Part for SubscriptionContentDetails {} @@ -1563,48 +1563,48 @@ impl Part for SubscriptionContentDetails {} /// * [delete](struct.VideoDeleteMethodBuilder.html) (none) /// /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] 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. - pub topic_details: Option, - /// The monetizationDetails object encapsulates information about the monetization status of the video. - 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. - 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, - /// 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, - /// 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, - /// 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 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. + pub topic_details: Option, + /// The monetizationDetails object encapsulates information about the monetization status of the video. + 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. + 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, + /// 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, + /// 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, + /// 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, - /// 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, - /// The contentDetails object contains information about the video content, including the length of the video and its aspect ratio. - pub content_details: 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, - /// 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, - /// The recordingDetails object encapsulates information about the location, date and address where the video was recorded. - pub recording_details: Option, + pub processing_details: 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, + /// The contentDetails object contains information about the video content, including the length of the video and its aspect ratio. + pub content_details: 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, + /// 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, + /// The recordingDetails object encapsulates information about the location, date and address where the video was recorded. + pub recording_details: Option, } impl RequestValue for Video {} @@ -1612,47 +1612,47 @@ impl ResponseResult for Video {} impl cmn::Resource for Video {} impl Video { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// 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.age_gating.is_some() { r = r + "ageGating,"; } - 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.live_streaming_details.is_some() { r = r + "liveStreamingDetails,"; } - if self.processing_details.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.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,"; } - r.pop(); - r - } + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// 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.age_gating.is_some() { r = r + "ageGating,"; } + 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.live_streaming_details.is_some() { r = r + "liveStreamingDetails,"; } + if self.processing_details.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.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,"; } + r.pop(); + r + } } /// Geographical coordinates of a point, in WGS84. /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct GeoPoint { - /// Latitude in degrees. - pub latitude: Option, - /// Altitude above the reference ellipsoid, in meters. - pub altitude: Option, - /// Longitude in degrees. - pub longitude: Option, + /// Latitude in degrees. + pub latitude: Option, + /// Altitude above the reference ellipsoid, in meters. + pub altitude: Option, + /// Longitude in degrees. + pub longitude: Option, } impl Part for GeoPoint {} @@ -1662,14 +1662,14 @@ impl Part for GeoPoint {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoAgeGating { - /// Age-restricted trailers. For redband trailers and adult-rated video-games. Only users aged 18+ can view the content. The the field is true the content is restricted to viewers aged 18+. Otherwise The field won't be present. - pub restricted: Option, - /// Indicates whether or not the video has alcoholic beverage content. Only users of legal purchasing age in a particular country, as identified by ICAP, can view the content. - pub alcohol_content: Option, - /// Video game rating, if any. - pub video_game_rating: Option, + /// Age-restricted trailers. For redband trailers and adult-rated video-games. Only users aged 18+ can view the content. The the field is true the content is restricted to viewers aged 18+. Otherwise The field won't be present. + pub restricted: Option, + /// Indicates whether or not the video has alcoholic beverage content. Only users of legal purchasing age in a particular country, as identified by ICAP, can view the content. + pub alcohol_content: Option, + /// Video game rating, if any. + pub video_game_rating: Option, } impl Part for VideoAgeGating {} @@ -1679,10 +1679,10 @@ impl Part for VideoAgeGating {} /// /// This type is not used in any activity, and only used as *part* of another schema. /// -#[derive(RustcEncodable, RustcDecodable, Default, Clone)] +#[derive(Default, Clone, RustcEncodable, RustcDecodable)] pub struct VideoPlayer { - /// An