diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index 4e7bf8be42..6d48811f05 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/src/cmn.rs @@ -21,7 +21,7 @@ pub trait Resource: MarkerTrait {} pub trait ResponseResult: MarkerTrait {} /// Identifies types which are used in API requests. -pub trait RequestResult: MarkerTrait {} +pub trait RequestValue: MarkerTrait {} /// Identifies types which are only used as part of other types, which /// usually are carrying the `Resource` trait. diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 7145bbb6d0..30f479b5cd 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -241,6 +241,7 @@ pub struct VideoConversionPings { impl Part for VideoConversionPings {} + /// There is no detailed description. /// /// # Activities @@ -275,6 +276,7 @@ pub struct SubscriptionListResponse { impl ResponseResult for SubscriptionListResponse {} + /// Information about a resource that received a positive (like) rating. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -287,6 +289,7 @@ pub struct ActivityContentDetailsLike { impl Part for ActivityContentDetailsLike {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -315,6 +318,7 @@ pub struct LiveBroadcastSnippet { impl Part for LiveBroadcastSnippet {} + /// 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. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -348,6 +352,7 @@ pub struct VideoFileDetails { impl Part for VideoFileDetails {} + /// Playlist localization setting /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -362,6 +367,7 @@ pub struct PlaylistLocalization { impl Part for PlaylistLocalization {} + /// A playlist resource represents a YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users. A playlist can contain up to 200 videos, and YouTube does not limit the number of playlists that each user creates. By default, playlists are publicly visible to other users, but playlists can be public or private. /// /// YouTube also uses playlists to identify special collections of videos for a channel, such as: @@ -404,10 +410,11 @@ pub struct Playlist { pub localizations: HashMap, } -impl RequestResult for Playlist {} +impl RequestValue for Playlist {} impl Resource for Playlist {} impl ResponseResult for Playlist {} + /// There is no detailed description. /// /// # Activities @@ -442,6 +449,7 @@ pub struct PlaylistItemListResponse { impl ResponseResult for PlaylistItemListResponse {} + /// A pair Property / Value. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -456,6 +464,7 @@ pub struct PropertyValue { impl Part for PropertyValue {} + /// Describes a temporal position of a visual widget inside a video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -472,6 +481,7 @@ pub struct InvideoTiming { impl Part for InvideoTiming {} + /// Basic details about a playlist, including title, description and thumbnails. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -500,6 +510,7 @@ pub struct PlaylistSnippet { impl Part for PlaylistSnippet {} + /// The auditDetails object encapsulates channel data that is relevant for YouTube Partners during the audit process. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -518,6 +529,7 @@ pub struct ChannelAuditDetails { impl Part for ChannelAuditDetails {} + /// A live stream describes a live ingestion point. /// /// # Activities @@ -547,10 +559,11 @@ pub struct LiveStream { pub id: Option, } -impl RequestResult for LiveStream {} +impl RequestValue for LiveStream {} impl Resource for LiveStream {} impl ResponseResult for LiveStream {} + /// There is no detailed description. /// /// # Activities @@ -577,6 +590,7 @@ pub struct ThumbnailSetResponse { impl ResponseResult for ThumbnailSetResponse {} + /// Information about the uploaded video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -589,6 +603,7 @@ pub struct ActivityContentDetailsUpload { impl Part for ActivityContentDetailsUpload {} + /// Branding properties for the channel view. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -625,6 +640,7 @@ pub struct ChannelSettings { impl Part for ChannelSettings {} + /// Statistics about the video, such as the number of times the video was viewed or liked. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -645,6 +661,7 @@ pub struct VideoStatistics { impl Part for VideoStatistics {} + /// Brief description of the live stream cdn settings. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -661,6 +678,7 @@ pub struct CdnSettings { impl Part for CdnSettings {} + /// There is no detailed description. /// /// # Activities @@ -687,6 +705,7 @@ pub struct VideoGetRatingResponse { impl ResponseResult for VideoGetRatingResponse {} + /// Basic details about a video category, such as its localized title. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -703,6 +722,7 @@ pub struct VideoCategorySnippet { impl Part for VideoCategorySnippet {} + /// Details about a resource which was added to a channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -715,6 +735,7 @@ pub struct ActivityContentDetailsChannelItem { impl Part for ActivityContentDetailsChannelItem {} + /// Basic details about an i18n language, such as language code and human-readable name. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -729,6 +750,7 @@ pub struct I18nLanguageSnippet { impl Part for I18nLanguageSnippet {} + /// Basic details about a subscription, including title, description and thumbnails of the subscribed item. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -753,6 +775,7 @@ pub struct SubscriptionSnippet { impl Part for SubscriptionSnippet {} + /// Details about a channelsection, including playlists and channels. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -767,6 +790,7 @@ pub struct ChannelSectionContentDetails { impl Part for ChannelSectionContentDetails {} + /// There is no detailed description. /// /// # Activities @@ -793,6 +817,7 @@ pub struct I18nRegionListResponse { impl ResponseResult for I18nRegionListResponse {} + /// There is no detailed description. /// /// # Activities @@ -827,6 +852,7 @@ pub struct LiveStreamListResponse { impl ResponseResult for LiveStreamListResponse {} + /// Describes a single promoted item. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -845,6 +871,7 @@ pub struct PromotedItem { impl Part for PromotedItem {} + /// Branding properties of a YouTube channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -863,6 +890,7 @@ pub struct ChannelBrandingSettings { impl Part for ChannelBrandingSettings {} + /// There is no detailed description. /// /// # Activities @@ -897,6 +925,7 @@ pub struct PlaylistListResponse { impl ResponseResult for PlaylistListResponse {} + /// There is no detailed description. /// /// # Activities @@ -921,7 +950,8 @@ pub struct InvideoBranding { pub image_bytes: Option, } -impl RequestResult for InvideoBranding {} +impl RequestValue for InvideoBranding {} + /// Information about the playlist item's privacy status. /// @@ -935,6 +965,7 @@ pub struct PlaylistItemStatus { impl Part for PlaylistItemStatus {} + /// 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. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -949,6 +980,7 @@ pub struct ChannelConversionPing { impl Part for ChannelConversionPing {} + /// Describes an invideo promotion campaign consisting of multiple promoted items. A campaign belongs to a single channel_id. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -967,6 +999,7 @@ pub struct InvideoPromotion { impl Part for InvideoPromotion {} + /// 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. /// /// YouTube uses playlists to identify special collections of videos for a channel, such as: @@ -1003,10 +1036,11 @@ pub struct PlaylistItem { pub id: Option, } -impl RequestResult for PlaylistItem {} +impl RequestValue for PlaylistItem {} impl Resource for PlaylistItem {} impl ResponseResult for PlaylistItem {} + /// There is no detailed description. /// /// # Activities @@ -1041,6 +1075,7 @@ pub struct GuideCategoryListResponse { impl ResponseResult for GuideCategoryListResponse {} + /// Localized versions of certain video properties (e.g. title). /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1055,6 +1090,7 @@ pub struct VideoLocalization { impl Part for VideoLocalization {} + /// Basic details about a channel section, including title, style and position. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1079,6 +1115,7 @@ pub struct ChannelSectionSnippet { impl Part for ChannelSectionSnippet {} + /// Details about the content of a channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1093,6 +1130,7 @@ pub struct ChannelContentDetails { impl Part for ChannelContentDetails {} + /// Stub token pagination template to suppress results. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1102,6 +1140,7 @@ pub struct TokenPagination; impl Part for TokenPagination {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1120,6 +1159,7 @@ pub struct PlaylistItemContentDetails { impl Part for PlaylistItemContentDetails {} + /// Internal representation of thumbnails for a YouTube resource. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1140,6 +1180,7 @@ pub struct ThumbnailDetails { impl Part for ThumbnailDetails {} + /// Details about monetization of a YouTube Video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1152,6 +1193,7 @@ pub struct VideoMonetizationDetails { impl Part for VideoMonetizationDetails {} + /// Information that identifies the recommended resource. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1168,6 +1210,7 @@ pub struct ActivityContentDetailsRecommendation { impl Part for ActivityContentDetailsRecommendation {} + /// Recording information associated with the video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1184,6 +1227,7 @@ pub struct VideoRecordingDetails { impl Part for VideoRecordingDetails {} + /// Information about a channel that a user subscribed to. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1196,6 +1240,7 @@ pub struct ActivityContentDetailsSubscription { impl Part for ActivityContentDetailsSubscription {} + /// The conversionPings object encapsulates information about conversion pings that need to be respected by the channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1208,6 +1253,7 @@ pub struct ChannelConversionPings { impl Part for ChannelConversionPings {} + /// Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1240,6 +1286,7 @@ pub struct ActivityContentDetails { impl Part for ActivityContentDetails {} + /// A i18nRegion resource identifies a region where YouTube is available. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1258,6 +1305,7 @@ pub struct I18nRegion { impl Part for I18nRegion {} + /// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1272,6 +1320,7 @@ pub struct ChannelContentOwnerDetails { impl Part for ChannelContentOwnerDetails {} + /// Describes processing status and progress and availability of some other Video resource parts. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1298,6 +1347,7 @@ pub struct VideoProcessingDetails { impl Part for VideoProcessingDetails {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1316,6 +1366,7 @@ pub struct LiveBroadcastStatus { impl Part for LiveBroadcastStatus {} + /// Details about the content to witch a subscription refers. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1332,6 +1383,7 @@ pub struct SubscriptionContentDetails { impl Part for SubscriptionContentDetails {} + /// A video resource represents a YouTube video. /// /// # Activities @@ -1391,10 +1443,11 @@ pub struct Video { pub recording_details: Option, } -impl RequestResult for Video {} +impl RequestValue for Video {} impl Resource for Video {} impl ResponseResult for Video {} + /// Geographical coordinates of a point, in WGS84. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1411,6 +1464,7 @@ pub struct GeoPoint { impl Part for GeoPoint {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1427,6 +1481,7 @@ pub struct VideoAgeGating { impl Part for VideoAgeGating {} + /// Player to be used for a video playback. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1439,6 +1494,7 @@ pub struct VideoPlayer { impl Part for VideoPlayer {} + /// Basic details about a channel, including title, description and thumbnails. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1461,6 +1517,7 @@ pub struct ChannelSnippet { impl Part for ChannelSnippet {} + /// Branding properties for the watch. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1477,6 +1534,7 @@ pub struct WatchSettings { impl Part for WatchSettings {} + /// ChannelSection localization setting /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1489,6 +1547,7 @@ pub struct ChannelSectionLocalization { impl Part for ChannelSectionLocalization {} + /// DEPRECATED Region restriction of the video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1503,6 +1562,7 @@ pub struct VideoContentDetailsRegionRestriction { impl Part for VideoContentDetailsRegionRestriction {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1517,6 +1577,7 @@ pub struct VideoRating { impl Part for VideoRating {} + /// Describes a single promoted item id. It is a union of various possible types. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1535,6 +1596,7 @@ pub struct PromotedItemId { impl Part for PromotedItemId {} + /// A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video. /// /// # Activities @@ -1563,10 +1625,11 @@ pub struct Subscription { pub id: Option, } -impl RequestResult for Subscription {} +impl RequestValue for Subscription {} impl Resource for Subscription {} impl ResponseResult for Subscription {} + /// Basic details about an i18n region, such as region code and human-readable name. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1581,6 +1644,7 @@ pub struct I18nRegionSnippet { impl Part for I18nRegionSnippet {} + /// Information about a new playlist item. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1597,6 +1661,7 @@ pub struct ActivityContentDetailsPlaylistItem { impl Part for ActivityContentDetailsPlaylistItem {} + /// Describes the spatial position of a visual widget inside a video. It is a union of various position types, out of which only will be set one. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1611,6 +1676,7 @@ pub struct InvideoPosition { impl Part for InvideoPosition {} + /// Information about a resource that received a comment. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1623,6 +1689,7 @@ pub struct ActivityContentDetailsComment { impl Part for ActivityContentDetailsComment {} + /// Basic details about a guide category. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1637,6 +1704,7 @@ pub struct GuideCategorySnippet { impl Part for GuideCategorySnippet {} + /// Basic details about a video, including title, description, uploader, thumbnails and category. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1669,6 +1737,7 @@ pub struct VideoSnippet { impl Part for VideoSnippet {} + /// Project specific details about the content of a YouTube Video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1681,6 +1750,7 @@ pub struct VideoProjectDetails { impl Part for VideoProjectDetails {} + /// Detailed settings of a stream. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1700,6 +1770,7 @@ pub struct LiveStreamContentDetails { impl Part for LiveStreamContentDetails {} + /// Detailed settings of a broadcast. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1734,6 +1805,7 @@ pub struct LiveBroadcastContentDetails { impl Part for LiveBroadcastContentDetails {} + /// Basic details about a video category, such as its localized title. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1760,6 +1832,7 @@ pub struct VideoStatus { impl Part for VideoStatus {} + /// A guideCategory resource identifies a category that YouTube algorithmically assigns based on a channel's content or other indicators, such as the channel's popularity. The list is similar to video categories, with the difference being that a video's uploader can assign a video category but only YouTube can assign a channel category. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1778,6 +1851,7 @@ pub struct GuideCategory { impl Part for GuideCategory {} + /// There is no detailed description. /// /// # Activities @@ -1804,6 +1878,7 @@ pub struct ChannelSectionListResponse { impl ResponseResult for ChannelSectionListResponse {} + /// Settings and Info of the monitor stream /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1824,6 +1899,7 @@ pub struct MonitorStreamInfo { impl Part for MonitorStreamInfo {} + /// There is no detailed description. /// /// # Activities @@ -1850,6 +1926,7 @@ pub struct I18nLanguageListResponse { impl ResponseResult for I18nLanguageListResponse {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1866,6 +1943,7 @@ pub struct LocalizedProperty { impl Part for LocalizedProperty {} + /// A liveBroadcast resource represents an event that will be streamed, via live video, on YouTube. /// /// # Activities @@ -1896,10 +1974,11 @@ pub struct LiveBroadcast { pub id: Option, } -impl RequestResult for LiveBroadcast {} +impl RequestValue for LiveBroadcast {} impl Resource for LiveBroadcast {} impl ResponseResult for LiveBroadcast {} + /// Information about a video stream. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1926,6 +2005,7 @@ pub struct VideoFileDetailsVideoStream { impl Part for VideoFileDetailsVideoStream {} + /// A thumbnail is an image representing a YouTube resource. /// /// # Activities @@ -1948,6 +2028,7 @@ pub struct Thumbnail { impl Resource for Thumbnail {} + /// A channel resource contains information about a YouTube channel. /// /// # Activities @@ -1991,10 +2072,11 @@ pub struct Channel { pub localizations: HashMap, } -impl RequestResult for Channel {} +impl RequestValue for Channel {} impl Resource for Channel {} impl ResponseResult for Channel {} + /// Statistics about a channel: number of subscribers, number of videos in the channel, etc. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2015,6 +2097,7 @@ pub struct ChannelStatistics { impl Part for ChannelStatistics {} + /// Details about a social network post. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2035,6 +2118,7 @@ pub struct ActivityContentDetailsSocial { impl Part for ActivityContentDetailsSocial {} + /// Channel localization setting /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2049,6 +2133,7 @@ pub struct ChannelLocalization { impl Part for ChannelLocalization {} + /// A resource id is a generic reference that points to another YouTube resource. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2067,6 +2152,7 @@ pub struct ResourceId { impl Part for ResourceId {} + /// A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2085,6 +2171,7 @@ pub struct SearchResult { impl Part for SearchResult {} + /// There is no detailed description. /// /// # Activities @@ -2119,6 +2206,7 @@ pub struct VideoCategoryListResponse { impl ResponseResult for VideoCategoryListResponse {} + /// Basic details about an activity, including title, description, thumbnails, activity type and group. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2145,6 +2233,7 @@ pub struct ActivitySnippet { impl Part for ActivitySnippet {} + /// Video processing progress and completion time estimate. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2164,6 +2253,7 @@ pub struct VideoProcessingDetailsProcessingProgress { impl Part for VideoProcessingDetailsProcessingProgress {} + /// There is no detailed description. /// /// # Activities @@ -2198,6 +2288,7 @@ pub struct SearchListResponse { impl ResponseResult for SearchListResponse {} + /// Freebase topic information related to the channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2210,6 +2301,7 @@ pub struct ChannelTopicDetails { impl Part for ChannelTopicDetails {} + /// There is no detailed description. /// /// # Activities @@ -2244,6 +2336,7 @@ pub struct VideoListResponse { impl ResponseResult for VideoListResponse {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2256,6 +2349,7 @@ pub struct LanguageTag { impl Part for LanguageTag {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2268,6 +2362,7 @@ pub struct PlaylistStatus { impl Part for PlaylistStatus {} + /// Details about the content of a YouTube Video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2294,6 +2389,7 @@ pub struct VideoContentDetails { impl Part for VideoContentDetails {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2312,6 +2408,7 @@ pub struct LiveStreamSnippet { impl Part for LiveStreamSnippet {} + /// JSON template for the status part of a channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2328,6 +2425,7 @@ pub struct ChannelStatus { impl Part for ChannelStatus {} + /// There is no detailed description. /// /// # Activities @@ -2362,6 +2460,7 @@ pub struct ChannelListResponse { impl ResponseResult for ChannelListResponse {} + /// There is no detailed description. /// /// # Activities @@ -2389,10 +2488,11 @@ pub struct ChannelSection { pub localizations: HashMap, } -impl RequestResult for ChannelSection {} +impl RequestValue for ChannelSection {} impl Resource for ChannelSection {} impl ResponseResult for ChannelSection {} + /// There is no detailed description. /// /// # Activities @@ -2427,6 +2527,7 @@ pub struct LiveBroadcastListResponse { impl ResponseResult for LiveBroadcastListResponse {} + /// Brief description of the live stream status. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2439,6 +2540,7 @@ pub struct LiveStreamStatus { impl Part for LiveStreamStatus {} + /// Details about the live streaming metadata. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2459,6 +2561,7 @@ pub struct VideoLiveStreamingDetails { impl Part for VideoLiveStreamingDetails {} + /// Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 65 /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2597,6 +2700,7 @@ pub struct ContentRating { impl Part for ContentRating {} + /// There is no detailed description. /// /// # Activities @@ -2631,6 +2735,7 @@ pub struct ActivityListResponse { impl ResponseResult for ActivityListResponse {} + /// An activity resource contains information about an action that a particular channel, or user, has taken on YouTube.The actions reported in activity feeds include rating a video, sharing a video, marking a video as a favorite, commenting on a video, uploading a video, and so forth. Each activity resource identifies the type of action, the channel associated with the action, and the resource(s) associated with the action, such as the video that was rated or uploaded. /// /// # Activities @@ -2655,9 +2760,10 @@ pub struct Activity { pub id: Option, } -impl RequestResult for Activity {} +impl RequestValue for Activity {} impl ResponseResult for Activity {} + /// Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2676,6 +2782,7 @@ pub struct SubscriptionSubscriberSnippet { impl Part for SubscriptionSubscriberSnippet {} + /// Branding properties for images associated with the channel. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2730,6 +2837,7 @@ pub struct ImageSettings { impl Part for ImageSettings {} + /// Details about a resource which is being promoted. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2760,6 +2868,7 @@ pub struct ActivityContentDetailsPromotedItem { impl Part for ActivityContentDetailsPromotedItem {} + /// Rights management policy for YouTube resources. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2774,6 +2883,7 @@ pub struct AccessPolicy { impl Part for AccessPolicy {} + /// Details about a channel bulletin post. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2786,6 +2896,7 @@ pub struct ActivityContentDetailsBulletin { impl Part for ActivityContentDetailsBulletin {} + /// An i18nLanguage resource identifies a UI language currently supported by YouTube. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2804,6 +2915,7 @@ pub struct I18nLanguage { impl Part for I18nLanguage {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2818,6 +2930,7 @@ pub struct LocalizedString { impl Part for LocalizedString {} + /// Information about an audio stream. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2836,6 +2949,7 @@ pub struct VideoFileDetailsAudioStream { impl Part for VideoFileDetailsAudioStream {} + /// Freebase topic information related to the video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2850,6 +2964,7 @@ pub struct VideoTopicDetails { impl Part for VideoTopicDetails {} + /// Describes information necessary for ingesting an RTMP or an HTTP stream. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2870,6 +2985,7 @@ pub struct IngestionInfo { impl Part for IngestionInfo {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2884,6 +3000,7 @@ pub struct VideoConversionPing { impl Part for VideoConversionPing {} + /// A videoCategory resource identifies a category that has been or could be associated with uploaded videos. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2902,6 +3019,7 @@ pub struct VideoCategory { impl Part for VideoCategory {} + /// Basic details about a playlist, including title, description and thumbnails. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2930,6 +3048,7 @@ pub struct PlaylistItemSnippet { impl Part for PlaylistItemSnippet {} + /// Information about a video that was marked as a favorite video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2942,6 +3061,7 @@ pub struct ActivityContentDetailsFavorite { impl Part for ActivityContentDetailsFavorite {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2954,6 +3074,7 @@ pub struct PlaylistPlayer { impl Part for PlaylistPlayer {} + /// A single tag suggestion with it's relevance information. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2968,6 +3089,7 @@ pub struct VideoSuggestionsTagSuggestion { impl Part for VideoSuggestionsTagSuggestion {} + /// Specifies suggestions on how to improve video content, including encoding hints, tag suggestions, and editor suggestions. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2988,6 +3110,7 @@ pub struct VideoSuggestions { impl Part for VideoSuggestions {} + /// Basic details about a search result, including title, description and thumbnails of the item referenced by the search result. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3012,6 +3135,7 @@ pub struct SearchResultSnippet { impl Part for SearchResultSnippet {} + /// A channel banner returned as the response to a channel_banner.insert call. /// /// # Activities @@ -3032,9 +3156,10 @@ pub struct ChannelBannerResource { pub etag: Option, } -impl RequestResult for ChannelBannerResource {} +impl RequestValue for ChannelBannerResource {} impl ResponseResult for ChannelBannerResource {} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3047,6 +3172,7 @@ pub struct PlaylistContentDetails { impl Part for PlaylistContentDetails {} + /// Paging details for lists of resources, including total number of items available and number of resources returned in a single page. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3062,6 +3188,7 @@ pub struct PageInfo { impl Part for PageInfo {} + // ################### // NESTED SCHEMAS ### // ################# @@ -3087,6 +3214,7 @@ impl NestedType for ChannelContentDetailsRelatedplaylists {} impl Part for ChannelContentDetailsRelatedplaylists {} + // ################### // MethodBuilders ### // ################# @@ -3135,10 +3263,10 @@ impl<'a, C, NC, A> I18nLanguageMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of supported languages. - pub fn list(&self) -> I18nLanguageListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> I18nLanguageListMethodBuilder<'a, C, NC, A> { I18nLanguageListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _hl: Default::default(), } } @@ -3248,10 +3376,10 @@ impl<'a, C, NC, A> ChannelSectionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns channelSection resources that match the API request criteria. - pub fn list(&self) -> ChannelSectionListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> ChannelSectionListMethodBuilder<'a, C, NC, A> { ChannelSectionListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _on_behalf_of_content_owner: Default::default(), _mine: Default::default(), _id: Default::default(), @@ -3262,10 +3390,11 @@ impl<'a, C, NC, A> ChannelSectionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Adds a channelSection for the authenticated user's channel. - pub fn insert(&self) -> ChannelSectionInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &ChannelSection) -> ChannelSectionInsertMethodBuilder<'a, C, NC, A> { ChannelSectionInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -3274,10 +3403,10 @@ impl<'a, C, NC, A> ChannelSectionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a channelSection. - pub fn delete(&self) -> ChannelSectionDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> ChannelSectionDeleteMethodBuilder<'a, C, NC, A> { ChannelSectionDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3285,10 +3414,11 @@ impl<'a, C, NC, A> ChannelSectionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Update a channelSection. - pub fn update(&self) -> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &ChannelSection) -> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { ChannelSectionUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner: Default::default(), } } @@ -3340,10 +3470,10 @@ impl<'a, C, NC, A> GuideCategoryMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of categories that can be associated with YouTube channels. - pub fn list(&self) -> GuideCategoryListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> GuideCategoryListMethodBuilder<'a, C, NC, A> { GuideCategoryListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _region_code: Default::default(), _id: Default::default(), _hl: Default::default(), @@ -3397,10 +3527,11 @@ impl<'a, C, NC, A> PlaylistMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Creates a playlist. - pub fn insert(&self) -> PlaylistInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &Playlist) -> PlaylistInsertMethodBuilder<'a, C, NC, A> { PlaylistInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -3409,10 +3540,10 @@ impl<'a, C, NC, A> PlaylistMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs. - pub fn list(&self) -> PlaylistListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> PlaylistListMethodBuilder<'a, C, NC, A> { PlaylistListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _page_token: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -3426,10 +3557,10 @@ impl<'a, C, NC, A> PlaylistMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a playlist. - pub fn delete(&self) -> PlaylistDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> PlaylistDeleteMethodBuilder<'a, C, NC, A> { PlaylistDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3437,10 +3568,11 @@ impl<'a, C, NC, A> PlaylistMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. - pub fn update(&self) -> PlaylistUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &Playlist) -> PlaylistUpdateMethodBuilder<'a, C, NC, A> { PlaylistUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner: Default::default(), } } @@ -3492,10 +3624,10 @@ impl<'a, C, NC, A> ThumbnailMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Uploads a custom video thumbnail to YouTube and sets it for a video. - pub fn set(&self) -> ThumbnailSetMethodBuilder<'a, C, NC, A> { + pub fn set(&self, video_id: &str) -> ThumbnailSetMethodBuilder<'a, C, NC, A> { ThumbnailSetMethodBuilder { hub: self.hub, - _video_id: Default::default(), + _video_id: video_id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3547,10 +3679,10 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of videos that match the API request parameters. - pub fn list(&self) -> VideoListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> VideoListMethodBuilder<'a, C, NC, A> { VideoListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _video_category_id: Default::default(), _region_code: Default::default(), _page_token: Default::default(), @@ -3567,11 +3699,11 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Add a like or dislike rating to a video or remove a rating from a video. - pub fn rate(&self) -> VideoRateMethodBuilder<'a, C, NC, A> { + pub fn rate(&self, id: &str, rating: &str) -> VideoRateMethodBuilder<'a, C, NC, A> { VideoRateMethodBuilder { hub: self.hub, - _id: Default::default(), - _rating: Default::default(), + _id: id.to_string(), + _rating: rating.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3579,10 +3711,10 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Retrieves the ratings that the authorized user gave to a list of specified videos. - pub fn get_rating(&self) -> VideoGetratingMethodBuilder<'a, C, NC, A> { + pub fn get_rating(&self, id: &str) -> VideoGetratingMethodBuilder<'a, C, NC, A> { VideoGetratingMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3590,10 +3722,10 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a YouTube video. - pub fn delete(&self) -> VideoDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> VideoDeleteMethodBuilder<'a, C, NC, A> { VideoDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -3601,10 +3733,11 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Updates a video's metadata. - pub fn update(&self) -> VideoUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &Video) -> VideoUpdateMethodBuilder<'a, C, NC, A> { VideoUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner: Default::default(), } } @@ -3612,10 +3745,11 @@ impl<'a, C, NC, A> VideoMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Uploads a video to YouTube and optionally sets the video's metadata. - pub fn insert(&self) -> VideoInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &Video) -> VideoInsertMethodBuilder<'a, C, NC, A> { VideoInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _stabilize: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -3671,20 +3805,21 @@ impl<'a, C, NC, A> SubscriptionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Adds a subscription for the authenticated user's channel. - pub fn insert(&self) -> SubscriptionInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &Subscription) -> SubscriptionInsertMethodBuilder<'a, C, NC, A> { SubscriptionInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), } } /// Create a builder to help you perform the following task: /// /// Returns subscription resources that match the API request criteria. - pub fn list(&self) -> SubscriptionListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> SubscriptionListMethodBuilder<'a, C, NC, A> { SubscriptionListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _page_token: Default::default(), _order: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), @@ -3701,10 +3836,10 @@ impl<'a, C, NC, A> SubscriptionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a subscription. - pub fn delete(&self) -> SubscriptionDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> SubscriptionDeleteMethodBuilder<'a, C, NC, A> { SubscriptionDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), } } } @@ -3755,10 +3890,10 @@ impl<'a, C, NC, A> SearchMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource. - pub fn list(&self) -> SearchListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> SearchListMethodBuilder<'a, C, NC, A> { SearchListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _video_type: Default::default(), _video_syndicated: Default::default(), _video_license: Default::default(), @@ -3838,10 +3973,10 @@ impl<'a, C, NC, A> I18nRegionMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of supported regions. - pub fn list(&self) -> I18nRegionListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> I18nRegionListMethodBuilder<'a, C, NC, A> { I18nRegionListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _hl: Default::default(), } } @@ -3893,10 +4028,11 @@ impl<'a, C, NC, A> LiveStreamMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings. - pub fn update(&self) -> LiveStreamUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &LiveStream) -> LiveStreamUpdateMethodBuilder<'a, C, NC, A> { LiveStreamUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -3905,10 +4041,10 @@ impl<'a, C, NC, A> LiveStreamMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a video stream. - pub fn delete(&self) -> LiveStreamDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> LiveStreamDeleteMethodBuilder<'a, C, NC, A> { LiveStreamDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -3917,10 +4053,10 @@ impl<'a, C, NC, A> LiveStreamMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of video streams that match the API request parameters. - pub fn list(&self) -> LiveStreamListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> LiveStreamListMethodBuilder<'a, C, NC, A> { LiveStreamListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _page_token: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -3933,10 +4069,11 @@ impl<'a, C, NC, A> LiveStreamMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience. - pub fn insert(&self) -> LiveStreamInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &LiveStream) -> LiveStreamInsertMethodBuilder<'a, C, NC, A> { LiveStreamInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -3989,10 +4126,11 @@ impl<'a, C, NC, A> ChannelMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Updates a channel's metadata. - pub fn update(&self) -> ChannelUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &Channel) -> ChannelUpdateMethodBuilder<'a, C, NC, A> { ChannelUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner: Default::default(), } } @@ -4000,10 +4138,10 @@ impl<'a, C, NC, A> ChannelMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a collection of zero or more channel resources that match the request criteria. - pub fn list(&self) -> ChannelListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> ChannelListMethodBuilder<'a, C, NC, A> { ChannelListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _page_token: Default::default(), _on_behalf_of_content_owner: Default::default(), _my_subscribers: Default::default(), @@ -4063,20 +4201,20 @@ impl<'a, C, NC, A> PlaylistItemMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a playlist item. - pub fn delete(&self) -> PlaylistItemDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> PlaylistItemDeleteMethodBuilder<'a, C, NC, A> { PlaylistItemDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), } } /// Create a builder to help you perform the following task: /// /// Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs. - pub fn list(&self) -> PlaylistItemListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> PlaylistItemListMethodBuilder<'a, C, NC, A> { PlaylistItemListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _video_id: Default::default(), _playlist_id: Default::default(), _page_token: Default::default(), @@ -4089,10 +4227,11 @@ impl<'a, C, NC, A> PlaylistItemMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Adds a resource to a playlist. - pub fn insert(&self) -> PlaylistItemInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &PlaylistItem) -> PlaylistItemInsertMethodBuilder<'a, C, NC, A> { PlaylistItemInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner: Default::default(), } } @@ -4100,10 +4239,11 @@ impl<'a, C, NC, A> PlaylistItemMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Modifies a playlist item. For example, you could update the item's position in the playlist. - pub fn update(&self) -> PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &PlaylistItem) -> PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { PlaylistItemUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), } } } @@ -4154,10 +4294,10 @@ impl<'a, C, NC, A> WatermarkMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Uploads a watermark image to YouTube and sets it for a channel. - pub fn set(&self) -> WatermarkSetMethodBuilder<'a, C, NC, A> { + pub fn set(&self, channel_id: &str) -> WatermarkSetMethodBuilder<'a, C, NC, A> { WatermarkSetMethodBuilder { hub: self.hub, - _channel_id: Default::default(), + _channel_id: channel_id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -4165,10 +4305,10 @@ impl<'a, C, NC, A> WatermarkMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a watermark. - pub fn unset(&self) -> WatermarkUnsetMethodBuilder<'a, C, NC, A> { + pub fn unset(&self, channel_id: &str) -> WatermarkUnsetMethodBuilder<'a, C, NC, A> { WatermarkUnsetMethodBuilder { hub: self.hub, - _channel_id: Default::default(), + _channel_id: channel_id.to_string(), _on_behalf_of_content_owner: Default::default(), } } @@ -4220,11 +4360,11 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Controls the settings for a slate that can be displayed in the broadcast stream. - pub fn control(&self) -> LiveBroadcastControlMethodBuilder<'a, C, NC, A> { + pub fn control(&self, id: &str, part: &str) -> LiveBroadcastControlMethodBuilder<'a, C, NC, A> { LiveBroadcastControlMethodBuilder { hub: self.hub, - _id: Default::default(), - _part: Default::default(), + _id: id.to_string(), + _part: part.to_string(), _walltime: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -4236,10 +4376,11 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object. - pub fn update(&self) -> LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { + pub fn update(&self, request: &LiveBroadcast) -> LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { LiveBroadcastUpdateMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -4248,10 +4389,11 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Creates a broadcast. - pub fn insert(&self) -> LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, request: &LiveBroadcast) -> LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { LiveBroadcastInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _request: request.clone(), + _part: request.to_parts(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -4260,11 +4402,11 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream. - pub fn bind(&self) -> LiveBroadcastBindMethodBuilder<'a, C, NC, A> { + pub fn bind(&self, id: &str, part: &str) -> LiveBroadcastBindMethodBuilder<'a, C, NC, A> { LiveBroadcastBindMethodBuilder { hub: self.hub, - _id: Default::default(), - _part: Default::default(), + _id: id.to_string(), + _part: part.to_string(), _stream_id: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -4274,10 +4416,10 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of YouTube broadcasts that match the API request parameters. - pub fn list(&self) -> LiveBroadcastListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> LiveBroadcastListMethodBuilder<'a, C, NC, A> { LiveBroadcastListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _page_token: Default::default(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), @@ -4291,10 +4433,10 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Deletes a broadcast. - pub fn delete(&self) -> LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> { + pub fn delete(&self, id: &str) -> LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> { LiveBroadcastDeleteMethodBuilder { hub: self.hub, - _id: Default::default(), + _id: id.to_string(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -4303,12 +4445,12 @@ impl<'a, C, NC, A> LiveBroadcastMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. - pub fn transition(&self) -> LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { + pub fn transition(&self, broadcast_status: &str, id: &str, part: &str) -> LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { LiveBroadcastTransitionMethodBuilder { hub: self.hub, - _broadcast_status: Default::default(), - _id: Default::default(), - _part: Default::default(), + _broadcast_status: broadcast_status.to_string(), + _id: id.to_string(), + _part: part.to_string(), _on_behalf_of_content_owner_channel: Default::default(), _on_behalf_of_content_owner: Default::default(), } @@ -4361,10 +4503,10 @@ impl<'a, C, NC, A> VideoCategoryMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of categories that can be associated with YouTube videos. - pub fn list(&self) -> VideoCategoryListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> VideoCategoryListMethodBuilder<'a, C, NC, A> { VideoCategoryListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _region_code: Default::default(), _id: Default::default(), _hl: Default::default(), @@ -4418,10 +4560,10 @@ impl<'a, C, NC, A> ActivityMethodsBuilder<'a, C, NC, A> { /// Create a builder to help you perform the following task: /// /// Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. - pub fn list(&self) -> ActivityListMethodBuilder<'a, C, NC, A> { + pub fn list(&self, part: &str) -> ActivityListMethodBuilder<'a, C, NC, A> { ActivityListMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), _region_code: Default::default(), _published_before: Default::default(), _published_after: Default::default(), @@ -4438,10 +4580,10 @@ impl<'a, C, NC, A> ActivityMethodsBuilder<'a, C, NC, A> { /// Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) /// /// Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. - pub fn insert(&self) -> ActivityInsertMethodBuilder<'a, C, NC, A> { + pub fn insert(&self, part: &str) -> ActivityInsertMethodBuilder<'a, C, NC, A> { ActivityInsertMethodBuilder { hub: self.hub, - _part: Default::default(), + _part: part.to_string(), } } } @@ -4495,8 +4637,8 @@ pub struct I18nLanguageListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _hl: Option, + _part: String, + _hl: Option, } impl<'a, C, NC, A> MethodBuilder for I18nLanguageListMethodBuilder<'a, C, NC, A> {} @@ -4517,7 +4659,7 @@ impl<'a, C, NC, A> I18nLanguageListMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more i18nLanguage resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. pub fn part(&mut self, new_value: &str) -> &mut I18nLanguageListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *hl* query property to the given value. @@ -4576,7 +4718,7 @@ pub struct ChannelBannerInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _on_behalf_of_content_owner: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelBannerInsertMethodBuilder<'a, C, NC, A> {} @@ -4644,11 +4786,11 @@ pub struct ChannelSectionListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, - _mine: Option, - _id: Option, - _channel_id: Option, + _part: String, + _on_behalf_of_content_owner: Option, + _mine: Option, + _id: Option, + _channel_id: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelSectionListMethodBuilder<'a, C, NC, A> {} @@ -4671,7 +4813,7 @@ impl<'a, C, NC, A> ChannelSectionListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut ChannelSectionListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -4752,9 +4894,10 @@ pub struct ChannelSectionInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: ChannelSection, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelSectionInsertMethodBuilder<'a, C, NC, A> {} @@ -4768,6 +4911,15 @@ impl<'a, C, NC, A> ChannelSectionInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &ChannelSection) -> &mut ChannelSectionInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -4780,7 +4932,7 @@ impl<'a, C, NC, A> ChannelSectionInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet and contentDetails. pub fn part(&mut self, new_value: &str) -> &mut ChannelSectionInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -4849,8 +5001,8 @@ pub struct ChannelSectionDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelSectionDeleteMethodBuilder<'a, C, NC, A> {} @@ -4871,7 +5023,7 @@ impl<'a, C, NC, A> ChannelSectionDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID. pub fn id(&mut self, new_value: &str) -> &mut ChannelSectionDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -4928,8 +5080,9 @@ pub struct ChannelSectionUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, + _request: ChannelSection, + _part: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelSectionUpdateMethodBuilder<'a, C, NC, A> {} @@ -4943,6 +5096,15 @@ impl<'a, C, NC, A> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &ChannelSection) -> &mut ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -4955,7 +5117,7 @@ impl<'a, C, NC, A> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet and contentDetails. pub fn part(&mut self, new_value: &str) -> &mut ChannelSectionUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5012,10 +5174,10 @@ pub struct GuideCategoryListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _region_code: Option, - _id: Option, - _hl: Option, + _part: String, + _region_code: Option, + _id: Option, + _hl: Option, } impl<'a, C, NC, A> MethodBuilder for GuideCategoryListMethodBuilder<'a, C, NC, A> {} @@ -5038,7 +5200,7 @@ impl<'a, C, NC, A> GuideCategoryListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut GuideCategoryListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *region code* query property to the given value. @@ -5109,9 +5271,10 @@ pub struct PlaylistInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: Playlist, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistInsertMethodBuilder<'a, C, NC, A> {} @@ -5125,6 +5288,15 @@ impl<'a, C, NC, A> PlaylistInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Playlist) -> &mut PlaylistInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -5137,7 +5309,7 @@ impl<'a, C, NC, A> PlaylistInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet and status. pub fn part(&mut self, new_value: &str) -> &mut PlaylistInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -5206,14 +5378,14 @@ pub struct PlaylistListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _page_token: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _mine: Option, - _max_results: Option, - _id: Option, - _channel_id: Option, + _part: String, + _page_token: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _mine: Option, + _max_results: Option, + _id: Option, + _channel_id: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistListMethodBuilder<'a, C, NC, A> {} @@ -5236,7 +5408,7 @@ impl<'a, C, NC, A> PlaylistListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. pub fn part(&mut self, new_value: &str) -> &mut PlaylistListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *page token* query property to the given value. @@ -5345,8 +5517,8 @@ pub struct PlaylistDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistDeleteMethodBuilder<'a, C, NC, A> {} @@ -5367,7 +5539,7 @@ impl<'a, C, NC, A> PlaylistDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID. pub fn id(&mut self, new_value: &str) -> &mut PlaylistDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5424,8 +5596,9 @@ pub struct PlaylistUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, + _request: Playlist, + _part: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistUpdateMethodBuilder<'a, C, NC, A> {} @@ -5439,6 +5612,15 @@ impl<'a, C, NC, A> PlaylistUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Playlist) -> &mut PlaylistUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -5453,7 +5635,7 @@ impl<'a, C, NC, A> PlaylistUpdateMethodBuilder<'a, C, NC, A> { /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist's privacy setting is contained in the status part. As such, if your request is updating a private playlist, and the request's part parameter value includes the status part, the playlist's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the playlist will revert to the default privacy setting. pub fn part(&mut self, new_value: &str) -> &mut PlaylistUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5510,8 +5692,8 @@ pub struct ThumbnailSetMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _video_id: Option, - _on_behalf_of_content_owner: Option, + _video_id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ThumbnailSetMethodBuilder<'a, C, NC, A> {} @@ -5532,7 +5714,7 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> { /// /// The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided. pub fn video_id(&mut self, new_value: &str) -> &mut ThumbnailSetMethodBuilder<'a, C, NC, A> { - self._video_id = Some(new_value.to_string()); + self._video_id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5587,17 +5769,17 @@ pub struct VideoListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _video_category_id: Option, - _region_code: Option, - _page_token: Option, - _on_behalf_of_content_owner: Option, - _my_rating: Option, - _max_results: Option, - _locale: Option, - _id: Option, - _hl: Option, - _chart: Option, + _part: String, + _video_category_id: Option, + _region_code: Option, + _page_token: Option, + _on_behalf_of_content_owner: Option, + _my_rating: Option, + _max_results: Option, + _locale: Option, + _id: Option, + _hl: Option, + _chart: Option, } impl<'a, C, NC, A> MethodBuilder for VideoListMethodBuilder<'a, C, NC, A> {} @@ -5620,7 +5802,7 @@ impl<'a, C, NC, A> VideoListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. pub fn part(&mut self, new_value: &str) -> &mut VideoListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *video category id* query property to the given value. @@ -5753,9 +5935,9 @@ pub struct VideoRateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _rating: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _rating: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for VideoRateMethodBuilder<'a, C, NC, A> {} @@ -5776,7 +5958,7 @@ impl<'a, C, NC, A> VideoRateMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed. pub fn id(&mut self, new_value: &str) -> &mut VideoRateMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *rating* query property to the given value. @@ -5786,7 +5968,7 @@ impl<'a, C, NC, A> VideoRateMethodBuilder<'a, C, NC, A> { /// /// Specifies the rating to record. pub fn rating(&mut self, new_value: &str) -> &mut VideoRateMethodBuilder<'a, C, NC, A> { - self._rating = Some(new_value.to_string()); + self._rating = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5843,8 +6025,8 @@ pub struct VideoGetratingMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for VideoGetratingMethodBuilder<'a, C, NC, A> {} @@ -5865,7 +6047,7 @@ impl<'a, C, NC, A> VideoGetratingMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID. pub fn id(&mut self, new_value: &str) -> &mut VideoGetratingMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -5922,8 +6104,8 @@ pub struct VideoDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for VideoDeleteMethodBuilder<'a, C, NC, A> {} @@ -5944,7 +6126,7 @@ impl<'a, C, NC, A> VideoDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. pub fn id(&mut self, new_value: &str) -> &mut VideoDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -6001,8 +6183,9 @@ pub struct VideoUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, + _request: Video, + _part: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for VideoUpdateMethodBuilder<'a, C, NC, A> {} @@ -6016,6 +6199,15 @@ impl<'a, C, NC, A> VideoUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Video) -> &mut VideoUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -6032,7 +6224,7 @@ impl<'a, C, NC, A> VideoUpdateMethodBuilder<'a, C, NC, A> { /// /// In addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. pub fn part(&mut self, new_value: &str) -> &mut VideoUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -6089,12 +6281,13 @@ pub struct VideoInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _stabilize: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _notify_subscribers: Option, - _auto_levels: Option, + _request: Video, + _part: String, + _stabilize: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _notify_subscribers: Option, + _auto_levels: Option, } impl<'a, C, NC, A> MethodBuilder for VideoInsertMethodBuilder<'a, C, NC, A> {} @@ -6108,6 +6301,15 @@ impl<'a, C, NC, A> VideoInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Video) -> &mut VideoInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -6120,7 +6322,7 @@ impl<'a, C, NC, A> VideoInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. pub fn part(&mut self, new_value: &str) -> &mut VideoInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *stabilize* query property to the given value. @@ -6213,7 +6415,8 @@ pub struct SubscriptionInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, + _request: Subscription, + _part: String, } impl<'a, C, NC, A> MethodBuilder for SubscriptionInsertMethodBuilder<'a, C, NC, A> {} @@ -6227,6 +6430,15 @@ impl<'a, C, NC, A> SubscriptionInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Subscription) -> &mut SubscriptionInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -6239,7 +6451,7 @@ impl<'a, C, NC, A> SubscriptionInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet and contentDetails. pub fn part(&mut self, new_value: &str) -> &mut SubscriptionInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } } @@ -6286,17 +6498,17 @@ pub struct SubscriptionListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _page_token: Option, - _order: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _my_subscribers: Option, - _mine: Option, - _max_results: Option, - _id: Option, - _for_channel_id: Option, - _channel_id: Option, + _part: String, + _page_token: Option, + _order: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _my_subscribers: Option, + _mine: Option, + _max_results: Option, + _id: Option, + _for_channel_id: Option, + _channel_id: Option, } impl<'a, C, NC, A> MethodBuilder for SubscriptionListMethodBuilder<'a, C, NC, A> {} @@ -6319,7 +6531,7 @@ impl<'a, C, NC, A> SubscriptionListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut SubscriptionListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *page token* query property to the given value. @@ -6452,7 +6664,7 @@ pub struct SubscriptionDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, + _id: String, } impl<'a, C, NC, A> MethodBuilder for SubscriptionDeleteMethodBuilder<'a, C, NC, A> {} @@ -6473,7 +6685,7 @@ impl<'a, C, NC, A> SubscriptionDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. pub fn id(&mut self, new_value: &str) -> &mut SubscriptionDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } } @@ -6520,36 +6732,36 @@ pub struct SearchListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _video_type: Option, - _video_syndicated: Option, - _video_license: Option, - _video_embeddable: Option, - _video_duration: Option, - _video_dimension: Option, - _video_definition: Option, - _video_category_id: Option, - _video_caption: Option, - _type_: Option, - _topic_id: Option, - _safe_search: Option, - _relevance_language: Option, - _related_to_video_id: Option, - _region_code: Option, - _q: Option, - _published_before: Option, - _published_after: Option, - _page_token: Option, - _order: Option, - _on_behalf_of_content_owner: Option, - _max_results: Option, - _location_radius: Option, - _location: Option, - _for_mine: Option, - _for_content_owner: Option, - _event_type: Option, - _channel_type: Option, - _channel_id: Option, + _part: String, + _video_type: Option, + _video_syndicated: Option, + _video_license: Option, + _video_embeddable: Option, + _video_duration: Option, + _video_dimension: Option, + _video_definition: Option, + _video_category_id: Option, + _video_caption: Option, + _type_: Option, + _topic_id: Option, + _safe_search: Option, + _relevance_language: Option, + _related_to_video_id: Option, + _region_code: Option, + _q: Option, + _published_before: Option, + _published_after: Option, + _page_token: Option, + _order: Option, + _on_behalf_of_content_owner: Option, + _max_results: Option, + _location_radius: Option, + _location: Option, + _for_mine: Option, + _for_content_owner: Option, + _event_type: Option, + _channel_type: Option, + _channel_id: Option, } impl<'a, C, NC, A> MethodBuilder for SearchListMethodBuilder<'a, C, NC, A> {} @@ -6572,7 +6784,7 @@ impl<'a, C, NC, A> SearchListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut SearchListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *video type* query property to the given value. @@ -6855,8 +7067,8 @@ pub struct I18nRegionListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _hl: Option, + _part: String, + _hl: Option, } impl<'a, C, NC, A> MethodBuilder for I18nRegionListMethodBuilder<'a, C, NC, A> {} @@ -6877,7 +7089,7 @@ impl<'a, C, NC, A> I18nRegionListMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more i18nRegion resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet. pub fn part(&mut self, new_value: &str) -> &mut I18nRegionListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *hl* query property to the given value. @@ -6932,9 +7144,10 @@ pub struct LiveStreamUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: LiveStream, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveStreamUpdateMethodBuilder<'a, C, NC, A> {} @@ -6948,6 +7161,15 @@ impl<'a, C, NC, A> LiveStreamUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &LiveStream) -> &mut LiveStreamUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -6962,7 +7184,7 @@ impl<'a, C, NC, A> LiveStreamUpdateMethodBuilder<'a, C, NC, A> { /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed. pub fn part(&mut self, new_value: &str) -> &mut LiveStreamUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -7031,9 +7253,9 @@ pub struct LiveStreamDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveStreamDeleteMethodBuilder<'a, C, NC, A> {} @@ -7054,7 +7276,7 @@ impl<'a, C, NC, A> LiveStreamDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube live stream ID for the resource that is being deleted. pub fn id(&mut self, new_value: &str) -> &mut LiveStreamDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -7123,13 +7345,13 @@ pub struct LiveStreamListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _page_token: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _mine: Option, - _max_results: Option, - _id: Option, + _part: String, + _page_token: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _mine: Option, + _max_results: Option, + _id: Option, } impl<'a, C, NC, A> MethodBuilder for LiveStreamListMethodBuilder<'a, C, NC, A> {} @@ -7150,7 +7372,7 @@ impl<'a, C, NC, A> LiveStreamListMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveStreamListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *page token* query property to the given value. @@ -7251,9 +7473,10 @@ pub struct LiveStreamInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: LiveStream, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveStreamInsertMethodBuilder<'a, C, NC, A> {} @@ -7267,6 +7490,15 @@ impl<'a, C, NC, A> LiveStreamInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &LiveStream) -> &mut LiveStreamInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -7279,7 +7511,7 @@ impl<'a, C, NC, A> LiveStreamInsertMethodBuilder<'a, C, NC, A> { /// /// The part properties that you can include in the parameter value are id, snippet, cdn, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveStreamInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -7348,8 +7580,9 @@ pub struct ChannelUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, + _request: Channel, + _part: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelUpdateMethodBuilder<'a, C, NC, A> {} @@ -7363,6 +7596,15 @@ impl<'a, C, NC, A> ChannelUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &Channel) -> &mut ChannelUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -7377,7 +7619,7 @@ impl<'a, C, NC, A> ChannelUpdateMethodBuilder<'a, C, NC, A> { /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. pub fn part(&mut self, new_value: &str) -> &mut ChannelUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -7432,16 +7674,16 @@ pub struct ChannelListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _page_token: Option, - _on_behalf_of_content_owner: Option, - _my_subscribers: Option, - _mine: Option, - _max_results: Option, - _managed_by_me: Option, - _id: Option, - _for_username: Option, - _category_id: Option, + _part: String, + _page_token: Option, + _on_behalf_of_content_owner: Option, + _my_subscribers: Option, + _mine: Option, + _max_results: Option, + _managed_by_me: Option, + _id: Option, + _for_username: Option, + _category_id: Option, } impl<'a, C, NC, A> MethodBuilder for ChannelListMethodBuilder<'a, C, NC, A> {} @@ -7464,7 +7706,7 @@ impl<'a, C, NC, A> ChannelListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut ChannelListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *page token* query property to the given value. @@ -7583,7 +7825,7 @@ pub struct PlaylistItemDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, + _id: String, } impl<'a, C, NC, A> MethodBuilder for PlaylistItemDeleteMethodBuilder<'a, C, NC, A> {} @@ -7604,7 +7846,7 @@ impl<'a, C, NC, A> PlaylistItemDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID. pub fn id(&mut self, new_value: &str) -> &mut PlaylistItemDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } } @@ -7651,13 +7893,13 @@ pub struct PlaylistItemListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _video_id: Option, - _playlist_id: Option, - _page_token: Option, - _on_behalf_of_content_owner: Option, - _max_results: Option, - _id: Option, + _part: String, + _video_id: Option, + _playlist_id: Option, + _page_token: Option, + _on_behalf_of_content_owner: Option, + _max_results: Option, + _id: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistItemListMethodBuilder<'a, C, NC, A> {} @@ -7680,7 +7922,7 @@ impl<'a, C, NC, A> PlaylistItemListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. pub fn part(&mut self, new_value: &str) -> &mut PlaylistItemListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *video id* query property to the given value. @@ -7777,8 +8019,9 @@ pub struct PlaylistItemInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner: Option, + _request: PlaylistItem, + _part: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for PlaylistItemInsertMethodBuilder<'a, C, NC, A> {} @@ -7792,6 +8035,15 @@ impl<'a, C, NC, A> PlaylistItemInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &PlaylistItem) -> &mut PlaylistItemInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -7804,7 +8056,7 @@ impl<'a, C, NC, A> PlaylistItemInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut PlaylistItemInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -7861,7 +8113,8 @@ pub struct PlaylistItemUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, + _request: PlaylistItem, + _part: String, } impl<'a, C, NC, A> MethodBuilder for PlaylistItemUpdateMethodBuilder<'a, C, NC, A> {} @@ -7875,6 +8128,15 @@ impl<'a, C, NC, A> PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &PlaylistItem) -> &mut PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -7889,7 +8151,7 @@ impl<'a, C, NC, A> PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings. pub fn part(&mut self, new_value: &str) -> &mut PlaylistItemUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } } @@ -7936,8 +8198,8 @@ pub struct WatermarkSetMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _channel_id: Option, - _on_behalf_of_content_owner: Option, + _channel_id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for WatermarkSetMethodBuilder<'a, C, NC, A> {} @@ -7958,7 +8220,7 @@ impl<'a, C, NC, A> WatermarkSetMethodBuilder<'a, C, NC, A> { /// /// The channelId parameter specifies a YouTube channel ID for which the watermark is being provided. pub fn channel_id(&mut self, new_value: &str) -> &mut WatermarkSetMethodBuilder<'a, C, NC, A> { - self._channel_id = Some(new_value.to_string()); + self._channel_id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -8013,8 +8275,8 @@ pub struct WatermarkUnsetMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _channel_id: Option, - _on_behalf_of_content_owner: Option, + _channel_id: String, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for WatermarkUnsetMethodBuilder<'a, C, NC, A> {} @@ -8035,7 +8297,7 @@ impl<'a, C, NC, A> WatermarkUnsetMethodBuilder<'a, C, NC, A> { /// /// The channelId parameter specifies a YouTube channel ID for which the watermark is being unset. pub fn channel_id(&mut self, new_value: &str) -> &mut WatermarkUnsetMethodBuilder<'a, C, NC, A> { - self._channel_id = Some(new_value.to_string()); + self._channel_id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner* query property to the given value. @@ -8090,13 +8352,13 @@ pub struct LiveBroadcastControlMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _part: Option, - _walltime: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _offset_time_ms: Option, - _display_slate: Option, + _id: String, + _part: String, + _walltime: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _offset_time_ms: Option, + _display_slate: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastControlMethodBuilder<'a, C, NC, A> {} @@ -8117,7 +8379,7 @@ impl<'a, C, NC, A> LiveBroadcastControlMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated. pub fn id(&mut self, new_value: &str) -> &mut LiveBroadcastControlMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *part* query property to the given value. @@ -8127,7 +8389,7 @@ impl<'a, C, NC, A> LiveBroadcastControlMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastControlMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *walltime* query property to the given value. @@ -8224,9 +8486,10 @@ pub struct LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: LiveBroadcast, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> {} @@ -8240,6 +8503,15 @@ impl<'a, C, NC, A> LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &LiveBroadcast) -> &mut LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -8254,7 +8526,7 @@ impl<'a, C, NC, A> LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { /// /// Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastUpdateMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -8323,9 +8595,10 @@ pub struct LiveBroadcastInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _request: LiveBroadcast, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastInsertMethodBuilder<'a, C, NC, A> {} @@ -8339,6 +8612,15 @@ impl<'a, C, NC, A> LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { } + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + pub fn request(&mut self, new_value: &LiveBroadcast) -> &mut LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { + self._request = new_value.clone(); + return self; + } /// Sets the *part* query property to the given value. /// /// Even though the *parts* list is automatically derived from *Resource* passed in @@ -8351,7 +8633,7 @@ impl<'a, C, NC, A> LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { /// /// The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -8420,11 +8702,11 @@ pub struct LiveBroadcastBindMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _part: Option, - _stream_id: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _part: String, + _stream_id: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastBindMethodBuilder<'a, C, NC, A> {} @@ -8445,7 +8727,7 @@ impl<'a, C, NC, A> LiveBroadcastBindMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. pub fn id(&mut self, new_value: &str) -> &mut LiveBroadcastBindMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *part* query property to the given value. @@ -8455,7 +8737,7 @@ impl<'a, C, NC, A> LiveBroadcastBindMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastBindMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *stream id* query property to the given value. @@ -8532,14 +8814,14 @@ pub struct LiveBroadcastListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _page_token: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _mine: Option, - _max_results: Option, - _id: Option, - _broadcast_status: Option, + _part: String, + _page_token: Option, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _mine: Option, + _max_results: Option, + _id: Option, + _broadcast_status: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastListMethodBuilder<'a, C, NC, A> {} @@ -8560,7 +8842,7 @@ impl<'a, C, NC, A> LiveBroadcastListMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *page token* query property to the given value. @@ -8669,9 +8951,9 @@ pub struct LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _id: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _id: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> {} @@ -8692,7 +8974,7 @@ impl<'a, C, NC, A> LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. pub fn id(&mut self, new_value: &str) -> &mut LiveBroadcastDeleteMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -8761,11 +9043,11 @@ pub struct LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _broadcast_status: Option, - _id: Option, - _part: Option, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, + _broadcast_status: String, + _id: String, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, } impl<'a, C, NC, A> MethodBuilder for LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> {} @@ -8786,7 +9068,7 @@ impl<'a, C, NC, A> LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { /// /// The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. pub fn broadcast_status(&mut self, new_value: &str) -> &mut LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { - self._broadcast_status = Some(new_value.to_string()); + self._broadcast_status = new_value.to_string(); return self; } /// Sets the *id* query property to the given value. @@ -8796,7 +9078,7 @@ impl<'a, C, NC, A> LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { /// /// The id parameter specifies the unique ID of the broadcast that is transitioning to another status. pub fn id(&mut self, new_value: &str) -> &mut LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { - self._id = Some(new_value.to_string()); + self._id = new_value.to_string(); return self; } /// Sets the *part* query property to the given value. @@ -8806,7 +9088,7 @@ impl<'a, C, NC, A> LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. pub fn part(&mut self, new_value: &str) -> &mut LiveBroadcastTransitionMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *on behalf of content owner channel* query property to the given value. @@ -8875,10 +9157,10 @@ pub struct VideoCategoryListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _region_code: Option, - _id: Option, - _hl: Option, + _part: String, + _region_code: Option, + _id: Option, + _hl: Option, } impl<'a, C, NC, A> MethodBuilder for VideoCategoryListMethodBuilder<'a, C, NC, A> {} @@ -8899,7 +9181,7 @@ impl<'a, C, NC, A> VideoCategoryListMethodBuilder<'a, C, NC, A> { /// /// The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. pub fn part(&mut self, new_value: &str) -> &mut VideoCategoryListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *region code* query property to the given value. @@ -8970,15 +9252,15 @@ pub struct ActivityListMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, - _region_code: Option, - _published_before: Option, - _published_after: Option, - _page_token: Option, - _mine: Option, - _max_results: Option, - _home: Option, - _channel_id: Option, + _part: String, + _region_code: Option, + _published_before: Option, + _published_after: Option, + _page_token: Option, + _mine: Option, + _max_results: Option, + _home: Option, + _channel_id: Option, } impl<'a, C, NC, A> MethodBuilder for ActivityListMethodBuilder<'a, C, NC, A> {} @@ -9001,7 +9283,7 @@ impl<'a, C, NC, A> ActivityListMethodBuilder<'a, C, NC, A> { /// /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. pub fn part(&mut self, new_value: &str) -> &mut ActivityListMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } /// Sets the *region code* query property to the given value. @@ -9114,7 +9396,7 @@ pub struct ActivityInsertMethodBuilder<'a, C, NC, A> A: 'a, { hub: &'a YouTube, - _part: Option, + _part: String, } impl<'a, C, NC, A> MethodBuilder for ActivityInsertMethodBuilder<'a, C, NC, A> {} @@ -9140,7 +9422,7 @@ impl<'a, C, NC, A> ActivityInsertMethodBuilder<'a, C, NC, A> { /// /// The part names that you can include in the parameter value are snippet and contentDetails. pub fn part(&mut self, new_value: &str) -> &mut ActivityInsertMethodBuilder<'a, C, NC, A> { - self._part = Some(new_value.to_string()); + self._part = new_value.to_string(); return self; } } diff --git a/src/mako/lib/mbuild.mako b/src/mako/lib/mbuild.mako index 7d419f326b..cc26b05248 100644 --- a/src/mako/lib/mbuild.mako +++ b/src/mako/lib/mbuild.mako @@ -2,7 +2,8 @@ from util import (put_and, rust_test_fn_invisible, rust_doc_test_norun, rust_doc_comment, rb_type, mb_type, singular, hub_type, to_fqan, indent_all_but_first_by, method_params, activity_rust_type, mangle_ident, activity_input_type, get_word, - split_camelcase_s, property, is_pod_property, TREF) + split_camelcase_s, property, is_pod_property, TREF, method_io, IO_REQUEST, + RESOURCE_MARKER, schema_to_required_property, rust_copy_value_s, is_required_property) %>\ <%namespace name="util" file="util.mako"/>\ <%namespace name="lib" file="lib.mako"/>\ @@ -16,6 +17,11 @@ m = c.fqan_map[to_fqan(name, resource, method)] # an identifier for a property. We prefix them to prevent clashes with the setters ThisType = mb_type(resource, method) + "<'a, C, NC, A>" + + request_resource = method_io(schemas, c, m, IO_REQUEST, RESOURCE_MARKER) + params = method_params(m) + if request_resource: + params.insert(0, schema_to_required_property(request_resource, 'request')) %>\ % if 'description' in m: ${m.description | rust_doc_comment} @@ -51,8 +57,13 @@ pub struct ${ThisType} hub: &'a ${hub_type_name}, ## PROPERTIES ############### -% for p in method_params(m): - ${property(p.name)}: ${activity_rust_type(p)}, +% for p in params: + ${property(p.name)}:\ + % if is_required_property(p): + ${activity_rust_type(p, allow_optionals=False)}, + % else: + ${activity_rust_type(p)}, + % endif % endfor } @@ -68,7 +79,7 @@ impl<'a, C, NC, A> ${ThisType} { } ## SETTERS ############### -% for p in method_params(m): +% for p in params: ${self._setter(resource, method, m, p, ThisType, c)}\ % endfor } @@ -90,11 +101,9 @@ ${self._setter(resource, method, m, p, ThisType, c)}\ return m.request.get(TREF, 'first') == m.response.get(TREF, 'second') value_name = 'new_value' - new_value_copied = value_name + '.clone()' - if InType == '&str': - new_value_copied = value_name + '.to_string()' - elif is_pod_property(p): - new_value_copied = value_name + new_value_copied = rust_copy_value_s(value_name, InType, p) + if not is_required_property(p): + new_value_copied = 'Some(%s)' % new_value_copied %>\ /// Sets the *${split_camelcase_s(p.name)}* ${get_word(p, 'location')}property to the given value. /// @@ -104,7 +113,7 @@ ${self._setter(resource, method, m, p, ThisType, c)}\ /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, /// like statistics that are generated server side. Therefore you should use this method to specify /// the parts you provide in addition to the ones you want in the response. - % elif p.get('required', False): + % elif is_required_property(p): /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. % endif @@ -113,7 +122,7 @@ ${self._setter(resource, method, m, p, ThisType, c)}\ ${p.description | rust_doc_comment, indent_all_but_first_by(1)} % endif pub fn ${mangle_ident(p.name)}(&mut self, ${value_name}: ${InType}) -> &mut ${ThisType} { - self.${property(p.name)} = Some(${new_value_copied}); + self.${property(p.name)} = ${new_value_copied}; return self; } \ No newline at end of file diff --git a/src/mako/lib/rbuild.mako b/src/mako/lib/rbuild.mako index 490d6d765c..0a5cfab66d 100644 --- a/src/mako/lib/rbuild.mako +++ b/src/mako/lib/rbuild.mako @@ -1,7 +1,9 @@ <%! from util import (put_and, rust_test_fn_invisible, rust_doc_test_norun, rust_doc_comment, rb_type, singular, hub_type, mangle_ident, mb_type, method_params, property, - to_fqan, indent_all_but_first_by) + to_fqan, indent_all_but_first_by, RESOURCE_MARKER, schema_markers, + activity_input_type, TREF, method_io, IO_REQUEST, schema_to_required_property, + rust_copy_value_s, is_required_property) %>\ <%namespace name="util" file="util.mako"/>\ <%namespace name="lib" file="lib.mako"/>\ @@ -49,6 +51,33 @@ impl<'a, C, NC, A> ${ThisType} { <% m = c.fqan_map[to_fqan(name, resource, a)] RType = mb_type(resource, a) + + # skip part if we have a request resource. Only resources can have parts + # that we can easily deduce + request_resource = method_io(schemas, c, m, IO_REQUEST, RESOURCE_MARKER) + params = method_params(m) + REQUEST_RESOURCE_PROPERTY_NAME = 'request' + if request_resource: + # resource into property + resprop = schema_to_required_property(request_resource, REQUEST_RESOURCE_PROPERTY_NAME) + params.insert(0, resprop) + + part_prop = None + optional_props = list() + required_props = list() + for p in params: + if is_required_property(p): + if request_resource and p.name == 'part': + part_prop = p + else: + required_props.append(p) + else: + optional_props.append(p) + # end for each property + + method_args = '' + if required_props: + method_args = ', ' + ', '.join('%s: %s' % (mangle_ident(p.name), activity_input_type(p)) for p in required_props) %>\ % if 'description' in m: @@ -56,10 +85,17 @@ impl<'a, C, NC, A> ${ThisType} { /// ${m.description | rust_doc_comment, indent_all_but_first_by(1)} % endif - pub fn ${mangle_ident(a)}(&self) -> ${RType}<'a, C, NC, A> { + pub fn ${mangle_ident(a)}(&self${method_args}) -> ${RType}<'a, C, NC, A> { ${RType} { hub: self.hub, - % for p in method_params(m): + % for p in required_props: + ${property(p.name)}: ${rust_copy_value_s(mangle_ident(p.name), activity_input_type(p), p)}, + % endfor + ## auto-generate parts from request resources + % if part_prop and request_resource: + ${property(part_prop.name)}: ${mangle_ident(REQUEST_RESOURCE_PROPERTY_NAME)}.to_parts(), + % endif + % for p in optional_props: ${property(p.name)}: Default::default(), % endfor } diff --git a/src/mako/lib/schema.mako b/src/mako/lib/schema.mako index df4e12677f..c7003bfbbd 100644 --- a/src/mako/lib/schema.mako +++ b/src/mako/lib/schema.mako @@ -27,6 +27,10 @@ pub struct ${s.id}\ % for marker_trait in markers: impl ${marker_trait} for ${s.id} {} % endfor + +% if RESOURCE_MARKER in markers: + +% endif <%def name="doc(s, c)">\ diff --git a/src/mako/lib/util.py b/src/mako/lib/util.py index 7a27908917..9d310c2137 100644 --- a/src/mako/lib/util.py +++ b/src/mako/lib/util.py @@ -24,6 +24,10 @@ DEL_METHOD = 'delete' NESTED_TYPE_MARKER = 'is_nested' SPACES_PER_TAB = 4 +REQUEST_PRIORITY = 100 +REQUEST_MARKER = 'RequestValue' +RESOURCE_MARKER = 'Resource' + # ============================================================================== ## @name Filters # ------------------------------------------------------------------------------ @@ -225,7 +229,7 @@ def activity_input_type(p): return '&%s' % n def is_pod_property(p): - return 'format' in p or p.type == 'boolean' + return 'format' in p or p.get('type','') == 'boolean' # return an iterator yielding fake-schemas that identify a nested type def iter_nested_types(schemas): @@ -252,11 +256,11 @@ def schema_markers(s, c): # it should have at least one activity that matches it's type to qualify for the Resource trait for fqan, iot in activities.iteritems(): if activity_name_to_type_name(activity_split(fqan)[0]).lower() == s.id.lower(): - res.add('Resource') + res.add(RESOURCE_MARKER) if IO_RESPONSE in iot: res.add('ResponseResult') if IO_REQUEST in iot: - res.add('RequestResult') + res.add(REQUEST_MARKER) # end for each activity # end handle activites @@ -319,6 +323,32 @@ def method_params(m, required=None, location=None): # end for each parameter return sorted(res, key=lambda p: (p.priority, p.name), reverse=True) +# return the given method's request or response schema (dict), or None. +# optionally return only schemas with the given marker trait +def method_io(schemas, c, m, type, marker=None): + s = schemas.get(m.get('request', dict()).get(TREF)) + if s is None: + return s + if s and marker and marker not in schema_markers(s, c): + return None + return s + +# return string like 'n.clone()', but depending on the type name of tn (e.g. &str -> n.to_string()) +def rust_copy_value_s(n, tn, p): + nc = n + '.clone()' + if tn == '&str': + nc = n + '.to_string()' + elif is_pod_property(p): + nc = n + return nc + +# convert a schema into a property (for use with rust type generation). +# n = name of the property +def schema_to_required_property(s, n): + return type(s)({'name': n, TREF: s.id, 'priority': REQUEST_PRIORITY}) + +def is_required_property(p): + return p.get('required', False) or p.get('priority', 0) > 0 ## -- End Activity Utilities -- @} diff --git a/src/rust/cmn.rs b/src/rust/cmn.rs index c9f32fbba1..7220652515 100644 --- a/src/rust/cmn.rs +++ b/src/rust/cmn.rs @@ -19,7 +19,7 @@ pub trait Resource: MarkerTrait {} pub trait ResponseResult: MarkerTrait {} /// Identifies types which are used in API requests. -pub trait RequestResult: MarkerTrait {} +pub trait RequestValue: MarkerTrait {} /// Identifies types which are only used as part of other types, which /// usually are carrying the `Resource` trait.