diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index 79ed2a5519b..de431e8c5bc 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/src/cmn.rs @@ -70,14 +70,13 @@ impl Delegate for DefaultDelegate {} /// A universal result type used as return for all action method results. -pub enum Result { +pub enum Result { /// The http connection failed HttpError(hyper::HttpError), /// An additional, free form field clashed with one of the built-in optional ones FieldClash(&'static str), - /// It worked ! - Success, + Success(T), } \ No newline at end of file diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index e6a7d862cab..a9aba004b69 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -5005,8 +5005,8 @@ impl<'a, C, NC, A> I18nLanguageListMethodBuilder<'a, C, NC, A> where NC: hyper:: /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("part", self._part.to_string())); if self._hl.is_some() { params.push(("hl", self._hl.unwrap().to_string())); @@ -5016,9 +5016,14 @@ impl<'a, C, NC, A> I18nLanguageListMethodBuilder<'a, C, NC, A> where NC: hyper:: return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: I18nLanguageListResponse = Default::default(); - Result::Success + Result::Success(response) } @@ -5132,8 +5137,8 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype /// Perform the operation you have build so far. - fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); } @@ -5142,9 +5147,14 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response: ChannelBannerResource = Default::default(); - Result::Success + + Result::Success(response) } /// Upload media all at once. @@ -5153,7 +5163,7 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype /// * *max size*: 6MB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' - pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result + pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result where R: Read { self.doit(Some((stream, size, mime_type)), None::<(fs::File, u64, mime::Mime)>, ) } @@ -5166,7 +5176,7 @@ impl<'a, C, NC, A> ChannelBannerInsertMethodBuilder<'a, C, NC, A> where NC: hype /// * *max size*: 6MB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' - pub fn upload_resumable(mut self, resumeable_stream: RS, size: u64, mime_type: mime::Mime) -> Result + pub fn upload_resumable(mut self, resumeable_stream: RS, size: u64, mime_type: mime::Mime) -> Result where RS: ReadSeek { self.doit(None::<(fs::File, u64, mime::Mime)>, Some((resumeable_stream, size, mime_type)), ) } @@ -5286,8 +5296,8 @@ impl<'a, C, NC, A> ChannelSectionListMethodBuilder<'a, C, NC, A> where NC: hyper /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(6); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("part", self._part.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -5306,9 +5316,14 @@ impl<'a, C, NC, A> ChannelSectionListMethodBuilder<'a, C, NC, A> where NC: hyper return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: ChannelSectionListResponse = Default::default(); - Result::Success + Result::Success(response) } @@ -5463,8 +5478,8 @@ impl<'a, C, NC, A> ChannelSectionInsertMethodBuilder<'a, C, NC, A> where NC: hyp /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(5); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -5480,9 +5495,14 @@ impl<'a, C, NC, A> ChannelSectionInsertMethodBuilder<'a, C, NC, A> where NC: hyp return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: ChannelSection = Default::default(); - Result::Success + Result::Success(response) } @@ -5618,8 +5638,8 @@ impl<'a, C, NC, A> ChannelSectionDeleteMethodBuilder<'a, C, NC, A> where NC: hyp /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + pub fn doit(mut self) -> Result<()> { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("id", self._id.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -5629,9 +5649,14 @@ impl<'a, C, NC, A> ChannelSectionDeleteMethodBuilder<'a, C, NC, A> where NC: hyp return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response = (); - Result::Success + + Result::Success(response) } @@ -5752,8 +5777,8 @@ impl<'a, C, NC, A> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> where NC: hyp /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(4); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -5766,9 +5791,14 @@ impl<'a, C, NC, A> ChannelSectionUpdateMethodBuilder<'a, C, NC, A> where NC: hyp return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: ChannelSection = Default::default(); - Result::Success + Result::Success(response) } @@ -5909,8 +5939,8 @@ impl<'a, C, NC, A> GuideCategoryListMethodBuilder<'a, C, NC, A> where NC: hyper: /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(5); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("part", self._part.to_string())); if self._region_code.is_some() { params.push(("regionCode", self._region_code.unwrap().to_string())); @@ -5926,9 +5956,14 @@ impl<'a, C, NC, A> GuideCategoryListMethodBuilder<'a, C, NC, A> where NC: hyper: return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: GuideCategoryListResponse = Default::default(); - Result::Success + Result::Success(response) } @@ -6072,8 +6107,8 @@ impl<'a, C, NC, A> PlaylistInsertMethodBuilder<'a, C, NC, A> where NC: hyper::ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(5); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -6089,9 +6124,14 @@ impl<'a, C, NC, A> PlaylistInsertMethodBuilder<'a, C, NC, A> where NC: hyper::ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response: Playlist = Default::default(); - Result::Success + + Result::Success(response) } @@ -6254,8 +6294,8 @@ impl<'a, C, NC, A> PlaylistListMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(9); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); params.push(("part", self._part.to_string())); if self._page_token.is_some() { params.push(("pageToken", self._page_token.unwrap().to_string())); @@ -6283,9 +6323,14 @@ impl<'a, C, NC, A> PlaylistListMethodBuilder<'a, C, NC, A> where NC: hyper::net: return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: PlaylistListResponse = Default::default(); - Result::Success + Result::Success(response) } @@ -6446,8 +6491,8 @@ impl<'a, C, NC, A> PlaylistDeleteMethodBuilder<'a, C, NC, A> where NC: hyper::ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + pub fn doit(mut self) -> Result<()> { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("id", self._id.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -6457,9 +6502,14 @@ impl<'a, C, NC, A> PlaylistDeleteMethodBuilder<'a, C, NC, A> where NC: hyper::ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response = (); - Result::Success + Result::Success(response) } @@ -6580,8 +6630,8 @@ impl<'a, C, NC, A> PlaylistUpdateMethodBuilder<'a, C, NC, A> where NC: hyper::ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(4); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); if self._part.len() == 0 { self._part = self._request.to_parts(); } @@ -6594,9 +6644,14 @@ impl<'a, C, NC, A> PlaylistUpdateMethodBuilder<'a, C, NC, A> where NC: hyper::ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response: Playlist = Default::default(); - Result::Success + + Result::Success(response) } @@ -6723,8 +6778,8 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// Perform the operation you have build so far. - fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + fn doit(mut self, stream: Option<(R, u64, mime::Mime)>, resumeable_stream: Option<(RS, u64, mime::Mime)>) -> Result where R: Read, RS: ReadSeek { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("videoId", self._video_id.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -6734,9 +6789,14 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response: ThumbnailSetResponse = Default::default(); - Result::Success + + Result::Success(response) } /// Upload media all at once. @@ -6745,7 +6805,7 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// * *max size*: 2MB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' - pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result + pub fn upload(mut self, stream: R, size: u64, mime_type: mime::Mime) -> Result where R: Read { self.doit(Some((stream, size, mime_type)), None::<(fs::File, u64, mime::Mime)>, ) } @@ -6758,7 +6818,7 @@ impl<'a, C, NC, A> ThumbnailSetMethodBuilder<'a, C, NC, A> where NC: hyper::net: /// * *max size*: 2MB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream', 'image/jpeg' and 'image/png' - pub fn upload_resumable(mut self, resumeable_stream: RS, size: u64, mime_type: mime::Mime) -> Result + pub fn upload_resumable(mut self, resumeable_stream: RS, size: u64, mime_type: mime::Mime) -> Result where RS: ReadSeek { self.doit(None::<(fs::File, u64, mime::Mime)>, Some((resumeable_stream, size, mime_type)), ) } @@ -6899,8 +6959,8 @@ impl<'a, C, NC, A> VideoListMethodBuilder<'a, C, NC, A> where NC: hyper::net::Ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(12); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(12 + self._additional_params.len()); params.push(("part", self._part.to_string())); if self._video_category_id.is_some() { params.push(("videoCategoryId", self._video_category_id.unwrap().to_string())); @@ -6937,9 +6997,14 @@ impl<'a, C, NC, A> VideoListMethodBuilder<'a, C, NC, A> where NC: hyper::net::Ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response: VideoListResponse = Default::default(); - Result::Success + Result::Success(response) } @@ -7134,8 +7199,8 @@ impl<'a, C, NC, A> VideoRateMethodBuilder<'a, C, NC, A> where NC: hyper::net::Ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(4); + pub fn doit(mut self) -> Result<()> { + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("id", self._id.to_string())); params.push(("rating", self._rating.to_string())); if self._on_behalf_of_content_owner.is_some() { @@ -7146,9 +7211,14 @@ impl<'a, C, NC, A> VideoRateMethodBuilder<'a, C, NC, A> where NC: hyper::net::Ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response = (); - Result::Success + Result::Success(response) } @@ -7258,8 +7328,8 @@ impl<'a, C, NC, A> VideoGetRatingMethodBuilder<'a, C, NC, A> where NC: hyper::ne /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + pub fn doit(mut self) -> Result { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("id", self._id.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -7269,9 +7339,14 @@ impl<'a, C, NC, A> VideoGetRatingMethodBuilder<'a, C, NC, A> where NC: hyper::ne return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + let response: VideoGetRatingResponse = Default::default(); - Result::Success + + Result::Success(response) } @@ -7371,8 +7446,8 @@ impl<'a, C, NC, A> VideoDeleteMethodBuilder<'a, C, NC, A> where NC: hyper::net:: /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(3); + pub fn doit(mut self) -> Result<()> { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("id", self._id.to_string())); if self._on_behalf_of_content_owner.is_some() { params.push(("onBehalfOfContentOwner", self._on_behalf_of_content_owner.unwrap().to_string())); @@ -7382,9 +7457,14 @@ impl<'a, C, NC, A> VideoDeleteMethodBuilder<'a, C, NC, A> where NC: hyper::net:: return Result::FieldClash(field); } } + for (name, value) in self._additional_params.iter() { + params.push((name, value.clone())); + } + + let response = (); - Result::Success + Result::Success(response) } @@ -7525,8 +7605,8 @@ impl<'a, C, NC, A> VideoUpdateMethodBuilder<'a, C, NC, A> where NC: hyper::net:: /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - let mut params: Vec<(&str, String)> = Vec::with_capacity(4); + pub fn doit(mut self) -> Result