diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 20aaa1772d9..03453c94748 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -433,28 +433,28 @@ impl<'a, C, NC, A> YouTube pub struct SubscriptionListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. #[serde(alias="nextPageToken")] - pub next_page_token: Option, + pub next_page_token: String, /// Identifies what kind of resource this is. Value: the fixed string "youtube#subscriptionListResponse". - pub kind: Option, + pub kind: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, /// A list of subscriptions that match the request criteria. - pub items: Option>, + pub items: Vec, /// no description provided #[serde(alias="tokenPagination")] - pub token_pagination: Option, + pub token_pagination: TokenPagination, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. #[serde(alias="prevPageToken")] - pub prev_page_token: Option, + pub prev_page_token: String, /// no description provided #[serde(alias="pageInfo")] - pub page_info: Option, + pub page_info: PageInfo, } impl ResponseResult for SubscriptionListResponse {} @@ -468,37 +468,20 @@ impl ResponseResult for SubscriptionListResponse {} pub struct ChannelAuditDetails { /// Whether or not the channel has any copyright strikes. #[serde(alias="copyrightStrikesGoodStanding")] - pub copyright_strikes_good_standing: Option, + pub copyright_strikes_good_standing: bool, /// Whether or not the channel respects the community guidelines. #[serde(alias="communityGuidelinesGoodStanding")] - pub community_guidelines_good_standing: Option, + pub community_guidelines_good_standing: bool, /// Whether or not the channel has any unresolved claims. #[serde(alias="contentIdClaimsGoodStanding")] - pub content_id_claims_good_standing: Option, + pub content_id_claims_good_standing: bool, /// Describes the general state of the channel. This field will always show if there are any issues whatsoever with the channel. Currently this field represents the result of the logical and operation over the community guidelines good standing, the copyright strikes good standing and the content ID claims good standing, but this may change in the future. #[serde(alias="overallGoodStanding")] - pub overall_good_standing: Option, + pub overall_good_standing: bool, } impl Part for ChannelAuditDetails {} -impl RequestValue for ChannelAuditDetails {} -impl ResponseResult for ChannelAuditDetails {} -impl cmn::Resource for ChannelAuditDetails {} -impl ChannelAuditDetails { - /// 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.copyright_strikes_good_standing.is_some() { r = r + "copyrightStrikesGoodStanding,"; } - if self.community_guidelines_good_standing.is_some() { r = r + "communityGuidelinesGoodStanding,"; } - if self.content_id_claims_good_standing.is_some() { r = r + "contentIdClaimsGoodStanding,"; } - if self.overall_good_standing.is_some() { r = r + "overallGoodStanding,"; } - r.pop(); - r - } -} /// Describes original video file properties, including technical details about audio and video streams, but also metadata information like content length, digitization time, or geotagging information. /// @@ -508,63 +491,40 @@ impl ChannelAuditDetails { pub struct VideoFileDetails { /// The uploaded video file's combined (video and audio) bitrate in bits per second. #[serde(alias="bitrateBps")] - pub bitrate_bps: Option, + pub bitrate_bps: String, /// The uploaded video file's container format. - pub container: Option, + pub container: String, /// Geographic coordinates that identify the place where the uploaded video was recorded. Coordinates are defined using WGS 84. #[serde(alias="recordingLocation")] - pub recording_location: Option, + pub recording_location: GeoPoint, /// The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded. #[serde(alias="fileType")] - pub file_type: Option, + pub file_type: String, /// The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: /// - Date only: YYYY-MM-DD /// - Naive time: YYYY-MM-DDTHH:MM:SS /// - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM #[serde(alias="creationTime")] - pub creation_time: Option, + pub creation_time: String, /// The length of the uploaded video in milliseconds. #[serde(alias="durationMs")] - pub duration_ms: Option, + pub duration_ms: String, /// The uploaded file's name. This field is present whether a video file or another type of file was uploaded. #[serde(alias="fileName")] - pub file_name: Option, + pub file_name: String, /// The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded. #[serde(alias="fileSize")] - pub file_size: Option, + pub file_size: String, /// A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream. #[serde(alias="videoStreams")] - pub video_streams: Option>, + 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. #[serde(alias="audioStreams")] - pub audio_streams: Option>, + pub audio_streams: Vec, } impl Part for VideoFileDetails {} -impl RequestValue for VideoFileDetails {} -impl ResponseResult for VideoFileDetails {} -impl cmn::Resource for VideoFileDetails {} -impl VideoFileDetails { - /// 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.bitrate_bps.is_some() { r = r + "bitrateBps,"; } - if self.container.is_some() { r = r + "container,"; } - if self.recording_location.is_some() { r = r + "recordingLocation,"; } - if self.file_type.is_some() { r = r + "fileType,"; } - if self.creation_time.is_some() { r = r + "creationTime,"; } - if self.duration_ms.is_some() { r = r + "durationMs,"; } - if self.file_name.is_some() { r = r + "fileName,"; } - if self.file_size.is_some() { r = r + "fileSize,"; } - if self.video_streams.is_some() { r = r + "videoStreams,"; } - if self.audio_streams.is_some() { r = r + "audioStreams,"; } - r.pop(); - r - } -} /// Playlist localization setting /// @@ -573,28 +533,13 @@ impl VideoFileDetails { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistLocalization { /// The localized strings for playlist's description. - pub description: Option, + pub description: String, /// The localized strings for playlist's title. - pub title: Option, + pub title: String, } impl Part for PlaylistLocalization {} -impl RequestValue for PlaylistLocalization {} -impl ResponseResult for PlaylistLocalization {} -impl cmn::Resource for PlaylistLocalization {} -impl PlaylistLocalization { - /// 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.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - r.pop(); - r - } -} /// Information about a resource that received a comment. /// @@ -604,24 +549,11 @@ impl PlaylistLocalization { pub struct ActivityContentDetailsComment { /// The resourceId object contains information that identifies the resource associated with the comment. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, } impl Part for ActivityContentDetailsComment {} -impl RequestValue for ActivityContentDetailsComment {} -impl ResponseResult for ActivityContentDetailsComment {} -impl ActivityContentDetailsComment { - /// 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.resource_id.is_some() { r = r + "resourceId,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -636,28 +568,28 @@ impl ActivityContentDetailsComment { pub struct PlaylistItemListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. #[serde(alias="nextPageToken")] - pub next_page_token: Option, + pub next_page_token: String, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistItemListResponse". - pub kind: Option, + pub kind: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, /// A list of playlist items that match the request criteria. - pub items: Option>, + pub items: Vec, /// no description provided #[serde(alias="tokenPagination")] - pub token_pagination: Option, + pub token_pagination: TokenPagination, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. #[serde(alias="prevPageToken")] - pub prev_page_token: Option, + pub prev_page_token: String, /// no description provided #[serde(alias="pageInfo")] - pub page_info: Option, + pub page_info: PageInfo, } impl ResponseResult for PlaylistItemListResponse {} @@ -670,28 +602,13 @@ impl ResponseResult for PlaylistItemListResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PropertyValue { /// A property. - pub property: Option, + pub property: String, /// The property's value. - pub value: Option, + pub value: String, } impl Part for PropertyValue {} -impl RequestValue for PropertyValue {} -impl ResponseResult for PropertyValue {} -impl cmn::Resource for PropertyValue {} -impl PropertyValue { - /// 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.property.is_some() { r = r + "property,"; } - if self.value.is_some() { r = r + "value,"; } - r.pop(); - r - } -} /// Describes a temporal position of a visual widget inside a video. /// @@ -701,33 +618,17 @@ impl PropertyValue { pub struct InvideoTiming { /// Defines the time at which the promotion will appear. Depending on the value of type the value of the offsetMs field will represent a time offset from the start or from the end of the video, expressed in milliseconds. #[serde(alias="offsetMs")] - pub offset_ms: Option, + pub offset_ms: String, /// Describes a timing type. If the value is offsetFromStart, then the offsetMs field represents an offset from the start of the video. If the value is offsetFromEnd, then the offsetMs field represents an offset from the end of the video. #[serde(alias="type")] - pub type_: Option, + pub type_: String, /// Defines the duration in milliseconds for which the promotion should be displayed. If missing, the client should use the default. #[serde(alias="durationMs")] - pub duration_ms: Option, + pub duration_ms: String, } impl Part for InvideoTiming {} -impl RequestValue for InvideoTiming {} -impl ResponseResult for InvideoTiming {} -impl cmn::Resource for InvideoTiming {} -impl InvideoTiming { - /// 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.offset_ms.is_some() { r = r + "offsetMs,"; } - if self.type_.is_some() { r = r + "type,"; } - if self.duration_ms.is_some() { r = r + "durationMs,"; } - r.pop(); - r - } -} /// Basic details about a playlist, including title, description and thumbnails. /// @@ -736,53 +637,31 @@ impl InvideoTiming { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistSnippet { /// The playlist's description. - pub description: Option, + pub description: String, /// The playlist's title. - pub title: Option, + pub title: String, /// The ID that YouTube uses to uniquely identify the channel that published the playlist. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The date and time that the playlist was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="publishedAt")] - pub published_at: Option, + pub published_at: String, /// Keyword tags associated with the playlist. - pub tags: Option>, + pub tags: Vec, /// The channel title of the channel that the video belongs to. #[serde(alias="channelTitle")] - pub channel_title: Option, + pub channel_title: String, /// The language of the playlist's default title and description. #[serde(alias="defaultLanguage")] - pub default_language: Option, + pub default_language: String, /// Localized title and description, read-only. - pub localized: Option, + pub localized: PlaylistLocalization, /// A map of thumbnail images associated with the playlist. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. - pub thumbnails: Option, + pub thumbnails: ThumbnailDetails, } impl Part for PlaylistSnippet {} -impl RequestValue for PlaylistSnippet {} -impl ResponseResult for PlaylistSnippet {} -impl cmn::Resource for PlaylistSnippet {} -impl PlaylistSnippet { - /// 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.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - if self.channel_id.is_some() { r = r + "channelId,"; } - if self.published_at.is_some() { r = r + "publishedAt,"; } - if self.tags.is_some() { r = r + "tags,"; } - if self.channel_title.is_some() { r = r + "channelTitle,"; } - if self.default_language.is_some() { r = r + "defaultLanguage,"; } - if self.localized.is_some() { r = r + "localized,"; } - if self.thumbnails.is_some() { r = r + "thumbnails,"; } - r.pop(); - r - } -} /// Information about a resource that received a positive (like) rating. /// @@ -792,24 +671,11 @@ impl PlaylistSnippet { pub struct ActivityContentDetailsLike { /// The resourceId object contains information that identifies the rated resource. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, } impl Part for ActivityContentDetailsLike {} -impl RequestValue for ActivityContentDetailsLike {} -impl ResponseResult for ActivityContentDetailsLike {} -impl ActivityContentDetailsLike { - /// 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.resource_id.is_some() { r = r + "resourceId,"; } - r.pop(); - r - } -} /// A live stream describes a live ingestion point. /// @@ -877,16 +743,16 @@ impl LiveStream { pub struct ThumbnailSetResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// A list of thumbnails. - pub items: Option>, + pub items: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#thumbnailSetResponse". - pub kind: Option, + pub kind: String, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, } impl ResponseResult for ThumbnailSetResponse {} @@ -900,24 +766,11 @@ impl ResponseResult for ThumbnailSetResponse {} pub struct ActivityContentDetailsUpload { /// The ID that YouTube uses to uniquely identify the uploaded video. #[serde(alias="videoId")] - pub video_id: Option, + pub video_id: String, } impl Part for ActivityContentDetailsUpload {} -impl RequestValue for ActivityContentDetailsUpload {} -impl ResponseResult for ActivityContentDetailsUpload {} -impl ActivityContentDetailsUpload { - /// 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.video_id.is_some() { r = r + "videoId,"; } - r.pop(); - r - } -} /// Branding properties for the channel view. /// @@ -926,71 +779,45 @@ impl ActivityContentDetailsUpload { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSettings { /// Specifies the channel description. - pub description: Option, + pub description: String, /// Specifies the channel title. - pub title: Option, + pub title: String, /// Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible. #[serde(alias="moderateComments")] - pub moderate_comments: Option, + pub moderate_comments: bool, /// Whether the tab to browse the videos should be displayed. #[serde(alias="showBrowseView")] - pub show_browse_view: Option, + pub show_browse_view: bool, /// Title for the featured channels tab. #[serde(alias="featuredChannelsTitle")] - pub featured_channels_title: Option, + pub featured_channels_title: String, /// no description provided #[serde(alias="defaultLanguage")] - pub default_language: Option, + pub default_language: String, /// The trailer of the channel, for users that are not subscribers. #[serde(alias="unsubscribedTrailer")] - pub unsubscribed_trailer: Option, + pub unsubscribed_trailer: String, /// The list of featured channels. #[serde(alias="featuredChannelsUrls")] - pub featured_channels_urls: Option>, + pub featured_channels_urls: Vec, /// A prominent color that can be rendered on this channel page. #[serde(alias="profileColor")] - pub profile_color: Option, + pub profile_color: String, /// Which content tab users should see when viewing the channel. #[serde(alias="defaultTab")] - pub default_tab: Option, + pub default_tab: String, /// Lists keywords associated with the channel, comma-separated. - pub keywords: Option, + pub keywords: String, /// Whether related channels should be proposed. #[serde(alias="showRelatedChannels")] - pub show_related_channels: Option, + pub show_related_channels: bool, /// The ID for a Google Analytics account to track and measure traffic to the channels. #[serde(alias="trackingAnalyticsAccountId")] - pub tracking_analytics_account_id: Option, + pub tracking_analytics_account_id: String, } impl Part for ChannelSettings {} -impl RequestValue for ChannelSettings {} -impl ResponseResult for ChannelSettings {} -impl cmn::Resource for ChannelSettings {} -impl ChannelSettings { - /// 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.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - if self.moderate_comments.is_some() { r = r + "moderateComments,"; } - if self.show_browse_view.is_some() { r = r + "showBrowseView,"; } - if self.featured_channels_title.is_some() { r = r + "featuredChannelsTitle,"; } - if self.default_language.is_some() { r = r + "defaultLanguage,"; } - if self.unsubscribed_trailer.is_some() { r = r + "unsubscribedTrailer,"; } - if self.featured_channels_urls.is_some() { r = r + "featuredChannelsUrls,"; } - if self.profile_color.is_some() { r = r + "profileColor,"; } - if self.default_tab.is_some() { r = r + "defaultTab,"; } - if self.keywords.is_some() { r = r + "keywords,"; } - if self.show_related_channels.is_some() { r = r + "showRelatedChannels,"; } - if self.tracking_analytics_account_id.is_some() { r = r + "trackingAnalyticsAccountId,"; } - r.pop(); - r - } -} /// Basic details about a search result, including title, description and thumbnails of the item referenced by the search result. /// @@ -1000,26 +827,25 @@ impl ChannelSettings { pub struct SearchResultSnippet { /// It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's "none" if there is not any upcoming/active live broadcasts. #[serde(alias="liveBroadcastContent")] - pub live_broadcast_content: Option, + pub live_broadcast_content: String, /// A description of the search result. - pub description: Option, + pub description: String, /// The title of the search result. - pub title: Option, + pub title: String, /// A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. - pub thumbnails: Option, + pub thumbnails: ThumbnailDetails, /// The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="publishedAt")] - pub published_at: Option, + pub published_at: String, /// The title of the channel that published the resource that the search result identifies. #[serde(alias="channelTitle")] - pub channel_title: Option, + pub channel_title: String, } impl Part for SearchResultSnippet {} -impl ResponseResult for SearchResultSnippet {} /// Describes information necessary for ingesting an RTMP or an HTTP stream. @@ -1030,37 +856,21 @@ impl ResponseResult for SearchResultSnippet {} pub struct IngestionInfo { /// The backup ingestion URL that you should use to stream video to YouTube. You have the option of simultaneously streaming the content that you are sending to the ingestionAddress to this URL. #[serde(alias="backupIngestionAddress")] - pub backup_ingestion_address: Option, + pub backup_ingestion_address: String, /// The HTTP or RTMP stream name that YouTube assigns to the video stream. #[serde(alias="streamName")] - pub stream_name: Option, + pub stream_name: String, /// The primary ingestion URL that you should use to stream video to YouTube. You must stream video to this URL. /// /// Depending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format: /// /// STREAM_URL/STREAM_NAME #[serde(alias="ingestionAddress")] - pub ingestion_address: Option, + pub ingestion_address: String, } impl Part for IngestionInfo {} -impl RequestValue for IngestionInfo {} -impl ResponseResult for IngestionInfo {} -impl cmn::Resource for IngestionInfo {} -impl IngestionInfo { - /// 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.backup_ingestion_address.is_some() { r = r + "backupIngestionAddress,"; } - if self.stream_name.is_some() { r = r + "streamName,"; } - if self.ingestion_address.is_some() { r = r + "ingestionAddress,"; } - r.pop(); - r - } -} /// Brief description of the live stream cdn settings. /// @@ -1069,33 +879,17 @@ impl IngestionInfo { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CdnSettings { /// The format of the video stream that you are sending to Youtube. - pub format: Option, + pub format: String, /// The ingestionInfo object contains information that YouTube provides that you need to transmit your RTMP or HTTP stream to YouTube. #[serde(alias="ingestionInfo")] - pub ingestion_info: Option, + pub ingestion_info: IngestionInfo, /// The method or protocol used to transmit the video stream. #[serde(alias="ingestionType")] - pub ingestion_type: Option, + pub ingestion_type: String, } impl Part for CdnSettings {} -impl RequestValue for CdnSettings {} -impl ResponseResult for CdnSettings {} -impl cmn::Resource for CdnSettings {} -impl CdnSettings { - /// 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.format.is_some() { r = r + "format,"; } - if self.ingestion_info.is_some() { r = r + "ingestionInfo,"; } - if self.ingestion_type.is_some() { r = r + "ingestionType,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -1110,16 +904,16 @@ impl CdnSettings { pub struct VideoGetRatingResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// A list of ratings that match the request criteria. - pub items: Option>, + pub items: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". - pub kind: Option, + pub kind: String, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, } impl ResponseResult for VideoGetRatingResponse {} @@ -1132,16 +926,15 @@ impl ResponseResult for VideoGetRatingResponse {} #[derive(Default, Clone, Debug, Deserialize)] pub struct VideoCategorySnippet { /// no description provided - pub assignable: Option, + pub assignable: bool, /// The YouTube channel that created the video category. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The video category's title. - pub title: Option, + pub title: String, } impl Part for VideoCategorySnippet {} -impl ResponseResult for VideoCategorySnippet {} /// Details about a resource which was added to a channel. @@ -1152,24 +945,11 @@ impl ResponseResult for VideoCategorySnippet {} pub struct ActivityContentDetailsChannelItem { /// The resourceId object contains information that identifies the resource that was added to the channel. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, } impl Part for ActivityContentDetailsChannelItem {} -impl RequestValue for ActivityContentDetailsChannelItem {} -impl ResponseResult for ActivityContentDetailsChannelItem {} -impl ActivityContentDetailsChannelItem { - /// 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.resource_id.is_some() { r = r + "resourceId,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -1179,54 +959,32 @@ impl ActivityContentDetailsChannelItem { pub struct LiveBroadcastSnippet { /// The date and time that the broadcast actually ended. This information is only available once the broadcast's state is complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="actualEndTime")] - pub actual_end_time: Option, + pub actual_end_time: String, /// 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, + pub description: String, /// 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, + pub title: String, /// The ID that YouTube uses to uniquely identify the channel that is publishing the broadcast. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The date and time that the broadcast was added to YouTube's live broadcast schedule. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="publishedAt")] - pub published_at: Option, + pub published_at: String, /// The date and time that the broadcast is scheduled to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="scheduledStartTime")] - pub scheduled_start_time: Option, + pub scheduled_start_time: String, /// The date and time that the broadcast actually started. This information is only available once the broadcast's state is live. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="actualStartTime")] - pub actual_start_time: Option, + pub actual_start_time: String, /// The date and time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="scheduledEndTime")] - pub scheduled_end_time: Option, + pub scheduled_end_time: String, /// A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. - pub thumbnails: Option, + pub thumbnails: ThumbnailDetails, } impl Part for LiveBroadcastSnippet {} -impl RequestValue for LiveBroadcastSnippet {} -impl ResponseResult for LiveBroadcastSnippet {} -impl cmn::Resource for LiveBroadcastSnippet {} -impl LiveBroadcastSnippet { - /// 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.actual_end_time.is_some() { r = r + "actualEndTime,"; } - if self.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - if self.channel_id.is_some() { r = r + "channelId,"; } - if self.published_at.is_some() { r = r + "publishedAt,"; } - if self.scheduled_start_time.is_some() { r = r + "scheduledStartTime,"; } - if self.actual_start_time.is_some() { r = r + "actualStartTime,"; } - if self.scheduled_end_time.is_some() { r = r + "scheduledEndTime,"; } - if self.thumbnails.is_some() { r = r + "thumbnails,"; } - r.pop(); - r - } -} /// Basic details about a subscription, including title, description and thumbnails of the subscribed item. /// @@ -1235,47 +993,27 @@ impl LiveBroadcastSnippet { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SubscriptionSnippet { /// The subscription's details. - pub description: Option, + pub description: String, /// The subscription's title. - pub title: Option, + pub title: String, /// The id object contains information about the channel that the user subscribed to. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, /// A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. - pub thumbnails: Option, + pub thumbnails: ThumbnailDetails, /// The ID that YouTube uses to uniquely identify the subscriber's channel. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="publishedAt")] - pub published_at: Option, + pub published_at: String, /// Channel title for the channel that the subscription belongs to. #[serde(alias="channelTitle")] - pub channel_title: Option, + pub channel_title: String, } impl Part for SubscriptionSnippet {} -impl RequestValue for SubscriptionSnippet {} -impl ResponseResult for SubscriptionSnippet {} -impl cmn::Resource for SubscriptionSnippet {} -impl SubscriptionSnippet { - /// 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.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - if self.resource_id.is_some() { r = r + "resourceId,"; } - if self.thumbnails.is_some() { r = r + "thumbnails,"; } - if self.channel_id.is_some() { r = r + "channelId,"; } - if self.published_at.is_some() { r = r + "publishedAt,"; } - if self.channel_title.is_some() { r = r + "channelTitle,"; } - r.pop(); - r - } -} /// Details about a channelsection, including playlists and channels. /// @@ -1284,28 +1022,13 @@ impl SubscriptionSnippet { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSectionContentDetails { /// The channel ids for type multiple_channels. - pub channels: Option>, + pub channels: Vec, /// The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed. - pub playlists: Option>, + pub playlists: Vec, } impl Part for ChannelSectionContentDetails {} -impl RequestValue for ChannelSectionContentDetails {} -impl ResponseResult for ChannelSectionContentDetails {} -impl cmn::Resource for ChannelSectionContentDetails {} -impl ChannelSectionContentDetails { - /// 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.channels.is_some() { r = r + "channels,"; } - if self.playlists.is_some() { r = r + "playlists,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -1320,16 +1043,16 @@ impl ChannelSectionContentDetails { pub struct I18nRegionListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// 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: Option>, + pub items: Vec, /// Identifies what kind of resource this is. Value: the fixed string "youtube#i18nRegionListResponse". - pub kind: Option, + pub kind: String, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, } impl ResponseResult for I18nRegionListResponse {} @@ -1348,28 +1071,28 @@ impl ResponseResult for I18nRegionListResponse {} pub struct LiveStreamListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. #[serde(alias="nextPageToken")] - pub next_page_token: Option, + pub next_page_token: String, /// Identifies what kind of resource this is. Value: the fixed string "youtube#liveStreamListResponse". - pub kind: Option, + pub kind: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, /// A list of live streams that match the request criteria. - pub items: Option>, + pub items: Vec, /// no description provided #[serde(alias="tokenPagination")] - pub token_pagination: Option, + pub token_pagination: TokenPagination, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. #[serde(alias="prevPageToken")] - pub prev_page_token: Option, + pub prev_page_token: String, /// no description provided #[serde(alias="pageInfo")] - pub page_info: Option, + pub page_info: PageInfo, } impl ResponseResult for LiveStreamListResponse {} @@ -1388,29 +1111,14 @@ pub struct LiveStreamContentDetails { /// - A non-reusable stream might be deleted by an automated process after the broadcast ends. /// - The liveStreams.list method does not list non-reusable streams if you call the method and set the mine parameter to true. The only way to use that method to retrieve the resource for a non-reusable stream is to use the id parameter to identify the stream. #[serde(alias="isReusable")] - pub is_reusable: Option, + pub is_reusable: bool, /// The ingestion URL where the closed captions of this stream are sent. #[serde(alias="closedCaptionsIngestionUrl")] - pub closed_captions_ingestion_url: Option, + pub closed_captions_ingestion_url: String, } impl Part for LiveStreamContentDetails {} -impl RequestValue for LiveStreamContentDetails {} -impl ResponseResult for LiveStreamContentDetails {} -impl cmn::Resource for LiveStreamContentDetails {} -impl LiveStreamContentDetails { - /// 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.is_reusable.is_some() { r = r + "isReusable,"; } - if self.closed_captions_ingestion_url.is_some() { r = r + "closedCaptionsIngestionUrl,"; } - r.pop(); - r - } -} /// Basic details about an i18n language, such as language code and human-readable name. /// @@ -1419,14 +1127,12 @@ impl LiveStreamContentDetails { #[derive(Default, Clone, Debug, Deserialize)] pub struct I18nLanguageSnippet { /// The human-readable name of the language in the language itself. - pub name: Option, + pub name: String, /// A short BCP-47 code that uniquely identifies a language. - pub hl: Option, + pub hl: String, } impl Part for I18nLanguageSnippet {} -impl ResponseResult for I18nLanguageSnippet {} -impl cmn::Resource for I18nLanguageSnippet {} /// There is no detailed description. @@ -1481,25 +1187,11 @@ impl InvideoBranding { pub struct PlaylistItemStatus { /// This resource's privacy status. #[serde(alias="privacyStatus")] - pub privacy_status: Option, + pub privacy_status: String, } impl Part for PlaylistItemStatus {} -impl RequestValue for PlaylistItemStatus {} -impl ResponseResult for PlaylistItemStatus {} -impl cmn::Resource for PlaylistItemStatus {} -impl PlaylistItemStatus { - /// 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.privacy_status.is_some() { r = r + "privacyStatus,"; } - r.pop(); - r - } -} /// 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. /// @@ -1508,29 +1200,14 @@ impl PlaylistItemStatus { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelConversionPing { /// Defines the context of the ping. - pub context: Option, + pub context: String, /// The url (without the schema) that the player shall send the ping to. It's at caller's descretion to decide which schema to use (http vs https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must append biscotti authentication (ms param in case of mobile, for example) to this ping. #[serde(alias="conversionUrl")] - pub conversion_url: Option, + pub conversion_url: String, } impl Part for ChannelConversionPing {} -impl RequestValue for ChannelConversionPing {} -impl ResponseResult for ChannelConversionPing {} -impl cmn::Resource for ChannelConversionPing {} -impl ChannelConversionPing { - /// 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.context.is_some() { r = r + "context,"; } - if self.conversion_url.is_some() { r = r + "conversionUrl,"; } - r.pop(); - r - } -} /// Project specific details about the content of a YouTube Video. /// @@ -1539,25 +1216,11 @@ impl ChannelConversionPing { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoProjectDetails { /// A list of project tags associated with the video during the upload. - pub tags: Option>, + pub tags: Vec, } impl Part for VideoProjectDetails {} -impl RequestValue for VideoProjectDetails {} -impl ResponseResult for VideoProjectDetails {} -impl cmn::Resource for VideoProjectDetails {} -impl VideoProjectDetails { - /// 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.tags.is_some() { r = r + "tags,"; } - r.pop(); - r - } -} /// A playlistItem resource identifies another resource, such as a video, that is included in a playlist. In addition, the playlistItem resource contains details about the included resource that pertain specifically to how that resource is used in that playlist. /// @@ -1631,28 +1294,28 @@ impl PlaylistItem { pub struct GuideCategoryListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. #[serde(alias="nextPageToken")] - pub next_page_token: Option, + pub next_page_token: String, /// Identifies what kind of resource this is. Value: the fixed string "youtube#guideCategoryListResponse". - pub kind: Option, + pub kind: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, /// 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: Option>, + pub items: Vec, /// no description provided #[serde(alias="tokenPagination")] - pub token_pagination: Option, + pub token_pagination: TokenPagination, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. #[serde(alias="prevPageToken")] - pub prev_page_token: Option, + pub prev_page_token: String, /// no description provided #[serde(alias="pageInfo")] - pub page_info: Option, + pub page_info: PageInfo, } impl ResponseResult for GuideCategoryListResponse {} @@ -1665,28 +1328,13 @@ impl ResponseResult for GuideCategoryListResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoLocalization { /// Localized version of the video's description. - pub description: Option, + pub description: String, /// Localized version of the video's title. - pub title: Option, + pub title: String, } impl Part for VideoLocalization {} -impl RequestValue for VideoLocalization {} -impl ResponseResult for VideoLocalization {} -impl cmn::Resource for VideoLocalization {} -impl VideoLocalization { - /// 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.description.is_some() { r = r + "description,"; } - if self.title.is_some() { r = r + "title,"; } - r.pop(); - r - } -} /// Basic details about a channel section, including title, style and position. /// @@ -1695,46 +1343,26 @@ impl VideoLocalization { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelSectionSnippet { /// The style of the channel section. - pub style: Option, + pub style: String, /// Localized title, read-only. - pub localized: Option, + pub localized: ChannelSectionLocalization, /// The channel section's title for multiple_playlists and multiple_channels. - pub title: Option, + pub title: String, /// The position of the channel section in the channel. - pub position: Option, + pub position: u32, /// The ID that YouTube uses to uniquely identify the channel that published the channel section. #[serde(alias="channelId")] - pub channel_id: Option, + pub channel_id: String, /// The type of the channel section. #[serde(alias="type")] - pub type_: Option, + pub type_: String, /// The language of the channel section's default title and description. #[serde(alias="defaultLanguage")] - pub default_language: Option, + pub default_language: String, } impl Part for ChannelSectionSnippet {} -impl RequestValue for ChannelSectionSnippet {} -impl ResponseResult for ChannelSectionSnippet {} -impl cmn::Resource for ChannelSectionSnippet {} -impl ChannelSectionSnippet { - /// 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.style.is_some() { r = r + "style,"; } - if self.localized.is_some() { r = r + "localized,"; } - if self.title.is_some() { r = r + "title,"; } - if self.position.is_some() { r = r + "position,"; } - if self.channel_id.is_some() { r = r + "channelId,"; } - if self.type_.is_some() { r = r + "type,"; } - if self.default_language.is_some() { r = r + "defaultLanguage,"; } - r.pop(); - r - } -} /// Details about the content of a channel. /// @@ -1744,29 +1372,14 @@ impl ChannelSectionSnippet { pub struct ChannelContentDetails { /// no description provided #[serde(alias="relatedPlaylists")] - pub related_playlists: Option, + pub related_playlists: ChannelContentDetailsRelatedPlaylists, /// The googlePlusUserId object identifies the Google+ profile ID associated with this channel. #[serde(alias="googlePlusUserId")] - pub google_plus_user_id: Option, + pub google_plus_user_id: String, } impl Part for ChannelContentDetails {} -impl RequestValue for ChannelContentDetails {} -impl ResponseResult for ChannelContentDetails {} -impl cmn::Resource for ChannelContentDetails {} -impl ChannelContentDetails { - /// 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.related_playlists.is_some() { r = r + "relatedPlaylists,"; } - if self.google_plus_user_id.is_some() { r = r + "googlePlusUserId,"; } - r.pop(); - r - } -} /// Stub token pagination template to suppress results. /// @@ -1776,7 +1389,6 @@ impl ChannelContentDetails { pub struct TokenPagination; impl Part for TokenPagination {} -impl ResponseResult for TokenPagination {} /// A i18nRegion resource identifies a region where YouTube is available. @@ -1800,7 +1412,6 @@ pub struct I18nRegion { pub id: Option, } -impl ResponseResult for I18nRegion {} impl cmn::Resource for I18nRegion {} @@ -1811,37 +1422,19 @@ impl cmn::Resource for I18nRegion {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ThumbnailDetails { /// The default image for this resource. - pub default: Option, + pub default: Thumbnail, /// The high quality image for this resource. - pub high: Option, + pub high: Thumbnail, /// The medium quality image for this resource. - pub medium: Option, + pub medium: Thumbnail, /// The maximum resolution quality image for this resource. - pub maxres: Option, + pub maxres: Thumbnail, /// The standard quality image for this resource. - pub standard: Option, + pub standard: Thumbnail, } impl Part for ThumbnailDetails {} -impl RequestValue for ThumbnailDetails {} -impl ResponseResult for ThumbnailDetails {} -impl cmn::Resource for ThumbnailDetails {} -impl ThumbnailDetails { - /// 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.default.is_some() { r = r + "default,"; } - if self.high.is_some() { r = r + "high,"; } - if self.medium.is_some() { r = r + "medium,"; } - if self.maxres.is_some() { r = r + "maxres,"; } - if self.standard.is_some() { r = r + "standard,"; } - r.pop(); - r - } -} /// Details about monetization of a YouTube Video. /// @@ -1850,25 +1443,11 @@ impl ThumbnailDetails { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoMonetizationDetails { /// The value of access indicates whether the video can be monetized or not. - pub access: Option, + pub access: AccessPolicy, } impl Part for VideoMonetizationDetails {} -impl RequestValue for VideoMonetizationDetails {} -impl ResponseResult for VideoMonetizationDetails {} -impl cmn::Resource for VideoMonetizationDetails {} -impl VideoMonetizationDetails { - /// 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.access.is_some() { r = r + "access,"; } - r.pop(); - r - } -} /// Information that identifies the recommended resource. /// @@ -1878,31 +1457,16 @@ impl VideoMonetizationDetails { pub struct ActivityContentDetailsRecommendation { /// The resourceId object contains information that identifies the recommended resource. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, /// The reason that the resource is recommended to the user. - pub reason: Option, + pub reason: String, /// The seedResourceId object contains information about the resource that caused the recommendation. #[serde(alias="seedResourceId")] - pub seed_resource_id: Option, + pub seed_resource_id: ResourceId, } impl Part for ActivityContentDetailsRecommendation {} -impl RequestValue for ActivityContentDetailsRecommendation {} -impl ResponseResult for ActivityContentDetailsRecommendation {} -impl ActivityContentDetailsRecommendation { - /// 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.resource_id.is_some() { r = r + "resourceId,"; } - if self.reason.is_some() { r = r + "reason,"; } - if self.seed_resource_id.is_some() { r = r + "seedResourceId,"; } - r.pop(); - r - } -} /// Recording information associated with the video. /// @@ -1912,32 +1476,16 @@ impl ActivityContentDetailsRecommendation { pub struct VideoRecordingDetails { /// The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. #[serde(alias="recordingDate")] - pub recording_date: Option, + pub recording_date: String, /// The text description of the location where the video was recorded. #[serde(alias="locationDescription")] - pub location_description: Option, + pub location_description: String, /// The geolocation information associated with the video. - pub location: Option, + pub location: GeoPoint, } impl Part for VideoRecordingDetails {} -impl RequestValue for VideoRecordingDetails {} -impl ResponseResult for VideoRecordingDetails {} -impl cmn::Resource for VideoRecordingDetails {} -impl VideoRecordingDetails { - /// 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.recording_date.is_some() { r = r + "recordingDate,"; } - if self.location_description.is_some() { r = r + "locationDescription,"; } - if self.location.is_some() { r = r + "location,"; } - r.pop(); - r - } -} /// Information about a channel that a user subscribed to. /// @@ -1947,24 +1495,11 @@ impl VideoRecordingDetails { pub struct ActivityContentDetailsSubscription { /// The resourceId object contains information that identifies the resource that the user subscribed to. #[serde(alias="resourceId")] - pub resource_id: Option, + pub resource_id: ResourceId, } impl Part for ActivityContentDetailsSubscription {} -impl RequestValue for ActivityContentDetailsSubscription {} -impl ResponseResult for ActivityContentDetailsSubscription {} -impl ActivityContentDetailsSubscription { - /// 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.resource_id.is_some() { r = r + "resourceId,"; } - r.pop(); - r - } -} /// The conversionPings object encapsulates information about conversion pings that need to be respected by the channel. /// @@ -1973,25 +1508,11 @@ impl ActivityContentDetailsSubscription { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelConversionPings { /// Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping. - pub pings: Option>, + pub pings: Vec, } impl Part for ChannelConversionPings {} -impl RequestValue for ChannelConversionPings {} -impl ResponseResult for ChannelConversionPings {} -impl cmn::Resource for ChannelConversionPings {} -impl ChannelConversionPings { - /// 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.pings.is_some() { r = r + "pings,"; } - r.pop(); - r - } -} /// Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc. /// @@ -2000,57 +1521,34 @@ impl ChannelConversionPings { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityContentDetails { /// The comment object contains information about a resource that received a comment. This property is only present if the snippet.type is comment. - pub comment: Option, + pub comment: ActivityContentDetailsComment, /// The playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem. #[serde(alias="playlistItem")] - pub playlist_item: Option, + pub playlist_item: ActivityContentDetailsPlaylistItem, /// 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, + pub like: ActivityContentDetailsLike, /// The promotedItem object contains details about a resource which is being promoted. This property is only present if the snippet.type is promotedItem. #[serde(alias="promotedItem")] - pub promoted_item: Option, + pub promoted_item: ActivityContentDetailsPromotedItem, /// The recommendation object contains information about a recommended resource. This property is only present if the snippet.type is recommendation. - pub recommendation: Option, + pub recommendation: ActivityContentDetailsRecommendation, /// 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, + pub favorite: ActivityContentDetailsFavorite, /// The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload. - pub upload: Option, + pub upload: ActivityContentDetailsUpload, /// The social object contains details about a social network post. This property is only present if the snippet.type is social. - pub social: Option, + pub social: ActivityContentDetailsSocial, /// The channelItem object contains details about a resource which was added to a channel. This property is only present if the snippet.type is channelItem. #[serde(alias="channelItem")] - pub channel_item: Option, + pub channel_item: ActivityContentDetailsChannelItem, /// The bulletin object contains details about a channel bulletin post. This object is only present if the snippet.type is bulletin. - pub bulletin: Option, + pub bulletin: ActivityContentDetailsBulletin, /// 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, + pub subscription: ActivityContentDetailsSubscription, } impl Part for ActivityContentDetails {} -impl RequestValue for ActivityContentDetails {} -impl ResponseResult for ActivityContentDetails {} -impl ActivityContentDetails { - /// 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.comment.is_some() { r = r + "comment,"; } - if self.playlist_item.is_some() { r = r + "playlistItem,"; } - if self.like.is_some() { r = r + "like,"; } - if self.promoted_item.is_some() { r = r + "promotedItem,"; } - if self.recommendation.is_some() { r = r + "recommendation,"; } - if self.favorite.is_some() { r = r + "favorite,"; } - if self.upload.is_some() { r = r + "upload,"; } - if self.social.is_some() { r = r + "social,"; } - if self.channel_item.is_some() { r = r + "channelItem,"; } - if self.bulletin.is_some() { r = r + "bulletin,"; } - if self.subscription.is_some() { r = r + "subscription,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -2065,28 +1563,28 @@ impl ActivityContentDetails { pub struct PlaylistListResponse { /// Serialized EventId of the request which produced this response. #[serde(alias="eventId")] - pub event_id: Option, + pub event_id: String, /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. #[serde(alias="nextPageToken")] - pub next_page_token: Option, + pub next_page_token: String, /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistListResponse". - pub kind: Option, + pub kind: String, /// The visitorId identifies the visitor. #[serde(alias="visitorId")] - pub visitor_id: Option, + pub visitor_id: String, /// A list of playlists that match the request criteria. - pub items: Option>, + pub items: Vec, /// no description provided #[serde(alias="tokenPagination")] - pub token_pagination: Option, + pub token_pagination: TokenPagination, /// Etag of this resource. - pub etag: Option, + pub etag: String, /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. #[serde(alias="prevPageToken")] - pub prev_page_token: Option, + pub prev_page_token: String, /// no description provided #[serde(alias="pageInfo")] - pub page_info: Option, + pub page_info: PageInfo, } impl ResponseResult for PlaylistListResponse {} @@ -2099,37 +1597,20 @@ impl ResponseResult for PlaylistListResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlaylistItemContentDetails { /// A user-generated note for this item. - pub note: Option, + pub note: String, /// The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0. #[serde(alias="startAt")] - pub start_at: Option, + pub start_at: String, /// The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video. #[serde(alias="endAt")] - pub end_at: Option, + pub end_at: String, /// The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request. #[serde(alias="videoId")] - pub video_id: Option, + pub video_id: String, } impl Part for PlaylistItemContentDetails {} -impl RequestValue for PlaylistItemContentDetails {} -impl ResponseResult for PlaylistItemContentDetails {} -impl cmn::Resource for PlaylistItemContentDetails {} -impl PlaylistItemContentDetails { - /// 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.note.is_some() { r = r + "note,"; } - if self.start_at.is_some() { r = r + "startAt,"; } - if self.end_at.is_some() { r = r + "endAt,"; } - if self.video_id.is_some() { r = r + "videoId,"; } - r.pop(); - r - } -} /// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. /// @@ -2139,29 +1620,14 @@ impl PlaylistItemContentDetails { pub struct ChannelContentOwnerDetails { /// The ID of the content owner linked to the channel. #[serde(alias="contentOwner")] - pub content_owner: Option, + pub content_owner: String, /// The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. #[serde(alias="timeLinked")] - pub time_linked: Option, + pub time_linked: String, } impl Part for ChannelContentOwnerDetails {} -impl RequestValue for ChannelContentOwnerDetails {} -impl ResponseResult for ChannelContentOwnerDetails {} -impl cmn::Resource for ChannelContentOwnerDetails {} -impl ChannelContentOwnerDetails { - /// 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.content_owner.is_some() { r = r + "contentOwner,"; } - if self.time_linked.is_some() { r = r + "timeLinked,"; } - r.pop(); - r - } -} /// Describes processing status and progress and availability of some other Video resource parts. /// @@ -2171,53 +1637,32 @@ impl ChannelContentOwnerDetails { pub struct VideoProcessingDetails { /// This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request. #[serde(alias="fileDetailsAvailability")] - pub file_details_availability: Option, + pub file_details_availability: String, /// This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. #[serde(alias="editorSuggestionsAvailability")] - pub editor_suggestions_availability: Option, + pub editor_suggestions_availability: String, /// The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed. #[serde(alias="processingStatus")] - pub processing_status: Option, + pub processing_status: String, /// This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. #[serde(alias="processingIssuesAvailability")] - pub processing_issues_availability: Option, + pub processing_issues_availability: String, /// The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed. #[serde(alias="processingFailureReason")] - pub processing_failure_reason: Option, + pub processing_failure_reason: String, /// This value indicates whether thumbnail images have been generated for the video. #[serde(alias="thumbnailsAvailability")] - pub thumbnails_availability: Option, + pub thumbnails_availability: String, /// The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing. #[serde(alias="processingProgress")] - pub processing_progress: Option, + pub processing_progress: VideoProcessingDetailsProcessingProgress, /// This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. #[serde(alias="tagSuggestionsAvailability")] - pub tag_suggestions_availability: Option, + pub tag_suggestions_availability: String, } impl Part for VideoProcessingDetails {} -impl RequestValue for VideoProcessingDetails {} -impl ResponseResult for VideoProcessingDetails {} -impl cmn::Resource for VideoProcessingDetails {} -impl VideoProcessingDetails { - /// 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.file_details_availability.is_some() { r = r + "fileDetailsAvailability,"; } - if self.editor_suggestions_availability.is_some() { r = r + "editorSuggestionsAvailability,"; } - if self.processing_status.is_some() { r = r + "processingStatus,"; } - if self.processing_issues_availability.is_some() { r = r + "processingIssuesAvailability,"; } - if self.processing_failure_reason.is_some() { r = r + "processingFailureReason,"; } - if self.thumbnails_availability.is_some() { r = r + "thumbnailsAvailability,"; } - if self.processing_progress.is_some() { r = r + "processingProgress,"; } - if self.tag_suggestions_availability.is_some() { r = r + "tagSuggestionsAvailability,"; } - r.pop(); - r - } -} /// There is no detailed description. /// @@ -2227,37 +1672,20 @@ impl VideoProcessingDetails { pub struct LiveBroadcastStatus { /// The broadcast's recording status. #[serde(alias="recordingStatus")] - pub recording_status: Option, + pub recording_status: String, /// The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource. #[serde(alias="privacyStatus")] - pub privacy_status: Option, + pub privacy_status: String, /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. #[serde(alias="lifeCycleStatus")] - pub life_cycle_status: Option, + pub life_cycle_status: String, /// Priority of the live broadcast event (internal state). #[serde(alias="liveBroadcastPriority")] - pub live_broadcast_priority: Option, + pub live_broadcast_priority: String, } impl Part for LiveBroadcastStatus {} -impl RequestValue for LiveBroadcastStatus {} -impl ResponseResult for LiveBroadcastStatus {} -impl cmn::Resource for LiveBroadcastStatus {} -impl LiveBroadcastStatus { - /// 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.recording_status.is_some() { r = r + "recordingStatus,"; } - if self.privacy_status.is_some() { r = r + "privacyStatus,"; } - if self.life_cycle_status.is_some() { r = r + "lifeCycleStatus,"; } - if self.live_broadcast_priority.is_some() { r = r + "liveBroadcastPriority,"; } - r.pop(); - r - } -} /// Details about the content to witch a subscription refers. /// @@ -2267,33 +1695,17 @@ impl LiveBroadcastStatus { pub struct SubscriptionContentDetails { /// The number of new items in the subscription since its content was last read. #[serde(alias="newItemCount")] - pub new_item_count: Option, + pub new_item_count: u32, /// The type of activity this subscription is for (only uploads, everything). #[serde(alias="activityType")] - pub activity_type: Option, + pub activity_type: String, /// The approximate number of items that the subscription points to. #[serde(alias="totalItemCount")] - pub total_item_count: Option, + pub total_item_count: u32, } impl Part for SubscriptionContentDetails {} -impl RequestValue for SubscriptionContentDetails {} -impl ResponseResult for SubscriptionContentDetails {} -impl cmn::Resource for SubscriptionContentDetails {} -impl SubscriptionContentDetails { - /// 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.new_item_count.is_some() { r = r + "newItemCount,"; } - if self.activity_type.is_some() { r = r + "activityType,"; } - if self.total_item_count.is_some() { r = r + "totalItemCount,"; } - r.pop(); - r - } -} /// A video resource represents a YouTube video. /// @@ -2404,31 +1816,15 @@ impl Video { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GeoPoint { /// Latitude in degrees. - pub latitude: Option, + pub latitude: f64, /// Altitude above the reference ellipsoid, in meters. - pub altitude: Option, + pub altitude: f64, /// Longitude in degrees. - pub longitude: Option, + pub longitude: f64, } impl Part for GeoPoint {} -impl RequestValue for GeoPoint {} -impl ResponseResult for GeoPoint {} -impl cmn::Resource for GeoPoint {} -impl GeoPoint { - /// 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.latitude.is_some() { r = r + "latitude,"; } - if self.altitude.is_some() { r = r + "altitude,"; } - if self.longitude.is_some() { r = r + "longitude,"; } - r.pop(); - r - } -} /// Branding properties of a YouTube channel. /// @@ -2437,34 +1833,17 @@ impl GeoPoint { #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelBrandingSettings { /// Branding properties for branding images. - pub image: Option, + pub image: ImageSettings, /// Branding properties for the watch page. - pub watch: Option, + pub watch: WatchSettings, /// Branding properties for the channel view. - pub channel: Option, + pub channel: ChannelSettings, /// Additional experimental branding properties. - pub hints: Option>, + pub hints: Vec, } impl Part for ChannelBrandingSettings {} -impl RequestValue for ChannelBrandingSettings {} -impl ResponseResult for ChannelBrandingSettings {} -impl cmn::Resource for ChannelBrandingSettings {} -impl ChannelBrandingSettings { - /// 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.image.is_some() { r = r + "image,"; } - if self.watch.is_some() { r = r + "watch,"; } - if self.channel.is_some() { r = r + "channel,"; } - if self.hints.is_some() { r = r + "hints,"; } - r.pop(); - r - } -} /// Player to be used for a video playback. /// @@ -2474,25 +1853,11 @@ impl ChannelBrandingSettings { pub struct VideoPlayer { /// An