diff --git a/etc/api/shared.yaml b/etc/api/shared.yaml index f40a09a5cd3..8d6beed01a0 100644 --- a/etc/api/shared.yaml +++ b/etc/api/shared.yaml @@ -28,7 +28,7 @@ api: - source: lib.rs output_dir: src cargo: - build_version: "0.1.0" + build_version: "0.1.1" repo_base_url: https://github.com/Byron/google-apis-rs doc_base_url: http://byron.github.io/google-apis-rs authors: diff --git a/gen/adexchangebuyer1d3/Cargo.toml b/gen/adexchangebuyer1d3/Cargo.toml index f98464e4b67..0da833259a5 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3" -version = "0.1.0+20150218" +version = "0.1.1+20150218" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3" diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index 2e55a38baf5..f3a73d3dc4f 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d3` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *0.1.0+20150218*, where *20150218* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Ad Exchange Buyer* crate version *0.1.1+20150218*, where *20150218* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). diff --git a/gen/adexchangebuyer1d3/src/cmn.rs b/gen/adexchangebuyer1d3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/adexchangebuyer1d3/src/cmn.rs +++ b/gen/adexchangebuyer1d3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index e39ec436e81..036934a7769 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.0+20150218*, where *20150218* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *0.1.1+20150218*, where *20150218* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -314,7 +314,7 @@ impl<'a, C, NC, A> AdExchangeBuyer AdExchangeBuyer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -342,7 +342,7 @@ impl<'a, C, NC, A> AdExchangeBuyer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adexchangeseller2/Cargo.toml b/gen/adexchangeseller2/Cargo.toml index c81088632bd..6ee19747f9f 100644 --- a/gen/adexchangeseller2/Cargo.toml +++ b/gen/adexchangeseller2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2" -version = "0.1.0+20150313" +version = "0.1.1+20150313" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2" diff --git a/gen/adexchangeseller2/README.md b/gen/adexchangeseller2/README.md index f616ef73908..145109d34e1 100644 --- a/gen/adexchangeseller2/README.md +++ b/gen/adexchangeseller2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adexchangeseller2` library allows access to all features of the *Google Ad Exchange Seller* service. -This documentation was generated from *Ad Exchange Seller* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Ad Exchange Seller* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Ad Exchange Seller* *v2* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). diff --git a/gen/adexchangeseller2/src/cmn.rs b/gen/adexchangeseller2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/adexchangeseller2/src/cmn.rs +++ b/gen/adexchangeseller2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/adexchangeseller2/src/lib.rs b/gen/adexchangeseller2/src/lib.rs index 197d8fe75e4..488be304c44 100644 --- a/gen/adexchangeseller2/src/lib.rs +++ b/gen/adexchangeseller2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Ad Exchange Seller* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Ad Exchange Seller* *v2* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). @@ -322,7 +322,7 @@ impl<'a, C, NC, A> AdExchangeSeller AdExchangeSeller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -332,7 +332,7 @@ impl<'a, C, NC, A> AdExchangeSeller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin1_directory/Cargo.toml b/gen/admin1_directory/Cargo.toml index 8e75af634af..f0fb2b357db 100644 --- a/gen/admin1_directory/Cargo.toml +++ b/gen/admin1_directory/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory" -version = "0.1.0+20150123" +version = "0.1.1+20150123" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory" diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index 9b6b4fdeae8..9664e60bd11 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_directory` library allows access to all features of the *Google directory* service. -This documentation was generated from *directory* crate version *0.1.0+20150123*, where *20150123* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *directory* crate version *0.1.1+20150123*, where *20150123* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *directory* *v1_directory* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/directory/). diff --git a/gen/admin1_directory/src/cmn.rs b/gen/admin1_directory/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/admin1_directory/src/cmn.rs +++ b/gen/admin1_directory/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index e4a00bac726..6dc4f6b45da 100644 --- a/gen/admin1_directory/src/lib.rs +++ b/gen/admin1_directory/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *directory* crate version *0.1.0+20150123*, where *20150123* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *directory* crate version *0.1.1+20150123*, where *20150123* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). @@ -441,7 +441,7 @@ impl<'a, C, NC, A> Directory Directory { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -484,7 +484,7 @@ impl<'a, C, NC, A> Directory } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin1_reports/Cargo.toml b/gen/admin1_reports/Cargo.toml index 407f828c834..710102f1684 100644 --- a/gen/admin1_reports/Cargo.toml +++ b/gen/admin1_reports/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_reports" -version = "0.1.0+20150115" +version = "0.1.1+20150115" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports" diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index 1cb5ea810b9..f8a6747db36 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin1_reports` library allows access to all features of the *Google reports* service. -This documentation was generated from *reports* crate version *0.1.0+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *reports* crate version *0.1.1+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *reports* *v1_reports* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/reports/). diff --git a/gen/admin1_reports/src/cmn.rs b/gen/admin1_reports/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/admin1_reports/src/cmn.rs +++ b/gen/admin1_reports/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index 22407c45b69..78462d69b0c 100644 --- a/gen/admin1_reports/src/lib.rs +++ b/gen/admin1_reports/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reports* crate version *0.1.0+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *reports* crate version *0.1.1+20150115*, where *20150115* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *reports* *v1_reports* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/reports/). @@ -331,7 +331,7 @@ impl<'a, C, NC, A> Reports Reports { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -350,7 +350,7 @@ impl<'a, C, NC, A> Reports } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/admin2_email_migration/Cargo.toml b/gen/admin2_email_migration/Cargo.toml index 9f8bfd406fd..58bb388e80e 100644 --- a/gen/admin2_email_migration/Cargo.toml +++ b/gen/admin2_email_migration/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin2_email_migration" -version = "0.1.0+20150303" +version = "0.1.1+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with admin (protocol email_migration_v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin2_email_migration" diff --git a/gen/admin2_email_migration/README.md b/gen/admin2_email_migration/README.md index 37010c90d83..9a36fff340c 100644 --- a/gen/admin2_email_migration/README.md +++ b/gen/admin2_email_migration/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-admin2_email_migration` library allows access to all features of the *Google admin* service. -This documentation was generated from *admin* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *admin* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *admin* *v2_email_migration* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/email-migration/v2/). diff --git a/gen/admin2_email_migration/src/cmn.rs b/gen/admin2_email_migration/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/admin2_email_migration/src/cmn.rs +++ b/gen/admin2_email_migration/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/admin2_email_migration/src/lib.rs b/gen/admin2_email_migration/src/lib.rs index eb6b44573d1..7d3bc7ee6d3 100644 --- a/gen/admin2_email_migration/src/lib.rs +++ b/gen/admin2_email_migration/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *admin* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *admin* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *admin:email_migration_v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *admin* *v2_email_migration* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/email-migration/v2/). @@ -305,7 +305,7 @@ impl<'a, C, NC, A> Admin Admin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -315,7 +315,7 @@ impl<'a, C, NC, A> Admin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -597,8 +597,8 @@ impl<'a, C, NC, A> MailInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -647,8 +647,8 @@ impl<'a, C, NC, A> MailInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/adsense1d4/Cargo.toml b/gen/adsense1d4/Cargo.toml index 5816dcd66b3..6093eff4b79 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4" -version = "0.1.0+20150312" +version = "0.1.1+20150312" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4" diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index d8e8a298cf9..b559246de71 100644 --- a/gen/adsense1d4/README.md +++ b/gen/adsense1d4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsense1d4` library allows access to all features of the *Google AdSense* service. -This documentation was generated from *AdSense* crate version *0.1.0+20150312*, where *20150312* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *AdSense* crate version *0.1.1+20150312*, where *20150312* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *AdSense* *v1d4* API can be found at the [official documentation site](https://developers.google.com/adsense/management/). diff --git a/gen/adsense1d4/src/cmn.rs b/gen/adsense1d4/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/adsense1d4/src/cmn.rs +++ b/gen/adsense1d4/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/adsense1d4/src/lib.rs b/gen/adsense1d4/src/lib.rs index 81b8fc1eccb..0640ce6664d 100644 --- a/gen/adsense1d4/src/lib.rs +++ b/gen/adsense1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense* crate version *0.1.0+20150312*, where *20150312* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *AdSense* crate version *0.1.1+20150312*, where *20150312* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *AdSense* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/adsense/management/). @@ -350,7 +350,7 @@ impl<'a, C, NC, A> AdSense AdSense { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -387,7 +387,7 @@ impl<'a, C, NC, A> AdSense } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adsensehost4d1/Cargo.toml b/gen/adsensehost4d1/Cargo.toml index 8078804bff2..eaaf2c421f7 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1" -version = "0.1.0+20150302" +version = "0.1.1+20150302" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1" diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index b2bf02590d6..37eb31af529 100644 --- a/gen/adsensehost4d1/README.md +++ b/gen/adsensehost4d1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-adsensehost4d1` library allows access to all features of the *Google AdSense Host* service. -This documentation was generated from *AdSense Host* crate version *0.1.0+20150302*, where *20150302* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *AdSense Host* crate version *0.1.1+20150302*, where *20150302* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *AdSense Host* *v4d1* API can be found at the [official documentation site](https://developers.google.com/adsense/host/). diff --git a/gen/adsensehost4d1/src/cmn.rs b/gen/adsensehost4d1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/adsensehost4d1/src/cmn.rs +++ b/gen/adsensehost4d1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/adsensehost4d1/src/lib.rs b/gen/adsensehost4d1/src/lib.rs index 410ddae2d7e..ae558f487cb 100644 --- a/gen/adsensehost4d1/src/lib.rs +++ b/gen/adsensehost4d1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense Host* crate version *0.1.0+20150302*, where *20150302* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *AdSense Host* crate version *0.1.1+20150302*, where *20150302* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *AdSense Host* *v4d1* API can be found at the //! [official documentation site](https://developers.google.com/adsense/host/). @@ -322,7 +322,7 @@ impl<'a, C, NC, A> AdSenseHost AdSenseHost { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -347,7 +347,7 @@ impl<'a, C, NC, A> AdSenseHost } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/analytics3/Cargo.toml b/gen/analytics3/Cargo.toml index bee1c78383a..eaba6b76234 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3" -version = "0.1.0+20150308" +version = "0.1.1+20150308" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3" diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 37fdd2414ba..bdd477c91bb 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-analytics3` library allows access to all features of the *Google analytics* service. -This documentation was generated from *analytics* crate version *0.1.0+20150308*, where *20150308* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *analytics* crate version *0.1.1+20150308*, where *20150308* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). diff --git a/gen/analytics3/src/cmn.rs b/gen/analytics3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/analytics3/src/cmn.rs +++ b/gen/analytics3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index d03092dc7fd..8a0f56c857c 100644 --- a/gen/analytics3/src/lib.rs +++ b/gen/analytics3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *analytics* crate version *0.1.0+20150308*, where *20150308* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *analytics* crate version *0.1.1+20150308*, where *20150308* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). @@ -334,7 +334,7 @@ impl<'a, C, NC, A> Analytics Analytics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -353,7 +353,7 @@ impl<'a, C, NC, A> Analytics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -13686,8 +13686,8 @@ impl<'a, C, NC, A> ManagementUploadUploadDataCall<'a, C, NC, A> where NC: hyper: if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -13727,8 +13727,8 @@ impl<'a, C, NC, A> ManagementUploadUploadDataCall<'a, C, NC, A> where NC: hyper: if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/androidenterprise1/Cargo.toml b/gen/androidenterprise1/Cargo.toml index 732eed4e79a..782cc0ecd5b 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidenterprise1" -version = "0.1.0+20150218" +version = "0.1.1+20150218" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1" diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 48986dea426..364642b44e9 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-androidenterprise1` library allows access to all features of the *Google Android Enterprise* service. -This documentation was generated from *Android Enterprise* crate version *0.1.0+20150218*, where *20150218* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Android Enterprise* crate version *0.1.1+20150218*, where *20150218* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Android Enterprise* *v1* API can be found at the [official documentation site](https://developers.google.com/play/enterprise). diff --git a/gen/androidenterprise1/src/cmn.rs b/gen/androidenterprise1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/androidenterprise1/src/cmn.rs +++ b/gen/androidenterprise1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/androidenterprise1/src/lib.rs b/gen/androidenterprise1/src/lib.rs index fd8a4514356..440c644a6db 100644 --- a/gen/androidenterprise1/src/lib.rs +++ b/gen/androidenterprise1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Enterprise* crate version *0.1.0+20150218*, where *20150218* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Android Enterprise* crate version *0.1.1+20150218*, where *20150218* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Android Enterprise* *v1* API can be found at the //! [official documentation site](https://developers.google.com/play/enterprise). @@ -325,7 +325,7 @@ impl<'a, C, NC, A> AndroidEnterprise AndroidEnterprise { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -365,7 +365,7 @@ impl<'a, C, NC, A> AndroidEnterprise } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/androidpublisher2/Cargo.toml b/gen/androidpublisher2/Cargo.toml index 96af8d79b94..a7693f7e4a6 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2" -version = "0.1.0+20150128" +version = "0.1.1+20150128" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2" diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index fa834a47c4b..603d6db6a66 100644 --- a/gen/androidpublisher2/README.md +++ b/gen/androidpublisher2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-androidpublisher2` library allows access to all features of the *Google Android Publisher* service. -This documentation was generated from *Android Publisher* crate version *0.1.0+20150128*, where *20150128* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Android Publisher* crate version *0.1.1+20150128*, where *20150128* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Android Publisher* *v2* API can be found at the [official documentation site](https://developers.google.com/android-publisher). diff --git a/gen/androidpublisher2/src/cmn.rs b/gen/androidpublisher2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/androidpublisher2/src/cmn.rs +++ b/gen/androidpublisher2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index 5d9c6352f19..699da213d61 100644 --- a/gen/androidpublisher2/src/lib.rs +++ b/gen/androidpublisher2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Publisher* crate version *0.1.0+20150128*, where *20150128* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Android Publisher* crate version *0.1.1+20150128*, where *20150128* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -314,7 +314,7 @@ impl<'a, C, NC, A> AndroidPublisher AndroidPublisher { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -330,7 +330,7 @@ impl<'a, C, NC, A> AndroidPublisher } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -3841,8 +3841,8 @@ impl<'a, C, NC, A> EditImageUploadCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 15728640 { + return Result::UploadSizeLimitExceeded(size, 15728640) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -3882,8 +3882,8 @@ impl<'a, C, NC, A> EditImageUploadCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 15728640 { + return Result::UploadSizeLimitExceeded(size, 15728640) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -7901,8 +7901,8 @@ impl<'a, C, NC, A> EditApkUploadCall<'a, C, NC, A> where NC: hyper::net::Network if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -7942,8 +7942,8 @@ impl<'a, C, NC, A> EditApkUploadCall<'a, C, NC, A> where NC: hyper::net::Network if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -9824,8 +9824,8 @@ impl<'a, C, NC, A> EditExpansionfileUploadCall<'a, C, NC, A> where NC: hyper::ne if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 2147483648 { + return Result::UploadSizeLimitExceeded(size, 2147483648) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -9865,8 +9865,8 @@ impl<'a, C, NC, A> EditExpansionfileUploadCall<'a, C, NC, A> where NC: hyper::ne if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 2147483648 { + return Result::UploadSizeLimitExceeded(size, 2147483648) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/appsactivity1/Cargo.toml b/gen/appsactivity1/Cargo.toml index d8de1810da5..c2d396c1452 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1" -version = "0.1.0+20140828" +version = "0.1.1+20140828" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1" diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index 7ffaf8d84af..c99c3930369 100644 --- a/gen/appsactivity1/README.md +++ b/gen/appsactivity1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appsactivity1` library allows access to all features of the *Google appsactivity* service. -This documentation was generated from *appsactivity* crate version *0.1.0+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *appsactivity* crate version *0.1.1+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *appsactivity* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/activity/). diff --git a/gen/appsactivity1/src/cmn.rs b/gen/appsactivity1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/appsactivity1/src/cmn.rs +++ b/gen/appsactivity1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/appsactivity1/src/lib.rs b/gen/appsactivity1/src/lib.rs index 0745b585e26..1a4458e3339 100644 --- a/gen/appsactivity1/src/lib.rs +++ b/gen/appsactivity1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appsactivity* crate version *0.1.0+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *appsactivity* crate version *0.1.1+20140828*, where *20140828* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *appsactivity* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/activity/). @@ -313,7 +313,7 @@ impl<'a, C, NC, A> Appsactivity Appsactivity { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -323,7 +323,7 @@ impl<'a, C, NC, A> Appsactivity } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appstate1/Cargo.toml b/gen/appstate1/Cargo.toml index 42bbeb6fcef..8c4140e39dd 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1" diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index f7575e7b01c..a24e6b67bcb 100644 --- a/gen/appstate1/README.md +++ b/gen/appstate1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-appstate1` library allows access to all features of the *Google App State* service. -This documentation was generated from *App State* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *App State* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *App State* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/web/api/states). diff --git a/gen/appstate1/src/cmn.rs b/gen/appstate1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/appstate1/src/cmn.rs +++ b/gen/appstate1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index 999a83604ab..427bf9dff5f 100644 --- a/gen/appstate1/src/lib.rs +++ b/gen/appstate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *App State* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *App State* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *App State* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/web/api/states). @@ -302,7 +302,7 @@ impl<'a, C, NC, A> AppState AppState { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -312,7 +312,7 @@ impl<'a, C, NC, A> AppState } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/audit1/Cargo.toml b/gen/audit1/Cargo.toml index d99f47c9979..48af81d1221 100644 --- a/gen/audit1/Cargo.toml +++ b/gen/audit1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-audit1" -version = "0.1.0+20130108" +version = "0.1.1+20130108" authors = ["Sebastian Thiel "] description = "A complete library to interact with audit (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/audit1" diff --git a/gen/audit1/README.md b/gen/audit1/README.md index 814e9587145..a90324aec94 100644 --- a/gen/audit1/README.md +++ b/gen/audit1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-audit1` library allows access to all features of the *Google audit* service. -This documentation was generated from *audit* crate version *0.1.0+20130108*, where *20130108* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *audit* crate version *0.1.1+20130108*, where *20130108* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *audit* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/admin-audit/get_started). diff --git a/gen/audit1/src/cmn.rs b/gen/audit1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/audit1/src/cmn.rs +++ b/gen/audit1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/audit1/src/lib.rs b/gen/audit1/src/lib.rs index e1b06e7f517..7a78a54cf2f 100644 --- a/gen/audit1/src/lib.rs +++ b/gen/audit1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *audit* crate version *0.1.0+20130108*, where *20130108* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *audit* crate version *0.1.1+20130108*, where *20130108* is the exact revision of the *audit:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *audit* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/admin-audit/get_started). @@ -283,7 +283,7 @@ impl<'a, C, NC, A> Audit Audit { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -293,7 +293,7 @@ impl<'a, C, NC, A> Audit } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/autoscaler1_beta2/Cargo.toml b/gen/autoscaler1_beta2/Cargo.toml index 26b56ef0cca..0f45dc49eb9 100644 --- a/gen/autoscaler1_beta2/Cargo.toml +++ b/gen/autoscaler1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2" -version = "0.1.0+20141112" +version = "0.1.1+20141112" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2" diff --git a/gen/autoscaler1_beta2/README.md b/gen/autoscaler1_beta2/README.md index a58200cd644..0b3ce12b639 100644 --- a/gen/autoscaler1_beta2/README.md +++ b/gen/autoscaler1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-autoscaler1_beta2` library allows access to all features of the *Google autoscaler* service. -This documentation was generated from *autoscaler* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *autoscaler* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *autoscaler* *v1_beta2* API can be found at the [official documentation site](http://developers.google.com/compute/docs/autoscaler). diff --git a/gen/autoscaler1_beta2/src/cmn.rs b/gen/autoscaler1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/autoscaler1_beta2/src/cmn.rs +++ b/gen/autoscaler1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index 0b078e76998..4ee893ded80 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *autoscaler* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *autoscaler* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *autoscaler* *v1_beta2* API can be found at the //! [official documentation site](http://developers.google.com/compute/docs/autoscaler). @@ -306,7 +306,7 @@ impl<'a, C, NC, A> AutoscalerHub AutoscalerHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -322,7 +322,7 @@ impl<'a, C, NC, A> AutoscalerHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/bigquery2/Cargo.toml b/gen/bigquery2/Cargo.toml index 44940551588..c6fd143ad26 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2" -version = "0.1.0+20141112" +version = "0.1.1+20141112" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2" diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 88fae612847..5cd3a1d598f 100644 --- a/gen/bigquery2/README.md +++ b/gen/bigquery2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-bigquery2` library allows access to all features of the *Google bigquery* service. -This documentation was generated from *bigquery* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *bigquery* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *bigquery* *v2* API can be found at the [official documentation site](https://developers.google.com/bigquery/docs/overview). diff --git a/gen/bigquery2/src/cmn.rs b/gen/bigquery2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/bigquery2/src/cmn.rs +++ b/gen/bigquery2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index f262b8d91c3..842d38baab6 100644 --- a/gen/bigquery2/src/lib.rs +++ b/gen/bigquery2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *bigquery* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *bigquery* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://developers.google.com/bigquery/docs/overview). @@ -336,7 +336,7 @@ impl<'a, C, NC, A> Bigquery Bigquery { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -358,7 +358,7 @@ impl<'a, C, NC, A> Bigquery } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -6421,9 +6421,7 @@ impl<'a, C, NC, A> JobInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkConn mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); let mime_type = mp_reader.mime_type(); @@ -6471,9 +6469,7 @@ impl<'a, C, NC, A> JobInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkConn if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { let url = &res.headers.get::().expect("Location header is part of protocol").0; diff --git a/gen/blogger3/Cargo.toml b/gen/blogger3/Cargo.toml index 712fa9ba3fe..c8c02181fd4 100644 --- a/gen/blogger3/Cargo.toml +++ b/gen/blogger3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-blogger3" -version = "0.1.0+20150208" +version = "0.1.1+20150208" authors = ["Sebastian Thiel "] description = "A complete library to interact with blogger (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/blogger3" diff --git a/gen/blogger3/README.md b/gen/blogger3/README.md index f67e59f32d7..026d2629d29 100644 --- a/gen/blogger3/README.md +++ b/gen/blogger3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-blogger3` library allows access to all features of the *Google blogger* service. -This documentation was generated from *blogger* crate version *0.1.0+20150208*, where *20150208* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *blogger* crate version *0.1.1+20150208*, where *20150208* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *blogger* *v3* API can be found at the [official documentation site](https://developers.google.com/blogger/docs/3.0/getting_started). diff --git a/gen/blogger3/src/cmn.rs b/gen/blogger3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/blogger3/src/cmn.rs +++ b/gen/blogger3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/blogger3/src/lib.rs b/gen/blogger3/src/lib.rs index a1a69925e6e..5f40deeca23 100644 --- a/gen/blogger3/src/lib.rs +++ b/gen/blogger3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *blogger* crate version *0.1.0+20150208*, where *20150208* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *blogger* crate version *0.1.1+20150208*, where *20150208* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *blogger* *v3* API can be found at the //! [official documentation site](https://developers.google.com/blogger/docs/3.0/getting_started). @@ -334,7 +334,7 @@ impl<'a, C, NC, A> Blogger Blogger { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -365,7 +365,7 @@ impl<'a, C, NC, A> Blogger } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/books1/Cargo.toml b/gen/books1/Cargo.toml index 392a5eed028..1db0b1716ad 100644 --- a/gen/books1/Cargo.toml +++ b/gen/books1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1" diff --git a/gen/books1/README.md b/gen/books1/README.md index 0568c3ff017..a09dc6f0788 100644 --- a/gen/books1/README.md +++ b/gen/books1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-books1` library allows access to all features of the *Google books* service. -This documentation was generated from *books* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *books* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *books* *v1* API can be found at the [official documentation site](https://developers.google.com/books/docs/v1/getting_started). diff --git a/gen/books1/src/cmn.rs b/gen/books1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/books1/src/cmn.rs +++ b/gen/books1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/books1/src/lib.rs b/gen/books1/src/lib.rs index c63d9e2299f..97c9aa0c53a 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *books* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *books* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *books* *v1* API can be found at the //! [official documentation site](https://developers.google.com/books/docs/v1/getting_started). @@ -334,7 +334,7 @@ impl<'a, C, NC, A> Books Books { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -368,7 +368,7 @@ impl<'a, C, NC, A> Books } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/calendar3/Cargo.toml b/gen/calendar3/Cargo.toml index 84ceaee59b5..31417d48869 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3" -version = "0.1.0+20141123" +version = "0.1.1+20141123" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3" diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index c80874c4e50..6f07feffb00 100644 --- a/gen/calendar3/README.md +++ b/gen/calendar3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-calendar3` library allows access to all features of the *Google calendar* service. -This documentation was generated from *calendar* crate version *0.1.0+20141123*, where *20141123* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *calendar* crate version *0.1.1+20141123*, where *20141123* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *calendar* *v3* API can be found at the [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). diff --git a/gen/calendar3/src/cmn.rs b/gen/calendar3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/calendar3/src/cmn.rs +++ b/gen/calendar3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/calendar3/src/lib.rs b/gen/calendar3/src/lib.rs index b9efde3b3f8..a4b3dd5bf6a 100644 --- a/gen/calendar3/src/lib.rs +++ b/gen/calendar3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *calendar* crate version *0.1.0+20141123*, where *20141123* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *calendar* crate version *0.1.1+20141123*, where *20141123* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). @@ -373,7 +373,7 @@ impl<'a, C, NC, A> CalendarHub CalendarHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -404,7 +404,7 @@ impl<'a, C, NC, A> CalendarHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudlatencytest2/Cargo.toml b/gen/cloudlatencytest2/Cargo.toml index ebbc6acda33..ea3d10cda25 100644 --- a/gen/cloudlatencytest2/Cargo.toml +++ b/gen/cloudlatencytest2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2" -version = "0.1.0+20150206" +version = "0.1.1+20150206" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2" diff --git a/gen/cloudlatencytest2/README.md b/gen/cloudlatencytest2/README.md index 85825258b6e..24706437901 100644 --- a/gen/cloudlatencytest2/README.md +++ b/gen/cloudlatencytest2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudlatencytest2` library allows access to all features of the *Google cloudlatencytest* service. -This documentation was generated from *cloudlatencytest* crate version *0.1.0+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *cloudlatencytest* crate version *0.1.1+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google-cloudlatencytest2/struct.Cloudlatencytest.html) ... diff --git a/gen/cloudlatencytest2/src/cmn.rs b/gen/cloudlatencytest2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/cloudlatencytest2/src/cmn.rs +++ b/gen/cloudlatencytest2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index 8ed1c12b460..0c3b0302b98 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudlatencytest* crate version *0.1.0+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *cloudlatencytest* crate version *0.1.1+20150206*, where *20150206* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2). //! # Features //! @@ -296,7 +296,7 @@ impl<'a, C, NC, A> Cloudlatencytest Cloudlatencytest { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -306,7 +306,7 @@ impl<'a, C, NC, A> Cloudlatencytest } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudmonitoring2_beta2/Cargo.toml b/gen/cloudmonitoring2_beta2/Cargo.toml index b3feca42ce5..7cecccfd82c 100644 --- a/gen/cloudmonitoring2_beta2/Cargo.toml +++ b/gen/cloudmonitoring2_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2" -version = "0.1.0+20150305" +version = "0.1.1+20150305" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2" diff --git a/gen/cloudmonitoring2_beta2/README.md b/gen/cloudmonitoring2_beta2/README.md index 09618a05741..38c4d7a80cd 100644 --- a/gen/cloudmonitoring2_beta2/README.md +++ b/gen/cloudmonitoring2_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-cloudmonitoring2_beta2` library allows access to all features of the *Google Cloud Monitoring* service. -This documentation was generated from *Cloud Monitoring* crate version *0.1.0+20150305*, where *20150305* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Cloud Monitoring* crate version *0.1.1+20150305*, where *20150305* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/monitoring/v2beta2/). diff --git a/gen/cloudmonitoring2_beta2/src/cmn.rs b/gen/cloudmonitoring2_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/cloudmonitoring2_beta2/src/cmn.rs +++ b/gen/cloudmonitoring2_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/cloudmonitoring2_beta2/src/lib.rs b/gen/cloudmonitoring2_beta2/src/lib.rs index 3a98d5c302f..c5b88b8d178 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs +++ b/gen/cloudmonitoring2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Monitoring* crate version *0.1.0+20150305*, where *20150305* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Cloud Monitoring* crate version *0.1.1+20150305*, where *20150305* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/v2beta2/). @@ -311,7 +311,7 @@ impl<'a, C, NC, A> CloudMonitoring CloudMonitoring { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -327,7 +327,7 @@ impl<'a, C, NC, A> CloudMonitoring } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/compute1/Cargo.toml b/gen/compute1/Cargo.toml index a7bdf90e1e1..538f4d22009 100644 --- a/gen/compute1/Cargo.toml +++ b/gen/compute1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1" -version = "0.1.0+20150302" +version = "0.1.1+20150302" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1" diff --git a/gen/compute1/README.md b/gen/compute1/README.md index 4648a324ec4..4b890cb2ddf 100644 --- a/gen/compute1/README.md +++ b/gen/compute1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-compute1` library allows access to all features of the *Google compute* service. -This documentation was generated from *compute* crate version *0.1.0+20150302*, where *20150302* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *compute* crate version *0.1.1+20150302*, where *20150302* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *compute* *v1* API can be found at the [official documentation site](https://developers.google.com/compute/docs/reference/latest/). diff --git a/gen/compute1/src/cmn.rs b/gen/compute1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/compute1/src/cmn.rs +++ b/gen/compute1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/compute1/src/lib.rs b/gen/compute1/src/lib.rs index e5917ef8ccc..5aade79928d 100644 --- a/gen/compute1/src/lib.rs +++ b/gen/compute1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *compute* crate version *0.1.0+20150302*, where *20150302* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *compute* crate version *0.1.1+20150302*, where *20150302* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *compute* *v1* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/reference/latest/). @@ -429,7 +429,7 @@ impl<'a, C, NC, A> Compute Compute { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -517,7 +517,7 @@ impl<'a, C, NC, A> Compute } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/container1_beta1/Cargo.toml b/gen/container1_beta1/Cargo.toml index 3ca3bc856d4..d173f89956c 100644 --- a/gen/container1_beta1/Cargo.toml +++ b/gen/container1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-container1_beta1" -version = "0.1.0+20150223" +version = "0.1.1+20150223" authors = ["Sebastian Thiel "] description = "A complete library to interact with container (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1_beta1" diff --git a/gen/container1_beta1/README.md b/gen/container1_beta1/README.md index 15d5dcddf8f..00d8d895ad8 100644 --- a/gen/container1_beta1/README.md +++ b/gen/container1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-container1_beta1` library allows access to all features of the *Google container* service. -This documentation was generated from *container* crate version *0.1.0+20150223*, where *20150223* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *container* crate version *0.1.1+20150223*, where *20150223* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *container* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). diff --git a/gen/container1_beta1/src/cmn.rs b/gen/container1_beta1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/container1_beta1/src/cmn.rs +++ b/gen/container1_beta1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/container1_beta1/src/lib.rs b/gen/container1_beta1/src/lib.rs index d9bfbf419af..acaeaaf43bf 100644 --- a/gen/container1_beta1/src/lib.rs +++ b/gen/container1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *container* crate version *0.1.0+20150223*, where *20150223* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *container* crate version *0.1.1+20150223*, where *20150223* is the exact revision of the *container:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *container* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/docs/v1beta1/). @@ -289,7 +289,7 @@ impl<'a, C, NC, A> Container Container { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -299,7 +299,7 @@ impl<'a, C, NC, A> Container } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/content2/Cargo.toml b/gen/content2/Cargo.toml index 52bb7e8fd72..57ccaa5387c 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2" -version = "0.1.0+20150311" +version = "0.1.1+20150311" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2" diff --git a/gen/content2/README.md b/gen/content2/README.md index 39a2c1e4804..291176db58a 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-content2` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *0.1.0+20150311*, where *20150311* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Shopping Content* crate version *0.1.1+20150311*, where *20150311* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Shopping Content* *v2* API can be found at the [official documentation site](https://developers.google.com/shopping-content/v2/). diff --git a/gen/content2/src/cmn.rs b/gen/content2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/content2/src/cmn.rs +++ b/gen/content2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/content2/src/lib.rs b/gen/content2/src/lib.rs index f8adf6fdc78..004d583b6af 100644 --- a/gen/content2/src/lib.rs +++ b/gen/content2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Shopping Content* crate version *0.1.0+20150311*, where *20150311* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Shopping Content* crate version *0.1.1+20150311*, where *20150311* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content/v2/). @@ -322,7 +322,7 @@ impl<'a, C, NC, A> ShoppingContent ShoppingContent { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -356,7 +356,7 @@ impl<'a, C, NC, A> ShoppingContent } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/coordinate1/Cargo.toml b/gen/coordinate1/Cargo.toml index 0657c6abb09..577e02b8309 100644 --- a/gen/coordinate1/Cargo.toml +++ b/gen/coordinate1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-coordinate1" -version = "0.1.0+20141215" +version = "0.1.1+20141215" authors = ["Sebastian Thiel "] description = "A complete library to interact with coordinate (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1" diff --git a/gen/coordinate1/README.md b/gen/coordinate1/README.md index cf686eb8a78..2ae6fef6098 100644 --- a/gen/coordinate1/README.md +++ b/gen/coordinate1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-coordinate1` library allows access to all features of the *Google coordinate* service. -This documentation was generated from *coordinate* crate version *0.1.0+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *coordinate* crate version *0.1.1+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *coordinate* *v1* API can be found at the [official documentation site](https://developers.google.com/coordinate/). diff --git a/gen/coordinate1/src/cmn.rs b/gen/coordinate1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/coordinate1/src/cmn.rs +++ b/gen/coordinate1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/coordinate1/src/lib.rs b/gen/coordinate1/src/lib.rs index d95e4de771c..45b11767f33 100644 --- a/gen/coordinate1/src/lib.rs +++ b/gen/coordinate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *coordinate* crate version *0.1.0+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *coordinate* crate version *0.1.1+20141215*, where *20141215* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *coordinate* *v1* API can be found at the //! [official documentation site](https://developers.google.com/coordinate/). @@ -337,7 +337,7 @@ impl<'a, C, NC, A> Coordinate Coordinate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -362,7 +362,7 @@ impl<'a, C, NC, A> Coordinate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/customsearch1/Cargo.toml b/gen/customsearch1/Cargo.toml index 4421729723c..726ad7a0338 100644 --- a/gen/customsearch1/Cargo.toml +++ b/gen/customsearch1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-customsearch1" -version = "0.1.0+20131205" +version = "0.1.1+20131205" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1" diff --git a/gen/customsearch1/README.md b/gen/customsearch1/README.md index 0ef9ae62d7f..07e5d110c44 100644 --- a/gen/customsearch1/README.md +++ b/gen/customsearch1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-customsearch1` library allows access to all features of the *Google customsearch* service. -This documentation was generated from *customsearch* crate version *0.1.0+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *customsearch* crate version *0.1.1+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *customsearch* *v1* API can be found at the [official documentation site](https://developers.google.com/custom-search/v1/using_rest). diff --git a/gen/customsearch1/src/cmn.rs b/gen/customsearch1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/customsearch1/src/cmn.rs +++ b/gen/customsearch1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/customsearch1/src/lib.rs b/gen/customsearch1/src/lib.rs index 14871b2e305..f606d087e12 100644 --- a/gen/customsearch1/src/lib.rs +++ b/gen/customsearch1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *customsearch* crate version *0.1.0+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *customsearch* crate version *0.1.1+20131205*, where *20131205* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *customsearch* *v1* API can be found at the //! [official documentation site](https://developers.google.com/custom-search/v1/using_rest). @@ -327,7 +327,7 @@ impl<'a, C, NC, A> Customsearch Customsearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -337,7 +337,7 @@ impl<'a, C, NC, A> Customsearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dataflow1_b4/Cargo.toml b/gen/dataflow1_b4/Cargo.toml index 50d451700f9..e113f1ea2ad 100644 --- a/gen/dataflow1_b4/Cargo.toml +++ b/gen/dataflow1_b4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dataflow1_b4" -version = "0.1.0+20150130" +version = "0.1.1+20150130" authors = ["Sebastian Thiel "] description = "A complete library to interact with dataflow (protocol v1b4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dataflow1_b4" diff --git a/gen/dataflow1_b4/README.md b/gen/dataflow1_b4/README.md index 30cc72863b9..52a66a818fc 100644 --- a/gen/dataflow1_b4/README.md +++ b/gen/dataflow1_b4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-dataflow1_b4` library allows access to all features of the *Google dataflow* service. -This documentation was generated from *dataflow* crate version *0.1.0+20150130*, where *20150130* is the exact revision of the *dataflow:v1b4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *dataflow* crate version *0.1.1+20150130*, where *20150130* is the exact revision of the *dataflow:v1b4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. # Features It seems there is nothing you can do here ... . diff --git a/gen/dataflow1_b4/src/cmn.rs b/gen/dataflow1_b4/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/dataflow1_b4/src/cmn.rs +++ b/gen/dataflow1_b4/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/dataflow1_b4/src/lib.rs b/gen/dataflow1_b4/src/lib.rs index c8cde201001..440bde135ee 100644 --- a/gen/dataflow1_b4/src/lib.rs +++ b/gen/dataflow1_b4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dataflow* crate version *0.1.0+20150130*, where *20150130* is the exact revision of the *dataflow:v1b4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *dataflow* crate version *0.1.1+20150130*, where *20150130* is the exact revision of the *dataflow:v1b4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/dataflow1_b4). //! # Features //! @@ -223,14 +223,14 @@ impl<'a, C, NC, A> Dataflow Dataflow { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/datastore1_beta2/Cargo.toml b/gen/datastore1_beta2/Cargo.toml index 1e5442de453..9b3937f0af8 100644 --- a/gen/datastore1_beta2/Cargo.toml +++ b/gen/datastore1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-datastore1_beta2" -version = "0.1.0+20140916" +version = "0.1.1+20140916" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta2" diff --git a/gen/datastore1_beta2/README.md b/gen/datastore1_beta2/README.md index c5207c73698..1b92d94abb5 100644 --- a/gen/datastore1_beta2/README.md +++ b/gen/datastore1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-datastore1_beta2` library allows access to all features of the *Google datastore* service. -This documentation was generated from *datastore* crate version *0.1.0+20140916*, where *20140916* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *datastore* crate version *0.1.1+20140916*, where *20140916* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *datastore* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/datastore/). diff --git a/gen/datastore1_beta2/src/cmn.rs b/gen/datastore1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/datastore1_beta2/src/cmn.rs +++ b/gen/datastore1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/datastore1_beta2/src/lib.rs b/gen/datastore1_beta2/src/lib.rs index 3ec53b59087..b4a0739eeb3 100644 --- a/gen/datastore1_beta2/src/lib.rs +++ b/gen/datastore1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *datastore* crate version *0.1.0+20140916*, where *20140916* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *datastore* crate version *0.1.1+20140916*, where *20140916* is the exact revision of the *datastore:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *datastore* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/datastore/). @@ -307,7 +307,7 @@ impl<'a, C, NC, A> Datastore Datastore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -317,7 +317,7 @@ impl<'a, C, NC, A> Datastore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/deploymentmanager2_beta1/Cargo.toml b/gen/deploymentmanager2_beta1/Cargo.toml index cf96e40f392..6028b79961b 100644 --- a/gen/deploymentmanager2_beta1/Cargo.toml +++ b/gen/deploymentmanager2_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-deploymentmanager2_beta1" -version = "0.1.0+20141215" +version = "0.1.1+20141215" authors = ["Sebastian Thiel "] description = "A complete library to interact with deploymentmanager (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta1" diff --git a/gen/deploymentmanager2_beta1/README.md b/gen/deploymentmanager2_beta1/README.md index 88d14e3071c..c54afe5f47f 100644 --- a/gen/deploymentmanager2_beta1/README.md +++ b/gen/deploymentmanager2_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-deploymentmanager2_beta1` library allows access to all features of the *Google deploymentmanager* service. -This documentation was generated from *deploymentmanager* crate version *0.1.0+20141215*, where *20141215* is the exact revision of the *deploymentmanager:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *deploymentmanager* crate version *0.1.1+20141215*, where *20141215* is the exact revision of the *deploymentmanager:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *deploymentmanager* *v2_beta1* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/deploymentmanager2_beta1/src/cmn.rs b/gen/deploymentmanager2_beta1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/deploymentmanager2_beta1/src/cmn.rs +++ b/gen/deploymentmanager2_beta1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/deploymentmanager2_beta1/src/lib.rs b/gen/deploymentmanager2_beta1/src/lib.rs index e4310b498cc..c4a34e8e9d1 100644 --- a/gen/deploymentmanager2_beta1/src/lib.rs +++ b/gen/deploymentmanager2_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *deploymentmanager* crate version *0.1.0+20141215*, where *20141215* is the exact revision of the *deploymentmanager:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *deploymentmanager* crate version *0.1.1+20141215*, where *20141215* is the exact revision of the *deploymentmanager:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *deploymentmanager* *v2_beta1* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). @@ -310,7 +310,7 @@ impl<'a, C, NC, A> Deploymentmanager Deploymentmanager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -332,7 +332,7 @@ impl<'a, C, NC, A> Deploymentmanager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dfareporting2/Cargo.toml b/gen/dfareporting2/Cargo.toml index c79983e82aa..86d5b5fab92 100644 --- a/gen/dfareporting2/Cargo.toml +++ b/gen/dfareporting2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2" -version = "0.1.0+20150223" +version = "0.1.1+20150223" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2" diff --git a/gen/dfareporting2/README.md b/gen/dfareporting2/README.md index 9cea062978d..024ffc518c8 100644 --- a/gen/dfareporting2/README.md +++ b/gen/dfareporting2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-dfareporting2` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *0.1.0+20150223*, where *20150223* is the exact revision of the *dfareporting:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *dfareporting* crate version *0.1.1+20150223*, where *20150223* is the exact revision of the *dfareporting:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *dfareporting* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). diff --git a/gen/dfareporting2/src/cmn.rs b/gen/dfareporting2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/dfareporting2/src/cmn.rs +++ b/gen/dfareporting2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/dfareporting2/src/lib.rs b/gen/dfareporting2/src/lib.rs index 457553a397a..cb5c347eff6 100644 --- a/gen/dfareporting2/src/lib.rs +++ b/gen/dfareporting2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *0.1.0+20150223*, where *20150223* is the exact revision of the *dfareporting:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *dfareporting* crate version *0.1.1+20150223*, where *20150223* is the exact revision of the *dfareporting:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *dfareporting* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). @@ -413,7 +413,7 @@ impl<'a, C, NC, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -564,7 +564,7 @@ impl<'a, C, NC, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -37334,8 +37334,8 @@ impl<'a, C, NC, A> CreativeAssetInsertCall<'a, C, NC, A> where NC: hyper::net::N mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 104857600 { + return Result::UploadSizeLimitExceeded(size, 104857600) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -37384,8 +37384,8 @@ impl<'a, C, NC, A> CreativeAssetInsertCall<'a, C, NC, A> where NC: hyper::net::N if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 104857600 { + return Result::UploadSizeLimitExceeded(size, 104857600) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/dns1_beta1/Cargo.toml b/gen/dns1_beta1/Cargo.toml index ac089328572..17a68aa89a6 100644 --- a/gen/dns1_beta1/Cargo.toml +++ b/gen/dns1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dns1_beta1" -version = "0.1.0+20150114" +version = "0.1.1+20150114" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1_beta1" diff --git a/gen/dns1_beta1/README.md b/gen/dns1_beta1/README.md index 80fe8611902..851719e3640 100644 --- a/gen/dns1_beta1/README.md +++ b/gen/dns1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-dns1_beta1` library allows access to all features of the *Google dns* service. -This documentation was generated from *dns* crate version *0.1.0+20150114*, where *20150114* is the exact revision of the *dns:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *dns* crate version *0.1.1+20150114*, where *20150114* is the exact revision of the *dns:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *dns* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/cloud-dns). diff --git a/gen/dns1_beta1/src/cmn.rs b/gen/dns1_beta1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/dns1_beta1/src/cmn.rs +++ b/gen/dns1_beta1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/dns1_beta1/src/lib.rs b/gen/dns1_beta1/src/lib.rs index 5f485ee0697..1a53944f117 100644 --- a/gen/dns1_beta1/src/lib.rs +++ b/gen/dns1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dns* crate version *0.1.0+20150114*, where *20150114* is the exact revision of the *dns:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *dns* crate version *0.1.1+20150114*, where *20150114* is the exact revision of the *dns:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *dns* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-dns). @@ -308,7 +308,7 @@ impl<'a, C, NC, A> Dns Dns { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -327,7 +327,7 @@ impl<'a, C, NC, A> Dns } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index 8840495bea8..f5f85c2a385 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1" -version = "0.1.0+20150122" +version = "0.1.1+20150122" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1" diff --git a/gen/doubleclickbidmanager1/README.md b/gen/doubleclickbidmanager1/README.md index dddb2ec847a..6c5b9817884 100644 --- a/gen/doubleclickbidmanager1/README.md +++ b/gen/doubleclickbidmanager1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-doubleclickbidmanager1` library allows access to all features of the *Google DoubleClick Bid Manager* service. -This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.0+20150122*, where *20150122* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.1+20150122*, where *20150122* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/bid-manager/). diff --git a/gen/doubleclickbidmanager1/src/cmn.rs b/gen/doubleclickbidmanager1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/doubleclickbidmanager1/src/cmn.rs +++ b/gen/doubleclickbidmanager1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index fe1333138b2..ac09d67ef63 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.0+20150122*, where *20150122* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *DoubleClick Bid Manager* crate version *0.1.1+20150122*, where *20150122* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/bid-manager/). @@ -270,7 +270,7 @@ impl<'a, C, NC, A> DoubleClickBidManager DoubleClickBidManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -286,7 +286,7 @@ impl<'a, C, NC, A> DoubleClickBidManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/doubleclicksearch2/Cargo.toml b/gen/doubleclicksearch2/Cargo.toml index 5142ca21738..0864e3d2cd9 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2" -version = "0.1.0+20150224" +version = "0.1.1+20150224" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2" diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index 60ec79277e9..01e40e0ca28 100644 --- a/gen/doubleclicksearch2/README.md +++ b/gen/doubleclicksearch2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-doubleclicksearch2` library allows access to all features of the *Google doubleclicksearch* service. -This documentation was generated from *doubleclicksearch* crate version *0.1.0+20150224*, where *20150224* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *doubleclicksearch* crate version *0.1.1+20150224*, where *20150224* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *doubleclicksearch* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-search/). diff --git a/gen/doubleclicksearch2/src/cmn.rs b/gen/doubleclicksearch2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/doubleclicksearch2/src/cmn.rs +++ b/gen/doubleclicksearch2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index a928a5b4226..71fc8e25361 100644 --- a/gen/doubleclicksearch2/src/lib.rs +++ b/gen/doubleclicksearch2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *doubleclicksearch* crate version *0.1.0+20150224*, where *20150224* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *doubleclicksearch* crate version *0.1.1+20150224*, where *20150224* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *doubleclicksearch* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-search/). @@ -298,7 +298,7 @@ impl<'a, C, NC, A> Doubleclicksearch Doubleclicksearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -314,7 +314,7 @@ impl<'a, C, NC, A> Doubleclicksearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/drive2/Cargo.toml b/gen/drive2/Cargo.toml index 9d353e3ed8d..8de7642963b 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2" -version = "0.1.0+20150108" +version = "0.1.1+20150108" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2" diff --git a/gen/drive2/README.md b/gen/drive2/README.md index 245a684b4ed..538ac9bf731 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-drive2` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *0.1.0+20150108*, where *20150108* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *drive* crate version *0.1.1+20150108*, where *20150108* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *drive* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/). diff --git a/gen/drive2/src/cmn.rs b/gen/drive2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/drive2/src/cmn.rs +++ b/gen/drive2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/drive2/src/lib.rs b/gen/drive2/src/lib.rs index 7d0c04adb6e..cb54903d2f1 100644 --- a/gen/drive2/src/lib.rs +++ b/gen/drive2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *drive* crate version *0.1.0+20150108*, where *20150108* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *drive* crate version *0.1.1+20150108*, where *20150108* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -402,7 +402,7 @@ impl<'a, C, NC, A> Drive Drive { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -448,7 +448,7 @@ impl<'a, C, NC, A> Drive } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -3809,8 +3809,8 @@ impl<'a, C, NC, A> FileInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 5497558138880 { + return Result::UploadSizeLimitExceeded(size, 5497558138880) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -3859,8 +3859,8 @@ impl<'a, C, NC, A> FileInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCon if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 5497558138880 { + return Result::UploadSizeLimitExceeded(size, 5497558138880) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -5780,8 +5780,8 @@ impl<'a, C, NC, A> FileUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 5497558138880 { + return Result::UploadSizeLimitExceeded(size, 5497558138880) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -5830,8 +5830,8 @@ impl<'a, C, NC, A> FileUpdateCall<'a, C, NC, A> where NC: hyper::net::NetworkCon if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 5497558138880 { + return Result::UploadSizeLimitExceeded(size, 5497558138880) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -7397,8 +7397,8 @@ impl<'a, C, NC, A> RealtimeUpdateCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -7438,8 +7438,8 @@ impl<'a, C, NC, A> RealtimeUpdateCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/fitness1/Cargo.toml b/gen/fitness1/Cargo.toml index 25ccf1dcdaa..d0bbc21060c 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fitness1" -version = "0.1.0+20150222" +version = "0.1.1+20150222" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1" diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index a0706f5831b..f409c0f00b1 100644 --- a/gen/fitness1/README.md +++ b/gen/fitness1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-fitness1` library allows access to all features of the *Google fitness* service. -This documentation was generated from *fitness* crate version *0.1.0+20150222*, where *20150222* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *fitness* crate version *0.1.1+20150222*, where *20150222* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *fitness* *v1* API can be found at the [official documentation site](https://developers.google.com/fit/rest/). diff --git a/gen/fitness1/src/cmn.rs b/gen/fitness1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/fitness1/src/cmn.rs +++ b/gen/fitness1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index e6d968aa84c..c598f3231f0 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fitness* crate version *0.1.0+20150222*, where *20150222* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *fitness* crate version *0.1.1+20150222*, where *20150222* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *fitness* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fit/rest/). @@ -322,7 +322,7 @@ impl<'a, C, NC, A> Fitness Fitness { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -332,7 +332,7 @@ impl<'a, C, NC, A> Fitness } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/freebase1/Cargo.toml b/gen/freebase1/Cargo.toml index f74f135493d..fb84ae23bee 100644 --- a/gen/freebase1/Cargo.toml +++ b/gen/freebase1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-freebase1" -version = "0.1.0+20150313" +version = "0.1.1+20150313" authors = ["Sebastian Thiel "] description = "A complete library to interact with freebase (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/freebase1" diff --git a/gen/freebase1/README.md b/gen/freebase1/README.md index c0144bdcebe..51ecb19c008 100644 --- a/gen/freebase1/README.md +++ b/gen/freebase1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-freebase1` library allows access to all features of the *Google freebase* service. -This documentation was generated from *freebase* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *freebase* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *freebase* *v1* API can be found at the [official documentation site](https://developers.google.com/freebase/). diff --git a/gen/freebase1/src/cmn.rs b/gen/freebase1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/freebase1/src/cmn.rs +++ b/gen/freebase1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/freebase1/src/lib.rs b/gen/freebase1/src/lib.rs index ea30ea8c7d7..b7715593537 100644 --- a/gen/freebase1/src/lib.rs +++ b/gen/freebase1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *freebase* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *freebase* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *freebase:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *freebase* *v1* API can be found at the //! [official documentation site](https://developers.google.com/freebase/). @@ -281,7 +281,7 @@ impl<'a, C, NC, A> Freebase Freebase { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -291,7 +291,7 @@ impl<'a, C, NC, A> Freebase } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/fusiontables2/Cargo.toml b/gen/fusiontables2/Cargo.toml index 2046e9d1748..60a1ab0d8e2 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fusiontables2" -version = "0.1.0+20141113" +version = "0.1.1+20141113" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2" diff --git a/gen/fusiontables2/README.md b/gen/fusiontables2/README.md index 9554005b953..51c82b8e280 100644 --- a/gen/fusiontables2/README.md +++ b/gen/fusiontables2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-fusiontables2` library allows access to all features of the *Google fusiontables* service. -This documentation was generated from *fusiontables* crate version *0.1.0+20141113*, where *20141113* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *fusiontables* crate version *0.1.1+20141113*, where *20141113* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *fusiontables* *v2* API can be found at the [official documentation site](https://developers.google.com/fusiontables). diff --git a/gen/fusiontables2/src/cmn.rs b/gen/fusiontables2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/fusiontables2/src/cmn.rs +++ b/gen/fusiontables2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/fusiontables2/src/lib.rs b/gen/fusiontables2/src/lib.rs index cf30ed357e9..1811b699b74 100644 --- a/gen/fusiontables2/src/lib.rs +++ b/gen/fusiontables2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fusiontables* crate version *0.1.0+20141113*, where *20141113* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *fusiontables* crate version *0.1.1+20141113*, where *20141113* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *fusiontables* *v2* API can be found at the //! [official documentation site](https://developers.google.com/fusiontables). @@ -323,7 +323,7 @@ impl<'a, C, NC, A> Fusiontables Fusiontables { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -348,7 +348,7 @@ impl<'a, C, NC, A> Fusiontables } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -7941,8 +7941,8 @@ impl<'a, C, NC, A> TableReplaceRowCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -7982,8 +7982,8 @@ impl<'a, C, NC, A> TableReplaceRowCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -9509,8 +9509,8 @@ impl<'a, C, NC, A> TableImportRowCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -9550,8 +9550,8 @@ impl<'a, C, NC, A> TableImportRowCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -9874,8 +9874,8 @@ impl<'a, C, NC, A> TableImportTableCall<'a, C, NC, A> where NC: hyper::net::Netw if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -9915,8 +9915,8 @@ impl<'a, C, NC, A> TableImportTableCall<'a, C, NC, A> where NC: hyper::net::Netw if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 262144000 { + return Result::UploadSizeLimitExceeded(size, 262144000) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/games1/Cargo.toml b/gen/games1/Cargo.toml index 3844b02fc4c..53a600b502d 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1" diff --git a/gen/games1/README.md b/gen/games1/README.md index 798711b42e0..3930a7dff43 100644 --- a/gen/games1/README.md +++ b/gen/games1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-games1` library allows access to all features of the *Google Games* service. -This documentation was generated from *Games* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Games* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Games* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/). diff --git a/gen/games1/src/cmn.rs b/gen/games1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/games1/src/cmn.rs +++ b/gen/games1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/games1/src/lib.rs b/gen/games1/src/lib.rs index 0d5e1fc9a8f..2f2e64821da 100644 --- a/gen/games1/src/lib.rs +++ b/gen/games1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Games* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Games* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/). @@ -334,7 +334,7 @@ impl<'a, C, NC, A> Games Games { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -386,7 +386,7 @@ impl<'a, C, NC, A> Games } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gamesconfiguration1_configuration/Cargo.toml b/gen/gamesconfiguration1_configuration/Cargo.toml index 139ab299dce..87b459de43f 100644 --- a/gen/gamesconfiguration1_configuration/Cargo.toml +++ b/gen/gamesconfiguration1_configuration/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesconfiguration1_configuration" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration" diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 7e16ff602b5..2ab03078d47 100644 --- a/gen/gamesconfiguration1_configuration/README.md +++ b/gen/gamesconfiguration1_configuration/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesconfiguration1_configuration` library allows access to all features of the *Google Games Configuration* service. -This documentation was generated from *Games Configuration* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Games Configuration* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Games Configuration* *v1_configuration* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesconfiguration1_configuration/src/cmn.rs b/gen/gamesconfiguration1_configuration/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/gamesconfiguration1_configuration/src/cmn.rs +++ b/gen/gamesconfiguration1_configuration/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/gamesconfiguration1_configuration/src/lib.rs b/gen/gamesconfiguration1_configuration/src/lib.rs index 4b5bf1268d9..984a119e594 100644 --- a/gen/gamesconfiguration1_configuration/src/lib.rs +++ b/gen/gamesconfiguration1_configuration/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Configuration* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Games Configuration* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Games Configuration* *v1_configuration* API can be found at the //! [official documentation site](https://developers.google.com/games/services). @@ -304,7 +304,7 @@ impl<'a, C, NC, A> GamesConfiguration GamesConfiguration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -320,7 +320,7 @@ impl<'a, C, NC, A> GamesConfiguration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1099,8 +1099,8 @@ impl<'a, C, NC, A> ImageConfigurationUploadCall<'a, C, NC, A> where NC: hyper::n if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 15728640 { + return Result::UploadSizeLimitExceeded(size, 15728640) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -1140,8 +1140,8 @@ impl<'a, C, NC, A> ImageConfigurationUploadCall<'a, C, NC, A> where NC: hyper::n if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 15728640 { + return Result::UploadSizeLimitExceeded(size, 15728640) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/gamesmanagement1_management/Cargo.toml b/gen/gamesmanagement1_management/Cargo.toml index 6e4eaa3944e..c2dca8979a1 100644 --- a/gen/gamesmanagement1_management/Cargo.toml +++ b/gen/gamesmanagement1_management/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management" diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index 351552ebbeb..da18e267530 100644 --- a/gen/gamesmanagement1_management/README.md +++ b/gen/gamesmanagement1_management/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gamesmanagement1_management` library allows access to all features of the *Google Games Management* service. -This documentation was generated from *Games Management* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Games Management* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Games Management* *v1_management* API can be found at the [official documentation site](https://developers.google.com/games/services). diff --git a/gen/gamesmanagement1_management/src/cmn.rs b/gen/gamesmanagement1_management/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/gamesmanagement1_management/src/cmn.rs +++ b/gen/gamesmanagement1_management/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/gamesmanagement1_management/src/lib.rs b/gen/gamesmanagement1_management/src/lib.rs index f366d5ae782..2a275329fad 100644 --- a/gen/gamesmanagement1_management/src/lib.rs +++ b/gen/gamesmanagement1_management/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Management* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Games Management* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Games Management* *v1_management* API can be found at the //! [official documentation site](https://developers.google.com/games/services). @@ -306,7 +306,7 @@ impl<'a, C, NC, A> GamesManagement GamesManagement { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -337,7 +337,7 @@ impl<'a, C, NC, A> GamesManagement } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/genomics1_beta2/Cargo.toml b/gen/genomics1_beta2/Cargo.toml index 5ebc534b620..b8933006645 100644 --- a/gen/genomics1_beta2/Cargo.toml +++ b/gen/genomics1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1_beta2" -version = "0.1.0+20150303" +version = "0.1.1+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1_beta2" diff --git a/gen/genomics1_beta2/README.md b/gen/genomics1_beta2/README.md index 1119409e334..16457708412 100644 --- a/gen/genomics1_beta2/README.md +++ b/gen/genomics1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-genomics1_beta2` library allows access to all features of the *Google genomics* service. -This documentation was generated from *genomics* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *genomics:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *genomics* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *genomics:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *genomics* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/genomics/v1beta2/reference). diff --git a/gen/genomics1_beta2/src/cmn.rs b/gen/genomics1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/genomics1_beta2/src/cmn.rs +++ b/gen/genomics1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/genomics1_beta2/src/lib.rs b/gen/genomics1_beta2/src/lib.rs index b7311fd1648..7656bd59cb8 100644 --- a/gen/genomics1_beta2/src/lib.rs +++ b/gen/genomics1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *genomics* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *genomics:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *genomics* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *genomics:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *genomics* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/genomics/v1beta2/reference). @@ -339,7 +339,7 @@ impl<'a, C, NC, A> Genomics Genomics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -382,7 +382,7 @@ impl<'a, C, NC, A> Genomics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/gmail1/Cargo.toml b/gen/gmail1/Cargo.toml index d6a544b461c..5f5f2572139 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gmail1" -version = "0.1.0+20150313" +version = "0.1.1+20150313" authors = ["Sebastian Thiel "] description = "A complete library to interact with gmail (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gmail1" diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index f25884b1241..1f6ce1be9a7 100644 --- a/gen/gmail1/README.md +++ b/gen/gmail1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-gmail1` library allows access to all features of the *Google gmail* service. -This documentation was generated from *gmail* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *gmail* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *gmail* *v1* API can be found at the [official documentation site](https://developers.google.com/gmail/api/). diff --git a/gen/gmail1/src/cmn.rs b/gen/gmail1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/gmail1/src/cmn.rs +++ b/gen/gmail1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/gmail1/src/lib.rs b/gen/gmail1/src/lib.rs index b43b7703164..a3dd81c91d3 100644 --- a/gen/gmail1/src/lib.rs +++ b/gen/gmail1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *gmail* crate version *0.1.0+20150313*, where *20150313* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *gmail* crate version *0.1.1+20150313*, where *20150313* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *gmail* *v1* API can be found at the //! [official documentation site](https://developers.google.com/gmail/api/). @@ -337,7 +337,7 @@ impl<'a, C, NC, A> Gmail Gmail { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -347,7 +347,7 @@ impl<'a, C, NC, A> Gmail } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1520,8 +1520,8 @@ impl<'a, C, NC, A> UserMessageImportCall<'a, C, NC, A> where NC: hyper::net::Net mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -1570,8 +1570,8 @@ impl<'a, C, NC, A> UserMessageImportCall<'a, C, NC, A> where NC: hyper::net::Net if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -2204,8 +2204,8 @@ impl<'a, C, NC, A> UserDraftCreateCall<'a, C, NC, A> where NC: hyper::net::Netwo mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -2254,8 +2254,8 @@ impl<'a, C, NC, A> UserDraftCreateCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -3549,8 +3549,8 @@ impl<'a, C, NC, A> UserDraftSendCall<'a, C, NC, A> where NC: hyper::net::Network mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -3599,8 +3599,8 @@ impl<'a, C, NC, A> UserDraftSendCall<'a, C, NC, A> where NC: hyper::net::Network if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -4628,8 +4628,8 @@ impl<'a, C, NC, A> UserDraftUpdateCall<'a, C, NC, A> where NC: hyper::net::Netwo mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -4678,8 +4678,8 @@ impl<'a, C, NC, A> UserDraftUpdateCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -8105,8 +8105,8 @@ impl<'a, C, NC, A> UserMessageSendCall<'a, C, NC, A> where NC: hyper::net::Netwo mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -8155,8 +8155,8 @@ impl<'a, C, NC, A> UserMessageSendCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -9567,8 +9567,8 @@ impl<'a, C, NC, A> UserMessageInsertCall<'a, C, NC, A> where NC: hyper::net::Net mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -9617,8 +9617,8 @@ impl<'a, C, NC, A> UserMessageInsertCall<'a, C, NC, A> where NC: hyper::net::Net if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 36700160 { + return Result::UploadSizeLimitExceeded(size, 36700160) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/groupsmigration1/Cargo.toml b/gen/groupsmigration1/Cargo.toml index dcb83ecb0c1..33c4bad5a7d 100644 --- a/gen/groupsmigration1/Cargo.toml +++ b/gen/groupsmigration1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupsmigration1" -version = "0.1.0+20140416" +version = "0.1.1+20140416" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1" diff --git a/gen/groupsmigration1/README.md b/gen/groupsmigration1/README.md index 7d34cc88a6b..a61037a4901 100644 --- a/gen/groupsmigration1/README.md +++ b/gen/groupsmigration1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-groupsmigration1` library allows access to all features of the *Google Groups Migration* service. -This documentation was generated from *Groups Migration* crate version *0.1.0+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Groups Migration* crate version *0.1.1+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Groups Migration* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-migration/). diff --git a/gen/groupsmigration1/src/cmn.rs b/gen/groupsmigration1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/groupsmigration1/src/cmn.rs +++ b/gen/groupsmigration1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index b8996aff22e..24a47ca6eb5 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Groups Migration* crate version *0.1.0+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Groups Migration* crate version *0.1.1+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Groups Migration* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-migration/). @@ -293,7 +293,7 @@ impl<'a, C, NC, A> GroupsMigration GroupsMigration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -303,7 +303,7 @@ impl<'a, C, NC, A> GroupsMigration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -554,8 +554,8 @@ impl<'a, C, NC, A> ArchiveInsertCall<'a, C, NC, A> where NC: hyper::net::Network if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 16777216 { + return Result::UploadSizeLimitExceeded(size, 16777216) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -595,8 +595,8 @@ impl<'a, C, NC, A> ArchiveInsertCall<'a, C, NC, A> where NC: hyper::net::Network if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 16777216 { + return Result::UploadSizeLimitExceeded(size, 16777216) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/groupssettings1/Cargo.toml b/gen/groupssettings1/Cargo.toml index b1b47347a27..a5ba989e0bf 100644 --- a/gen/groupssettings1/Cargo.toml +++ b/gen/groupssettings1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupssettings1" -version = "0.1.0+20140428" +version = "0.1.1+20140428" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1" diff --git a/gen/groupssettings1/README.md b/gen/groupssettings1/README.md index 43f7f1dbbee..dcfb7de0a18 100644 --- a/gen/groupssettings1/README.md +++ b/gen/groupssettings1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-groupssettings1` library allows access to all features of the *Google groupssettings* service. -This documentation was generated from *groupssettings* crate version *0.1.0+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *groupssettings* crate version *0.1.1+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *groupssettings* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). diff --git a/gen/groupssettings1/src/cmn.rs b/gen/groupssettings1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/groupssettings1/src/cmn.rs +++ b/gen/groupssettings1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index 2d817f3c02c..d0c69d5ebc0 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *groupssettings* crate version *0.1.0+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *groupssettings* crate version *0.1.1+20140428*, where *20140428* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *groupssettings* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). @@ -301,7 +301,7 @@ impl<'a, C, NC, A> Groupssettings Groupssettings { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -311,7 +311,7 @@ impl<'a, C, NC, A> Groupssettings } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/identitytoolkit3/Cargo.toml b/gen/identitytoolkit3/Cargo.toml index 9141541a64c..211cf578703 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3" -version = "0.1.0+20141009" +version = "0.1.1+20141009" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3" diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index 26710dcad03..5342710671e 100644 --- a/gen/identitytoolkit3/README.md +++ b/gen/identitytoolkit3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-identitytoolkit3` library allows access to all features of the *Google Identity Toolkit* service. -This documentation was generated from *Identity Toolkit* crate version *0.1.0+20141009*, where *20141009* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Identity Toolkit* crate version *0.1.1+20141009*, where *20141009* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Identity Toolkit* *v3* API can be found at the [official documentation site](https://developers.google.com/identity-toolkit/v3/). diff --git a/gen/identitytoolkit3/src/cmn.rs b/gen/identitytoolkit3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/identitytoolkit3/src/cmn.rs +++ b/gen/identitytoolkit3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/identitytoolkit3/src/lib.rs b/gen/identitytoolkit3/src/lib.rs index 0bc64fcc770..bfda80002d7 100644 --- a/gen/identitytoolkit3/src/lib.rs +++ b/gen/identitytoolkit3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Identity Toolkit* crate version *0.1.0+20141009*, where *20141009* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Identity Toolkit* crate version *0.1.1+20141009*, where *20141009* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). @@ -277,7 +277,7 @@ impl<'a, C, NC, A> IdentityToolkit IdentityToolkit { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -287,7 +287,7 @@ impl<'a, C, NC, A> IdentityToolkit } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/licensing1/Cargo.toml b/gen/licensing1/Cargo.toml index 87b0cf8c00f..404ccd0047e 100644 --- a/gen/licensing1/Cargo.toml +++ b/gen/licensing1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1" -version = "0.1.0+20140122" +version = "0.1.1+20140122" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1" diff --git a/gen/licensing1/README.md b/gen/licensing1/README.md index 529986373a4..52e0386367b 100644 --- a/gen/licensing1/README.md +++ b/gen/licensing1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-licensing1` library allows access to all features of the *Google licensing* service. -This documentation was generated from *licensing* crate version *0.1.0+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *licensing* crate version *0.1.1+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *licensing* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/licensing/). diff --git a/gen/licensing1/src/cmn.rs b/gen/licensing1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/licensing1/src/cmn.rs +++ b/gen/licensing1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index bfb4c2bd1e5..7f3e33489fc 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *licensing* crate version *0.1.0+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *licensing* crate version *0.1.1+20140122*, where *20140122* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *licensing* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/licensing/). @@ -297,7 +297,7 @@ impl<'a, C, NC, A> Licensing Licensing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -307,7 +307,7 @@ impl<'a, C, NC, A> Licensing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/manager1_beta2/Cargo.toml b/gen/manager1_beta2/Cargo.toml index 62579bb7039..addf6b3733c 100644 --- a/gen/manager1_beta2/Cargo.toml +++ b/gen/manager1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manager1_beta2" -version = "0.1.0+20140915" +version = "0.1.1+20140915" authors = ["Sebastian Thiel "] description = "A complete library to interact with manager (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2" diff --git a/gen/manager1_beta2/README.md b/gen/manager1_beta2/README.md index e45d25e79be..d2e0a431ec6 100644 --- a/gen/manager1_beta2/README.md +++ b/gen/manager1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-manager1_beta2` library allows access to all features of the *Google manager* service. -This documentation was generated from *manager* crate version *0.1.0+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *manager* crate version *0.1.1+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *manager* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). diff --git a/gen/manager1_beta2/src/cmn.rs b/gen/manager1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/manager1_beta2/src/cmn.rs +++ b/gen/manager1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/manager1_beta2/src/lib.rs b/gen/manager1_beta2/src/lib.rs index 8c616daccde..f51d0aec324 100644 --- a/gen/manager1_beta2/src/lib.rs +++ b/gen/manager1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *manager* crate version *0.1.0+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *manager* crate version *0.1.1+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *manager* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). @@ -316,7 +316,7 @@ impl<'a, C, NC, A> Manager Manager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -329,7 +329,7 @@ impl<'a, C, NC, A> Manager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/mapsengine1/Cargo.toml b/gen/mapsengine1/Cargo.toml index 2ef164f759a..38b26695746 100644 --- a/gen/mapsengine1/Cargo.toml +++ b/gen/mapsengine1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mapsengine1" -version = "0.1.0+20150225" +version = "0.1.1+20150225" authors = ["Sebastian Thiel "] description = "A complete library to interact with Maps Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mapsengine1" diff --git a/gen/mapsengine1/README.md b/gen/mapsengine1/README.md index 46bc9ef570b..21344bfc041 100644 --- a/gen/mapsengine1/README.md +++ b/gen/mapsengine1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mapsengine1` library allows access to all features of the *Google Maps Engine* service. -This documentation was generated from *Maps Engine* crate version *0.1.0+20150225*, where *20150225* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Maps Engine* crate version *0.1.1+20150225*, where *20150225* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Maps Engine* *v1* API can be found at the [official documentation site](https://developers.google.com/maps-engine/). diff --git a/gen/mapsengine1/src/cmn.rs b/gen/mapsengine1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/mapsengine1/src/cmn.rs +++ b/gen/mapsengine1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/mapsengine1/src/lib.rs b/gen/mapsengine1/src/lib.rs index 30eff755db9..bb29a62eb16 100644 --- a/gen/mapsengine1/src/lib.rs +++ b/gen/mapsengine1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Maps Engine* crate version *0.1.0+20150225*, where *20150225* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Maps Engine* crate version *0.1.1+20150225*, where *20150225* is the exact revision of the *mapsengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Maps Engine* *v1* API can be found at the //! [official documentation site](https://developers.google.com/maps-engine/). @@ -355,7 +355,7 @@ impl<'a, C, NC, A> MapsEngine MapsEngine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -383,7 +383,7 @@ impl<'a, C, NC, A> MapsEngine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -8866,8 +8866,8 @@ impl<'a, C, NC, A> RasterFileInsertCall<'a, C, NC, A> where NC: hyper::net::Netw if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10737418240 { + return Result::UploadSizeLimitExceeded(size, 10737418240) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -8907,8 +8907,8 @@ impl<'a, C, NC, A> RasterFileInsertCall<'a, C, NC, A> where NC: hyper::net::Netw if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10737418240 { + return Result::UploadSizeLimitExceeded(size, 10737418240) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -11820,8 +11820,8 @@ impl<'a, C, NC, A> TableFileInsertCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -11861,8 +11861,8 @@ impl<'a, C, NC, A> TableFileInsertCall<'a, C, NC, A> where NC: hyper::net::Netwo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 1073741824 { + return Result::UploadSizeLimitExceeded(size, 1073741824) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -22968,8 +22968,8 @@ impl<'a, C, NC, A> ProjectIconCreateCall<'a, C, NC, A> where NC: hyper::net::Net mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 102400 { + return Result::UploadSizeLimitExceeded(size, 102400) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -23018,8 +23018,8 @@ impl<'a, C, NC, A> ProjectIconCreateCall<'a, C, NC, A> where NC: hyper::net::Net if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 102400 { + return Result::UploadSizeLimitExceeded(size, 102400) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/mirror1/Cargo.toml b/gen/mirror1/Cargo.toml index 5d8fe03a159..0d994a05e17 100644 --- a/gen/mirror1/Cargo.toml +++ b/gen/mirror1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1" -version = "0.1.0+20150220" +version = "0.1.1+20150220" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1" diff --git a/gen/mirror1/README.md b/gen/mirror1/README.md index 24da87d89d5..93bdf19d9de 100644 --- a/gen/mirror1/README.md +++ b/gen/mirror1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-mirror1` library allows access to all features of the *Google mirror* service. -This documentation was generated from *mirror* crate version *0.1.0+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *mirror* crate version *0.1.1+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *mirror* *v1* API can be found at the [official documentation site](https://developers.google.com/glass). diff --git a/gen/mirror1/src/cmn.rs b/gen/mirror1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/mirror1/src/cmn.rs +++ b/gen/mirror1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index d3841b76725..3cde66dd59b 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *mirror* crate version *0.1.0+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *mirror* crate version *0.1.1+20150220*, where *20150220* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *mirror* *v1* API can be found at the //! [official documentation site](https://developers.google.com/glass). @@ -328,7 +328,7 @@ impl<'a, C, NC, A> Mirror Mirror { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -353,7 +353,7 @@ impl<'a, C, NC, A> Mirror } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -2835,8 +2835,8 @@ impl<'a, C, NC, A> TimelineInsertCall<'a, C, NC, A> where NC: hyper::net::Networ mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -2885,8 +2885,8 @@ impl<'a, C, NC, A> TimelineInsertCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -3725,8 +3725,8 @@ impl<'a, C, NC, A> TimelineAttachmentInsertCall<'a, C, NC, A> where NC: hyper::n if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -3766,8 +3766,8 @@ impl<'a, C, NC, A> TimelineAttachmentInsertCall<'a, C, NC, A> where NC: hyper::n if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -4529,8 +4529,8 @@ impl<'a, C, NC, A> TimelineUpdateCall<'a, C, NC, A> where NC: hyper::net::Networ mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -4579,8 +4579,8 @@ impl<'a, C, NC, A> TimelineUpdateCall<'a, C, NC, A> where NC: hyper::net::Networ if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/oauth2_v2/Cargo.toml b/gen/oauth2_v2/Cargo.toml index 9e28e3b350a..ac3cf5daf5a 100644 --- a/gen/oauth2_v2/Cargo.toml +++ b/gen/oauth2_v2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oauth2_v2" -version = "0.1.0+20150227" +version = "0.1.1+20150227" authors = ["Sebastian Thiel "] description = "A complete library to interact with oauth2 (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oauth2_v2" diff --git a/gen/oauth2_v2/README.md b/gen/oauth2_v2/README.md index 06ff14f0cc7..c1b719861ce 100644 --- a/gen/oauth2_v2/README.md +++ b/gen/oauth2_v2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-oauth2_v2` library allows access to all features of the *Google oauth2* service. -This documentation was generated from *oauth2* crate version *0.1.0+20150227*, where *20150227* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *oauth2* crate version *0.1.1+20150227*, where *20150227* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *oauth2* *v2* API can be found at the [official documentation site](https://developers.google.com/accounts/docs/OAuth2). diff --git a/gen/oauth2_v2/src/cmn.rs b/gen/oauth2_v2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/oauth2_v2/src/cmn.rs +++ b/gen/oauth2_v2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/oauth2_v2/src/lib.rs b/gen/oauth2_v2/src/lib.rs index 726dad4c1dc..eb6db564289 100644 --- a/gen/oauth2_v2/src/lib.rs +++ b/gen/oauth2_v2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *oauth2* crate version *0.1.0+20150227*, where *20150227* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *oauth2* crate version *0.1.1+20150227*, where *20150227* is the exact revision of the *oauth2:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *oauth2* *v2* API can be found at the //! [official documentation site](https://developers.google.com/accounts/docs/OAuth2). @@ -304,7 +304,7 @@ impl<'a, C, NC, A> Oauth2 Oauth2 { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -317,7 +317,7 @@ impl<'a, C, NC, A> Oauth2 } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pagespeedonline2/Cargo.toml b/gen/pagespeedonline2/Cargo.toml index 9c8d729ecc2..af47ee0f5b7 100644 --- a/gen/pagespeedonline2/Cargo.toml +++ b/gen/pagespeedonline2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pagespeedonline2" -version = "0.1.0+20150108" +version = "0.1.1+20150108" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2" diff --git a/gen/pagespeedonline2/README.md b/gen/pagespeedonline2/README.md index 1b135e757bf..c710f1a9d23 100644 --- a/gen/pagespeedonline2/README.md +++ b/gen/pagespeedonline2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-pagespeedonline2` library allows access to all features of the *Google pagespeedonline* service. -This documentation was generated from *pagespeedonline* crate version *0.1.0+20150108*, where *20150108* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *pagespeedonline* crate version *0.1.1+20150108*, where *20150108* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *pagespeedonline* *v2* API can be found at the [official documentation site](https://developers.google.com/speed/docs/insights/v1/getting_started). diff --git a/gen/pagespeedonline2/src/cmn.rs b/gen/pagespeedonline2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/pagespeedonline2/src/cmn.rs +++ b/gen/pagespeedonline2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/pagespeedonline2/src/lib.rs b/gen/pagespeedonline2/src/lib.rs index cbc01b4eef1..cdd8a8b9ef2 100644 --- a/gen/pagespeedonline2/src/lib.rs +++ b/gen/pagespeedonline2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pagespeedonline* crate version *0.1.0+20150108*, where *20150108* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *pagespeedonline* crate version *0.1.1+20150108*, where *20150108* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *pagespeedonline* *v2* API can be found at the //! [official documentation site](https://developers.google.com/speed/docs/insights/v1/getting_started). @@ -275,7 +275,7 @@ impl<'a, C, NC, A> Pagespeedonline Pagespeedonline { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -285,7 +285,7 @@ impl<'a, C, NC, A> Pagespeedonline } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/plusdomains1/Cargo.toml b/gen/plusdomains1/Cargo.toml index b04918ed42a..e507a5cc7cf 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1" -version = "0.1.0+20150303" +version = "0.1.1+20150303" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1" diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index 0eeed408034..f60c7b0c0c5 100644 --- a/gen/plusdomains1/README.md +++ b/gen/plusdomains1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-plusdomains1` library allows access to all features of the *Google plusDomains* service. -This documentation was generated from *plusDomains* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *plusDomains* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *plusDomains* *v1* API can be found at the [official documentation site](https://developers.google.com/+/domains/). diff --git a/gen/plusdomains1/src/cmn.rs b/gen/plusdomains1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/plusdomains1/src/cmn.rs +++ b/gen/plusdomains1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index 35b7d3ccd0b..20ac8d7bf21 100644 --- a/gen/plusdomains1/src/lib.rs +++ b/gen/plusdomains1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plusDomains* crate version *0.1.0+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *plusDomains* crate version *0.1.1+20150303*, where *20150303* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). @@ -348,7 +348,7 @@ impl<'a, C, NC, A> PlusDomains PlusDomains { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -373,7 +373,7 @@ impl<'a, C, NC, A> PlusDomains } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -6268,9 +6268,7 @@ impl<'a, C, NC, A> MediaInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCo mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); let mime_type = mp_reader.mime_type(); @@ -6318,9 +6316,7 @@ impl<'a, C, NC, A> MediaInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { let url = &res.headers.get::().expect("Location header is part of protocol").0; diff --git a/gen/prediction1d6/Cargo.toml b/gen/prediction1d6/Cargo.toml index 0d3ab2e247f..ab868502d89 100644 --- a/gen/prediction1d6/Cargo.toml +++ b/gen/prediction1d6/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-prediction1d6" -version = "0.1.0+20140522" +version = "0.1.1+20140522" authors = ["Sebastian Thiel "] description = "A complete library to interact with prediction (protocol v1.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6" diff --git a/gen/prediction1d6/README.md b/gen/prediction1d6/README.md index f6e48f91fda..442229cb4ad 100644 --- a/gen/prediction1d6/README.md +++ b/gen/prediction1d6/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-prediction1d6` library allows access to all features of the *Google prediction* service. -This documentation was generated from *prediction* crate version *0.1.0+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *prediction* crate version *0.1.1+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *prediction* *v1d6* API can be found at the [official documentation site](https://developers.google.com/prediction/docs/developer-guide). diff --git a/gen/prediction1d6/src/cmn.rs b/gen/prediction1d6/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/prediction1d6/src/cmn.rs +++ b/gen/prediction1d6/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/prediction1d6/src/lib.rs b/gen/prediction1d6/src/lib.rs index 218fa09ee5e..4c6957e0037 100644 --- a/gen/prediction1d6/src/lib.rs +++ b/gen/prediction1d6/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *prediction* crate version *0.1.0+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *prediction* crate version *0.1.1+20140522*, where *20140522* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *prediction* *v1d6* API can be found at the //! [official documentation site](https://developers.google.com/prediction/docs/developer-guide). @@ -315,7 +315,7 @@ impl<'a, C, NC, A> Prediction Prediction { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -328,7 +328,7 @@ impl<'a, C, NC, A> Prediction } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pubsub1_beta2/Cargo.toml b/gen/pubsub1_beta2/Cargo.toml index 70c2d0bb001..7aba2e932d3 100644 --- a/gen/pubsub1_beta2/Cargo.toml +++ b/gen/pubsub1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1_beta2" -version = "0.1.0+20150213" +version = "0.1.1+20150213" authors = ["Sebastian Thiel "] description = "A complete library to interact with pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2" diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index 6556f423a64..6ccd77fcf76 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-pubsub1_beta2` library allows access to all features of the *Google pubsub* service. -This documentation was generated from *pubsub* crate version *0.1.0+20150213*, where *20150213* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *pubsub* crate version *0.1.1+20150213*, where *20150213* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. # Features Handle the following *Resources* with ease from the central [hub](http://byron.github.io/google-apis-rs/google-pubsub1_beta2/struct.Pubsub.html) ... diff --git a/gen/pubsub1_beta2/src/cmn.rs b/gen/pubsub1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/pubsub1_beta2/src/cmn.rs +++ b/gen/pubsub1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index 09811d2c857..e55ea68c7d6 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pubsub* crate version *0.1.0+20150213*, where *20150213* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *pubsub* crate version *0.1.1+20150213*, where *20150213* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2). //! # Features //! @@ -304,7 +304,7 @@ impl<'a, C, NC, A> Pubsub Pubsub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -314,7 +314,7 @@ impl<'a, C, NC, A> Pubsub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/qpxexpress1/Cargo.toml b/gen/qpxexpress1/Cargo.toml index c5afcd3a544..bf4404871e0 100644 --- a/gen/qpxexpress1/Cargo.toml +++ b/gen/qpxexpress1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-qpxexpress1" -version = "0.1.0+20140321" +version = "0.1.1+20140321" authors = ["Sebastian Thiel "] description = "A complete library to interact with QPX Express (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1" diff --git a/gen/qpxexpress1/README.md b/gen/qpxexpress1/README.md index f543479d11a..63644549703 100644 --- a/gen/qpxexpress1/README.md +++ b/gen/qpxexpress1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-qpxexpress1` library allows access to all features of the *Google QPX Express* service. -This documentation was generated from *QPX Express* crate version *0.1.0+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *QPX Express* crate version *0.1.1+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *QPX Express* *v1* API can be found at the [official documentation site](http://developers.google.com/qpx-express). diff --git a/gen/qpxexpress1/src/cmn.rs b/gen/qpxexpress1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/qpxexpress1/src/cmn.rs +++ b/gen/qpxexpress1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/qpxexpress1/src/lib.rs b/gen/qpxexpress1/src/lib.rs index ade6357b48b..643acc14633 100644 --- a/gen/qpxexpress1/src/lib.rs +++ b/gen/qpxexpress1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *QPX Express* crate version *0.1.0+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *QPX Express* crate version *0.1.1+20140321*, where *20140321* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *QPX Express* *v1* API can be found at the //! [official documentation site](http://developers.google.com/qpx-express). @@ -277,7 +277,7 @@ impl<'a, C, NC, A> QPXExpress QPXExpress { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -287,7 +287,7 @@ impl<'a, C, NC, A> QPXExpress } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/replicapool1_beta2/Cargo.toml b/gen/replicapool1_beta2/Cargo.toml index cb3ba862a9a..86804ce06ec 100644 --- a/gen/replicapool1_beta2/Cargo.toml +++ b/gen/replicapool1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2" -version = "0.1.0+20141002" +version = "0.1.1+20141002" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2" diff --git a/gen/replicapool1_beta2/README.md b/gen/replicapool1_beta2/README.md index a5c95747b98..ca2603943f0 100644 --- a/gen/replicapool1_beta2/README.md +++ b/gen/replicapool1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-replicapool1_beta2` library allows access to all features of the *Google replicapool* service. -This documentation was generated from *replicapool* crate version *0.1.0+20141002*, where *20141002* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *replicapool* crate version *0.1.1+20141002*, where *20141002* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *replicapool* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). diff --git a/gen/replicapool1_beta2/src/cmn.rs b/gen/replicapool1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/replicapool1_beta2/src/cmn.rs +++ b/gen/replicapool1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index 1ac8929f436..9f549bd7181 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapool* crate version *0.1.0+20141002*, where *20141002* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *replicapool* crate version *0.1.1+20141002*, where *20141002* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *replicapool* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). @@ -312,7 +312,7 @@ impl<'a, C, NC, A> Replicapool Replicapool { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -325,7 +325,7 @@ impl<'a, C, NC, A> Replicapool } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/replicapoolupdater1_beta1/Cargo.toml b/gen/replicapoolupdater1_beta1/Cargo.toml index 17b9ef52835..c64ba938fb6 100644 --- a/gen/replicapoolupdater1_beta1/Cargo.toml +++ b/gen/replicapoolupdater1_beta1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapoolupdater1_beta1" -version = "0.1.0+20150129" +version = "0.1.1+20150129" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapoolupdater (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1" diff --git a/gen/replicapoolupdater1_beta1/README.md b/gen/replicapoolupdater1_beta1/README.md index f1e242b55fc..f5faa122c4c 100644 --- a/gen/replicapoolupdater1_beta1/README.md +++ b/gen/replicapoolupdater1_beta1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-replicapoolupdater1_beta1` library allows access to all features of the *Google replicapoolupdater* service. -This documentation was generated from *replicapoolupdater* crate version *0.1.0+20150129*, where *20150129* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *replicapoolupdater* crate version *0.1.1+20150129*, where *20150129* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). diff --git a/gen/replicapoolupdater1_beta1/src/cmn.rs b/gen/replicapoolupdater1_beta1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/replicapoolupdater1_beta1/src/cmn.rs +++ b/gen/replicapoolupdater1_beta1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs b/gen/replicapoolupdater1_beta1/src/lib.rs index 777258d0814..a46ba4ad936 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs +++ b/gen/replicapoolupdater1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapoolupdater* crate version *0.1.0+20150129*, where *20150129* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *replicapoolupdater* crate version *0.1.1+20150129*, where *20150129* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). @@ -312,7 +312,7 @@ impl<'a, C, NC, A> Replicapoolupdater Replicapoolupdater { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -325,7 +325,7 @@ impl<'a, C, NC, A> Replicapoolupdater } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/reseller1_sandbox/Cargo.toml b/gen/reseller1_sandbox/Cargo.toml index 328f690207a..b6dcf942138 100644 --- a/gen/reseller1_sandbox/Cargo.toml +++ b/gen/reseller1_sandbox/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox" -version = "0.1.0+20141112" +version = "0.1.1+20141112" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox" diff --git a/gen/reseller1_sandbox/README.md b/gen/reseller1_sandbox/README.md index f74d0c62b54..8f1567febd9 100644 --- a/gen/reseller1_sandbox/README.md +++ b/gen/reseller1_sandbox/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-reseller1_sandbox` library allows access to all features of the *Google reseller* service. -This documentation was generated from *reseller* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *reseller* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *reseller* *v1_sandbox* API can be found at the [official documentation site](https://developers.google.com/google-apps/reseller/). diff --git a/gen/reseller1_sandbox/src/cmn.rs b/gen/reseller1_sandbox/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/reseller1_sandbox/src/cmn.rs +++ b/gen/reseller1_sandbox/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index 959bdc5225e..f5ca77ea6f3 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reseller* crate version *0.1.0+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *reseller* crate version *0.1.1+20141112*, where *20141112* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *reseller* *v1_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/reseller/). @@ -312,7 +312,7 @@ impl<'a, C, NC, A> Reseller Reseller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -325,7 +325,7 @@ impl<'a, C, NC, A> Reseller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/resourceviews1_beta2/Cargo.toml b/gen/resourceviews1_beta2/Cargo.toml index eceb7af963a..392dbe33d51 100644 --- a/gen/resourceviews1_beta2/Cargo.toml +++ b/gen/resourceviews1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2" -version = "0.1.0+20140904" +version = "0.1.1+20140904" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2" diff --git a/gen/resourceviews1_beta2/README.md b/gen/resourceviews1_beta2/README.md index f5214a37744..45caa274722 100644 --- a/gen/resourceviews1_beta2/README.md +++ b/gen/resourceviews1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-resourceviews1_beta2` library allows access to all features of the *Google resourceviews* service. -This documentation was generated from *resourceviews* crate version *0.1.0+20140904*, where *20140904* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *resourceviews* crate version *0.1.1+20140904*, where *20140904* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *resourceviews* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/). diff --git a/gen/resourceviews1_beta2/src/cmn.rs b/gen/resourceviews1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/resourceviews1_beta2/src/cmn.rs +++ b/gen/resourceviews1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/resourceviews1_beta2/src/lib.rs b/gen/resourceviews1_beta2/src/lib.rs index bfe709ba209..51e1f145fc9 100644 --- a/gen/resourceviews1_beta2/src/lib.rs +++ b/gen/resourceviews1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *resourceviews* crate version *0.1.0+20140904*, where *20140904* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *resourceviews* crate version *0.1.1+20140904*, where *20140904* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *resourceviews* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/). @@ -322,7 +322,7 @@ impl<'a, C, NC, A> Resourceviews Resourceviews { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -335,7 +335,7 @@ impl<'a, C, NC, A> Resourceviews } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/siteverification1/Cargo.toml b/gen/siteverification1/Cargo.toml index 8d273938055..96b6b74ef8b 100644 --- a/gen/siteverification1/Cargo.toml +++ b/gen/siteverification1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-siteverification1" -version = "0.1.0+20131007" +version = "0.1.1+20131007" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1" diff --git a/gen/siteverification1/README.md b/gen/siteverification1/README.md index 2d5a8c5c644..acf118c536d 100644 --- a/gen/siteverification1/README.md +++ b/gen/siteverification1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-siteverification1` library allows access to all features of the *Google siteVerification* service. -This documentation was generated from *siteVerification* crate version *0.1.0+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *siteVerification* crate version *0.1.1+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *siteVerification* *v1* API can be found at the [official documentation site](https://developers.google.com/site-verification/). diff --git a/gen/siteverification1/src/cmn.rs b/gen/siteverification1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/siteverification1/src/cmn.rs +++ b/gen/siteverification1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/siteverification1/src/lib.rs b/gen/siteverification1/src/lib.rs index 0c606764875..420127252b7 100644 --- a/gen/siteverification1/src/lib.rs +++ b/gen/siteverification1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *siteVerification* crate version *0.1.0+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *siteVerification* crate version *0.1.1+20131007*, where *20131007* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *siteVerification* *v1* API can be found at the //! [official documentation site](https://developers.google.com/site-verification/). @@ -306,7 +306,7 @@ impl<'a, C, NC, A> SiteVerification SiteVerification { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -316,7 +316,7 @@ impl<'a, C, NC, A> SiteVerification } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/spectrum1_explorer/Cargo.toml b/gen/spectrum1_explorer/Cargo.toml index f93266a58b4..6f39f0cdec1 100644 --- a/gen/spectrum1_explorer/Cargo.toml +++ b/gen/spectrum1_explorer/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spectrum1_explorer" -version = "0.1.0+20150112" +version = "0.1.1+20150112" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer" diff --git a/gen/spectrum1_explorer/README.md b/gen/spectrum1_explorer/README.md index 1907b40d8e0..59b928c1e59 100644 --- a/gen/spectrum1_explorer/README.md +++ b/gen/spectrum1_explorer/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-spectrum1_explorer` library allows access to all features of the *Google spectrum* service. -This documentation was generated from *spectrum* crate version *0.1.0+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *spectrum* crate version *0.1.1+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *spectrum* *v1_explorer* API can be found at the [official documentation site](http://developers.google.com/spectrum). diff --git a/gen/spectrum1_explorer/src/cmn.rs b/gen/spectrum1_explorer/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/spectrum1_explorer/src/cmn.rs +++ b/gen/spectrum1_explorer/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/spectrum1_explorer/src/lib.rs b/gen/spectrum1_explorer/src/lib.rs index 17e68cc8d31..28ea3946e75 100644 --- a/gen/spectrum1_explorer/src/lib.rs +++ b/gen/spectrum1_explorer/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *spectrum* crate version *0.1.0+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *spectrum* crate version *0.1.1+20150112*, where *20150112* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *spectrum* *v1_explorer* API can be found at the //! [official documentation site](http://developers.google.com/spectrum). @@ -277,7 +277,7 @@ impl<'a, C, NC, A> Spectrum Spectrum { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -287,7 +287,7 @@ impl<'a, C, NC, A> Spectrum } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/sqladmin1_beta4/Cargo.toml b/gen/sqladmin1_beta4/Cargo.toml index 1db3186359e..242af1508a6 100644 --- a/gen/sqladmin1_beta4/Cargo.toml +++ b/gen/sqladmin1_beta4/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sqladmin1_beta4" -version = "0.1.0+20150109" +version = "0.1.1+20150109" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4" diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 58cdf889662..73902bf79d3 100644 --- a/gen/sqladmin1_beta4/README.md +++ b/gen/sqladmin1_beta4/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-sqladmin1_beta4` library allows access to all features of the *Google SQL Admin* service. -This documentation was generated from *SQL Admin* crate version *0.1.0+20150109*, where *20150109* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *SQL Admin* crate version *0.1.1+20150109*, where *20150109* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *SQL Admin* *v1_beta4* API can be found at the [official documentation site](https://developers.google.com/cloud-sql/docs/admin-api/). diff --git a/gen/sqladmin1_beta4/src/cmn.rs b/gen/sqladmin1_beta4/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/sqladmin1_beta4/src/cmn.rs +++ b/gen/sqladmin1_beta4/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index 346631f9261..4c1e4cbed8e 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *SQL Admin* crate version *0.1.0+20150109*, where *20150109* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *SQL Admin* crate version *0.1.1+20150109*, where *20150109* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *SQL Admin* *v1_beta4* API can be found at the //! [official documentation site](https://developers.google.com/cloud-sql/docs/admin-api/). @@ -339,7 +339,7 @@ impl<'a, C, NC, A> SQLAdmin SQLAdmin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -370,7 +370,7 @@ impl<'a, C, NC, A> SQLAdmin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/storage1/Cargo.toml b/gen/storage1/Cargo.toml index 412ce895242..174f75597cd 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storage1" -version = "0.1.0+20150213" +version = "0.1.1+20150213" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1" diff --git a/gen/storage1/README.md b/gen/storage1/README.md index 8d0a0fe989d..389064ea953 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-storage1` library allows access to all features of the *Google storage* service. -This documentation was generated from *storage* crate version *0.1.0+20150213*, where *20150213* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *storage* crate version *0.1.1+20150213*, where *20150213* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *storage* *v1* API can be found at the [official documentation site](https://developers.google.com/storage/docs/json_api/). diff --git a/gen/storage1/src/cmn.rs b/gen/storage1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/storage1/src/cmn.rs +++ b/gen/storage1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/storage1/src/lib.rs b/gen/storage1/src/lib.rs index 04cd6e2df2f..d9c0ee7f0ce 100644 --- a/gen/storage1/src/lib.rs +++ b/gen/storage1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *storage* crate version *0.1.0+20150213*, where *20150213* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *storage* crate version *0.1.1+20150213*, where *20150213* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *storage* *v1* API can be found at the //! [official documentation site](https://developers.google.com/storage/docs/json_api/). @@ -349,7 +349,7 @@ impl<'a, C, NC, A> Storage Storage { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -374,7 +374,7 @@ impl<'a, C, NC, A> Storage } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -6408,9 +6408,7 @@ impl<'a, C, NC, A> ObjectInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkC mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); let mime_type = mp_reader.mime_type(); @@ -6458,9 +6456,7 @@ impl<'a, C, NC, A> ObjectInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkC if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) - } + let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { let url = &res.headers.get::().expect("Location header is part of protocol").0; diff --git a/gen/tagmanager1/Cargo.toml b/gen/tagmanager1/Cargo.toml index 702a91fdf92..a10c2a32cc3 100644 --- a/gen/tagmanager1/Cargo.toml +++ b/gen/tagmanager1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tagmanager1" -version = "0.1.0+20150121" +version = "0.1.1+20150121" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1" diff --git a/gen/tagmanager1/README.md b/gen/tagmanager1/README.md index da3e73b4fab..ea5a865960b 100644 --- a/gen/tagmanager1/README.md +++ b/gen/tagmanager1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-tagmanager1` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *0.1.0+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *Tag Manager* crate version *0.1.1+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *Tag Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/tag-manager/api/v1/). diff --git a/gen/tagmanager1/src/cmn.rs b/gen/tagmanager1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/tagmanager1/src/cmn.rs +++ b/gen/tagmanager1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/tagmanager1/src/lib.rs b/gen/tagmanager1/src/lib.rs index 3ceb813e86a..90f583c3f4e 100644 --- a/gen/tagmanager1/src/lib.rs +++ b/gen/tagmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *0.1.0+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *Tag Manager* crate version *0.1.1+20150121*, where *20150121* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *Tag Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/tag-manager/api/v1/). @@ -370,7 +370,7 @@ impl<'a, C, NC, A> TagManager TagManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -380,7 +380,7 @@ impl<'a, C, NC, A> TagManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/taskqueue1_beta2/Cargo.toml b/gen/taskqueue1_beta2/Cargo.toml index c6574c472f9..3ab91b50822 100644 --- a/gen/taskqueue1_beta2/Cargo.toml +++ b/gen/taskqueue1_beta2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-taskqueue1_beta2" -version = "0.1.0+20141111" +version = "0.1.1+20141111" authors = ["Sebastian Thiel "] description = "A complete library to interact with taskqueue (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2" diff --git a/gen/taskqueue1_beta2/README.md b/gen/taskqueue1_beta2/README.md index 0d49eff279e..ff73a45715d 100644 --- a/gen/taskqueue1_beta2/README.md +++ b/gen/taskqueue1_beta2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-taskqueue1_beta2` library allows access to all features of the *Google taskqueue* service. -This documentation was generated from *taskqueue* crate version *0.1.0+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *taskqueue* crate version *0.1.1+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *taskqueue* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). diff --git a/gen/taskqueue1_beta2/src/cmn.rs b/gen/taskqueue1_beta2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/taskqueue1_beta2/src/cmn.rs +++ b/gen/taskqueue1_beta2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/taskqueue1_beta2/src/lib.rs b/gen/taskqueue1_beta2/src/lib.rs index 8872c4e2a59..3d39a433e0e 100644 --- a/gen/taskqueue1_beta2/src/lib.rs +++ b/gen/taskqueue1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *taskqueue* crate version *0.1.0+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *taskqueue* crate version *0.1.1+20141111*, where *20141111* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *taskqueue* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). @@ -303,7 +303,7 @@ impl<'a, C, NC, A> Taskqueue Taskqueue { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -316,7 +316,7 @@ impl<'a, C, NC, A> Taskqueue } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/tasks1/Cargo.toml b/gen/tasks1/Cargo.toml index d4c0b9d0c67..8fed2250d6f 100644 --- a/gen/tasks1/Cargo.toml +++ b/gen/tasks1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tasks1" -version = "0.1.0+20141121" +version = "0.1.1+20141121" authors = ["Sebastian Thiel "] description = "A complete library to interact with tasks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1" diff --git a/gen/tasks1/README.md b/gen/tasks1/README.md index 44065441367..4f14b7f8193 100644 --- a/gen/tasks1/README.md +++ b/gen/tasks1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-tasks1` library allows access to all features of the *Google tasks* service. -This documentation was generated from *tasks* crate version *0.1.0+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *tasks* crate version *0.1.1+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *tasks* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). diff --git a/gen/tasks1/src/cmn.rs b/gen/tasks1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/tasks1/src/cmn.rs +++ b/gen/tasks1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/tasks1/src/lib.rs b/gen/tasks1/src/lib.rs index ad2a51359f9..84203fe1615 100644 --- a/gen/tasks1/src/lib.rs +++ b/gen/tasks1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *tasks* crate version *0.1.0+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *tasks* crate version *0.1.1+20141121*, where *20141121* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *tasks* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). @@ -320,7 +320,7 @@ impl<'a, C, NC, A> TasksHub TasksHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -333,7 +333,7 @@ impl<'a, C, NC, A> TasksHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/translate2/Cargo.toml b/gen/translate2/Cargo.toml index 841e1ac3ce5..f331e234347 100644 --- a/gen/translate2/Cargo.toml +++ b/gen/translate2/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-translate2" -version = "0.1.0+20141123" +version = "0.1.1+20141123" authors = ["Sebastian Thiel "] description = "A complete library to interact with translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2" diff --git a/gen/translate2/README.md b/gen/translate2/README.md index 3906e651408..96419dd071d 100644 --- a/gen/translate2/README.md +++ b/gen/translate2/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-translate2` library allows access to all features of the *Google translate* service. -This documentation was generated from *translate* crate version *0.1.0+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *translate* crate version *0.1.1+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *translate* *v2* API can be found at the [official documentation site](https://developers.google.com/translate/v2/using_rest). diff --git a/gen/translate2/src/cmn.rs b/gen/translate2/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/translate2/src/cmn.rs +++ b/gen/translate2/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index a29693552a4..65b591601a6 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *translate* crate version *0.1.0+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *translate* crate version *0.1.1+20141123*, where *20141123* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *translate* *v2* API can be found at the //! [official documentation site](https://developers.google.com/translate/v2/using_rest). @@ -269,7 +269,7 @@ impl<'a, C, NC, A> Translate Translate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -285,7 +285,7 @@ impl<'a, C, NC, A> Translate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/urlshortener1/Cargo.toml b/gen/urlshortener1/Cargo.toml index a8ee6298aff..d254dd9a7ec 100644 --- a/gen/urlshortener1/Cargo.toml +++ b/gen/urlshortener1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1" -version = "0.1.0+20150219" +version = "0.1.1+20150219" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1" diff --git a/gen/urlshortener1/README.md b/gen/urlshortener1/README.md index c566eb7f2b1..166d0f35d68 100644 --- a/gen/urlshortener1/README.md +++ b/gen/urlshortener1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-urlshortener1` library allows access to all features of the *Google urlshortener* service. -This documentation was generated from *urlshortener* crate version *0.1.0+20150219*, where *20150219* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *urlshortener* crate version *0.1.1+20150219*, where *20150219* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *urlshortener* *v1* API can be found at the [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). diff --git a/gen/urlshortener1/src/cmn.rs b/gen/urlshortener1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/urlshortener1/src/cmn.rs +++ b/gen/urlshortener1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index 8254cd79cf6..4f63943660d 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *urlshortener* crate version *0.1.0+20150219*, where *20150219* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *urlshortener* crate version *0.1.1+20150219*, where *20150219* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *urlshortener* *v1* API can be found at the //! [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). @@ -290,7 +290,7 @@ impl<'a, C, NC, A> Urlshortener Urlshortener { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -300,7 +300,7 @@ impl<'a, C, NC, A> Urlshortener } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/webfonts1/Cargo.toml b/gen/webfonts1/Cargo.toml index ac2d5612f19..d5bbaffb8b1 100644 --- a/gen/webfonts1/Cargo.toml +++ b/gen/webfonts1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webfonts1" -version = "0.1.0+20140210" +version = "0.1.1+20140210" authors = ["Sebastian Thiel "] description = "A complete library to interact with webfonts (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1" diff --git a/gen/webfonts1/README.md b/gen/webfonts1/README.md index b924812b2ed..403847caf72 100644 --- a/gen/webfonts1/README.md +++ b/gen/webfonts1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-webfonts1` library allows access to all features of the *Google webfonts* service. -This documentation was generated from *webfonts* crate version *0.1.0+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *webfonts* crate version *0.1.1+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *webfonts* *v1* API can be found at the [official documentation site](https://developers.google.com/fonts/docs/developer_api). diff --git a/gen/webfonts1/src/cmn.rs b/gen/webfonts1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/webfonts1/src/cmn.rs +++ b/gen/webfonts1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/webfonts1/src/lib.rs b/gen/webfonts1/src/lib.rs index a427d11276a..794bad74c69 100644 --- a/gen/webfonts1/src/lib.rs +++ b/gen/webfonts1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webfonts* crate version *0.1.0+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *webfonts* crate version *0.1.1+20140210*, where *20140210* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *webfonts* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fonts/docs/developer_api). @@ -267,7 +267,7 @@ impl<'a, C, NC, A> Webfonts Webfonts { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -277,7 +277,7 @@ impl<'a, C, NC, A> Webfonts } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index abea6152353..bd09ad736c9 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webmasters3" -version = "0.1.0+20140908" +version = "0.1.1+20140908" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3" diff --git a/gen/webmasters3/README.md b/gen/webmasters3/README.md index 5cfbe2f7062..7916b8a7b14 100644 --- a/gen/webmasters3/README.md +++ b/gen/webmasters3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-webmasters3` library allows access to all features of the *Google webmasters* service. -This documentation was generated from *webmasters* crate version *0.1.0+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *webmasters* crate version *0.1.1+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *webmasters* *v3* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/v3/welcome). diff --git a/gen/webmasters3/src/cmn.rs b/gen/webmasters3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/webmasters3/src/cmn.rs +++ b/gen/webmasters3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index bd8ee3c0163..939019274e3 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webmasters* crate version *0.1.0+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *webmasters* crate version *0.1.1+20140908*, where *20140908* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *webmasters* *v3* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/v3/welcome). @@ -297,7 +297,7 @@ impl<'a, C, NC, A> Webmasters Webmasters { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -316,7 +316,7 @@ impl<'a, C, NC, A> Webmasters } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 3928f52ed1d..4ff08dda336 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-youtube3` library allows access to all features of the *Google YouTube* service. -This documentation was generated from *YouTube* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *YouTube* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *YouTube* *v3* API can be found at the [official documentation site](https://developers.google.com/youtube/v3). diff --git a/gen/youtube3/cargo.toml b/gen/youtube3/cargo.toml index a9db8871fb3..5ec6cad3354 100644 --- a/gen/youtube3/cargo.toml +++ b/gen/youtube3/cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3" -version = "0.1.0+20150309" +version = "0.1.1+20150309" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3" diff --git a/gen/youtube3/src/cmn.rs b/gen/youtube3/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/youtube3/src/cmn.rs +++ b/gen/youtube3/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index 1625c6f5080..41035dc9e1f 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube* crate version *0.1.0+20150309*, where *20150309* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *YouTube* crate version *0.1.1+20150309*, where *20150309* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -370,7 +370,7 @@ impl<'a, C, NC, A> YouTube YouTube { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -428,7 +428,7 @@ impl<'a, C, NC, A> YouTube } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -5872,8 +5872,8 @@ impl<'a, C, NC, A> ChannelBannerInsertCall<'a, C, NC, A> where NC: hyper::net::N mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 6291456 { + return Result::UploadSizeLimitExceeded(size, 6291456) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -5922,8 +5922,8 @@ impl<'a, C, NC, A> ChannelBannerInsertCall<'a, C, NC, A> where NC: hyper::net::N if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 6291456 { + return Result::UploadSizeLimitExceeded(size, 6291456) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -8673,8 +8673,8 @@ impl<'a, C, NC, A> ThumbnailSetCall<'a, C, NC, A> where NC: hyper::net::NetworkC if protocol == "simple" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 2097152 { + return Result::UploadSizeLimitExceeded(size, 2097152) } req = req.header(ContentType(reader_mime_type.clone())) .header(ContentLength(size)) @@ -8714,8 +8714,8 @@ impl<'a, C, NC, A> ThumbnailSetCall<'a, C, NC, A> where NC: hyper::net::NetworkC if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 2097152 { + return Result::UploadSizeLimitExceeded(size, 2097152) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -10441,8 +10441,8 @@ impl<'a, C, NC, A> VideoInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCo mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 68719476736 { + return Result::UploadSizeLimitExceeded(size, 68719476736) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -10491,8 +10491,8 @@ impl<'a, C, NC, A> VideoInsertCall<'a, C, NC, A> where NC: hyper::net::NetworkCo if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 68719476736 { + return Result::UploadSizeLimitExceeded(size, 68719476736) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -15402,8 +15402,8 @@ impl<'a, C, NC, A> WatermarkSetCall<'a, C, NC, A> where NC: hyper::net::NetworkC mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -15452,8 +15452,8 @@ impl<'a, C, NC, A> WatermarkSetCall<'a, C, NC, A> where NC: hyper::net::NetworkC if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 0 { - return Result::UploadSizeLimitExceeded(size, 0) + if size > 10485760 { + return Result::UploadSizeLimitExceeded(size, 10485760) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { diff --git a/gen/youtubeanalytics1/Cargo.toml b/gen/youtubeanalytics1/Cargo.toml index 0bf69200e96..24f0dd8c0c3 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtubeanalytics1" -version = "0.1.0+20150304" +version = "0.1.1+20150304" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1" diff --git a/gen/youtubeanalytics1/README.md b/gen/youtubeanalytics1/README.md index a51e47b7968..694a47a2054 100644 --- a/gen/youtubeanalytics1/README.md +++ b/gen/youtubeanalytics1/README.md @@ -5,7 +5,7 @@ DO NOT EDIT ! --> The `google-youtubeanalytics1` library allows access to all features of the *Google YouTube Analytics* service. -This documentation was generated from *YouTube Analytics* crate version *0.1.0+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +This documentation was generated from *YouTube Analytics* crate version *0.1.1+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. Everything else about the *YouTube Analytics* *v1* API can be found at the [official documentation site](http://developers.google.com/youtube/analytics/). diff --git a/gen/youtubeanalytics1/src/cmn.rs b/gen/youtubeanalytics1/src/cmn.rs index aba4c1f9d12..218bce5ca83 100644 --- a/gen/youtubeanalytics1/src/cmn.rs +++ b/gen/youtubeanalytics1/src/cmn.rs @@ -274,6 +274,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -281,9 +282,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -462,22 +460,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -557,13 +550,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}), diff --git a/gen/youtubeanalytics1/src/lib.rs b/gen/youtubeanalytics1/src/lib.rs index 93a6b994b38..a0e6874d443 100644 --- a/gen/youtubeanalytics1/src/lib.rs +++ b/gen/youtubeanalytics1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube Analytics* crate version *0.1.0+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*. +//! This documentation was generated from *YouTube Analytics* crate version *0.1.1+20150304*, where *20150304* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*. //! //! Everything else about the *YouTube Analytics* *v1* API can be found at the //! [official documentation site](http://developers.google.com/youtube/analytics/). @@ -320,7 +320,7 @@ impl<'a, C, NC, A> YouTubeAnalytics YouTubeAnalytics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/0.1.0".to_string(), + _user_agent: "google-api-rust-client/0.1.1".to_string(), _m: PhantomData } } @@ -342,7 +342,7 @@ impl<'a, C, NC, A> YouTubeAnalytics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/0.1.0`. + /// It defaults to `google-api-rust-client/0.1.1`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/src/mako/lib/mbuild.mako b/src/mako/lib/mbuild.mako index deb44e35e97..eb16a1a94c4 100644 --- a/src/mako/lib/mbuild.mako +++ b/src/mako/lib/mbuild.mako @@ -443,9 +443,11 @@ match result { MULTI_SLASH = 'multi-slash-prefix' URL_ENCODE = 'url-encode' - max_size = size_to_bytes(m.get('maxSize', '0kb')) READER_SEEK = "let size = reader.seek(io::SeekFrom::End(0)).unwrap();\nreader.seek(io::SeekFrom::Start(0)).unwrap();\n" - READER_SEEK += "if size > %i {\n\treturn Result::UploadSizeLimitExceeded(size, %i)\n}" % (max_size, max_size) + if media_params: + max_size = media_params[0].max_size + if max_size > 0: + READER_SEEK += "if size > %i {\n\treturn Result::UploadSizeLimitExceeded(size, %i)\n}" % (max_size, max_size) special_cases = set() for possible_url in possible_urls: diff --git a/src/rust/cmn.rs b/src/rust/cmn.rs index a005d3ca870..91c80a846f8 100644 --- a/src/rust/cmn.rs +++ b/src/rust/cmn.rs @@ -272,6 +272,7 @@ impl<'a> MultiPartReader<'a> { /// Add a new part to the queue of parts to be read on the first `read` call. /// /// # Arguments + /// /// `headers` - identifying the body of the part. It's similar to the header /// in an ordinary single-part call, and should thus contain the /// same information. @@ -279,9 +280,6 @@ impl<'a> MultiPartReader<'a> { /// `size` - the amount of bytes provided by the reader. It will be put onto the header as /// content-size. /// `mime` - It will be put onto the content type - /// # Panics - /// - /// If this method is called after the first `read` call, it will panic pub fn add_part(&mut self, reader: &'a mut Read, size: u64, mime_type: Mime) -> &mut MultiPartReader<'a> { let mut headers = Headers::new(); headers.set(ContentType(mime_type)); @@ -460,22 +458,17 @@ impl Header for RangeResponseHeader { } fn parse_header(raw: &[Vec]) -> Option { - match raw { - [ref v] => { - if let Ok(s) = std::str::from_utf8(v) { - const PREFIX: &'static str = "bytes="; - if s.starts_with(PREFIX) { - let c: Chunk = match FromStr::from_str(&s[PREFIX.len()..]) { - Ok(c) => c, - _ => return None - }; + if let [ref v] = raw { + if let Ok(s) = std::str::from_utf8(v) { + const PREFIX: &'static str = "bytes="; + if s.starts_with(PREFIX) { + if let Ok(c) = ::from_str(&s[PREFIX.len()..]) { return Some(RangeResponseHeader(c)) } } - None - }, - _ => None + } } + None } } @@ -555,13 +548,13 @@ impl<'a, NC, A> ResumableUploadHelper<'a, NC, A> _ => MIN_CHUNK_SIZE }; + self.reader.seek(SeekFrom::Start(start)).unwrap(); loop { let request_size = match self.content_length - start { rs if rs > chunk_size => chunk_size, rs => rs }; - self.reader.seek(SeekFrom::Start(start)).unwrap(); let mut section_reader = self.reader.take(request_size); let range_header = ContentRange { range: Some(Chunk {first: start, last: start + request_size - 1}),