Commit Graph

71 Commits

Author SHA1 Message Date
Björn Weinehall
6ed8df5f96 Extend attempted error message parsing to also cover ErrorResponse
objects. Fixes errors in e.g. drive3 api not getting passed to delegate
error handlers.
2020-05-29 19:43:50 +08:00
Sebastian Thiel
8e9ce08aa2 Fix typo: enocodable -> encodable
Fixes #250
2020-04-14 08:51:19 +08:00
Sebastian Thiel
65b8f0063d Rewrite deprecated features, such as try!
As taken from
https://github.com/Byron/google-apis-rs/pull/247
2020-01-18 14:46:53 +08:00
Sebastian Thiel
f33fae47e9 Add Rust preprocessor to handle code examples gracefully
Fixes #213
2019-07-05 17:00:56 +08:00
Sebastian Thiel
7a44b3eae1 Unconditionally re-export everything in cmn.rs
Related to #218
2019-07-05 10:17:03 +08:00
gheoan
43b953445e docs(mako): fix typo 2018-12-21 13:00:04 +01:00
Guy Taylor
a793af5586 Make utils.method_params private as it is not used.
This removed it been improted into Mako templates and renames it
_method_params to make it clear.
2018-10-28 11:39:29 +01:00
Sebastian Thiel
0360e61c27 Merge branch 'update_url_to_1_7_1' of https://github.com/edelangh/google-apis-rs into edelangh-update_url_to_1_7_1 2018-10-21 12:08:26 +02:00
edelangh
0403e19476 Update dep url to 1.7.1 2018-10-16 23:52:34 +02:00
Sebastian Thiel
255c7f5ad5 Update to latest versions of API declarations 2018-10-13 13:49:14 +02:00
Bryan Burgers
7a041ecf2d docs(LIB): Add dependencies to README
In the section that describes setting up the Cargo.toml, add the
required dependencies, and note that `hyper` and `hyper-rustls` are not
the latest versions. This helps new users get started quicker and
easier.
2018-10-13 11:47:34 +02:00
Cristi Cobzarenco
f835835100 fix(mbuild): strip leading slashes from urls 2017-08-27 09:57:50 +02:00
Sebastian Thiel
a630af5830 First step towards allowing scopes to be deactivated entirely
This is backwards compatible, but allows `add_scope(None)` as well.
Maybe it's better to just add another function, but on the other hand,
this would already do and solves that somewhat more special case.

Related to #172
2017-06-28 09:15:57 +02:00
Sebastian Thiel
4660d23676 fix(docs): Example now uses hyper_rustls
It's already done by the CLI, but the docs still showed
code that would only work in older hyper versions that still
shipped with HTTPS.

Fixes #169
2017-05-26 10:14:39 +02:00
Sebastian Thiel
dd4bfe3de0 fix(lib): more idiomatic swapping of values 2017-05-22 20:57:24 +02:00
Christian Legnitto
9ffa241f37 feat(hub): Allow overriding rootUrl and baseUrl
Allow the hub to override `rootUrl` and `baseUrl` for the service.
This is useful for pointing at localhost for testing or a proxy.
2017-05-06 17:59:05 -07:00
Sebastian Thiel
0337435cd4 imp(serde): upgrade to v0.9
This provides proc macros, greatly simplifying the build
projects.
2017-02-03 08:23:00 +01:00
Sebastian Thiel
cc30a2e20b doc(index): don't use relative links
Instead we link to the absolute location.

tech debt: we now use http://byron.github.io/google-apis-rs
multiple times and thus duplicate that information.
2016-12-24 15:16:59 +01:00
Sebastian Thiel
fc34337ee4 doc(lib): use docs.rs for library documentation
We will still need to host the CLI docs though.
2016-12-24 10:35:48 +01:00
Sebastian Thiel
f3d0ef45d2 fix(license): correct link to license on github
[skip ci]
2016-12-17 17:07:56 +01:00
Sebastian Thiel
73f0e83086 chore(deps): use serde_derive 2016-10-09 15:58:11 +02:00
Sebastian Thiel
b21d96177d Merge pull request #155 from dermesser/parse-empty-correctly
fix(api types): Add an unused field to empty API types.
2016-09-25 19:36:48 +02:00
Lewin Bormann
0f14aa966e fix(api types): Add an unused field to empty API types.
Null structs (struct Foo;) cause the following error when trying to
deserialize an empty JSON object `{}` into them:

`JsonDecodeError("{}\n", Syntax(InvalidType(Map), 1, 1))` (also known as
`invalid type: map at line 1 column 1: {}`). The optional struct member
prevents this error.
2016-09-21 21:52:44 +02:00
Lewin Bormann
292dd2f34f fix(template): URL-encoding '/' in URLs is not accepted by Google APIs. 2016-09-21 09:49:01 +02:00
Sebastian Thiel
3921b6a5a0 fix(dependencies): use working version of serde-codegen
This update fixes the build on stable, and allows builds
on nightly as usual.

The trick is to use the latest version of serde-codegen,
which keeps the syntex version internal, preventing clashes
between libraries that might have different requirements.
2016-07-17 12:05:14 +02:00
Sebastian Thiel
320d769c6f chore(nightly): Travis CI support
Travis should now be able to use nightly as well.
2016-05-20 15:53:49 +02:00
Sebastian Thiel
8d7a49891f chore(dependencies): update to latest version + nightly support
Nightly is now supported, in theory, to allow not to use serde_codegen,
which currently has trouble to build thanks to an assertion error.

Nightly on the other hand suffers from being build with incorrect
feature-flags, which makes quasi_macros fail to build ... .
2016-05-20 15:06:19 +02:00
Sebastian Thiel
065cfdd22f fix(lib): use hyper Bearer header style
Considering we kind-of hardcoded this authentication type anyway,
we now use the Auth-types provided by hyper 0.8.

The incentive here was the compiler telling us that there the
yup-oauth::Scheme type doesn't implement the hyper::authorization::Scheme
anymore, even though that clearly was the case. Also it couldn't be
reproduced in yup-oauth itself.

This will need some work to get correct again, so this is just a crude
patch to make it work again.
2016-04-10 13:01:18 +02:00
Curtis McEnroe
3e1c4428ef Send repeated properties as repeated query parameters 2016-02-07 14:30:29 -05:00
Sebastian Thiel
a2c6b58d5b fix(versionup): use latest oauth2 lib
It enables using std::time::Duration natively
2016-01-30 14:03:15 +01:00
Sebastian Thiel
b54acb7c96 fix(rustup): use std::Thread::sleep
However, in sibling libraries, we still use time::Duration, which
now is a part of std::time::Duration.
These should be adjusted, to make the usage of
sleep(Duration::from_millis(d.num_milliseconds() as u64)) into sleep(d)
2016-01-29 18:56:58 +01:00
Sebastian Thiel
8ab4fd0bd4 fix(serde-up): update to serde 0.5.0
Serde move all json code into a separate crate that we are now using
as well.
2015-08-08 10:55:21 +02:00
Sebastian Thiel
e129a7d3ae fix(hyper-up): compatibility with hyper 0.6.4
* Signature of `client::Response` changed and now requires a
  `hyper::Url` as well.

 Closes #123
2015-07-15 09:50:00 +02:00
Sebastian Thiel
5483e32832 fix(api): expanded header implementation
Now it compiles to the point where `Mime` appears as duplicate type,
for some reason.
2015-06-19 11:34:57 +02:00
Sebastian Thiel
b0a41c4e78 fix(api): first big step towards syntex
Even though there is a bug that caues {} to be used in stead of
(),
when exanding macros, which causes syntax errors that we have to
workaround, it's not a real issue.

What's happening additionally is missing hyper macros, which
now have to be expanded manually. Shouldn't be a problem,
pretty-printing when compiling is made for just that ;).

No, it's sad that `include!()` works so badly, it makes
using serde so difficult ... it's no fun i must say.

Just for stable ... I am not sure if it is worth it."
2015-06-18 22:51:17 +02:00
Sebastian Thiel
2cc4807234 fix(API): URL substitution handling
Previously we would remove the wrong parameters when attempting to
remove only those parameters that have been used in the URL
substitution.

The code we have now is more idiomatic and appears to be removing the
correct parameters.

Closes #114
[skip ci]
2015-05-13 10:11:20 +02:00
Sebastian Thiel
a2dd71451d feat(config): basis for simplified value setting
Previously we would set static structures manully, using complex cases
and utility functions. Now we setup the foundation to allow setting
a generic `json::value::Value` instead, which can later be deserialized
into the target structure.

Related to #111
2015-05-12 11:17:42 +02:00
Sebastian Thiel
15daf311ea refactor(API): use json_tools::IteratorExt
That way, we can invert the flow and produce more idiomatic code.
[skip ci]
2015-05-09 09:57:26 +02:00
Sebastian Thiel
26314e743e imp(API): faster null-value removal
Previously reserialization of token streams with removed null values
was performed on a byte-per-byte basis, which was quite inefficient
to say the least.

Now it uses `io::copy` to copy in chunks of 65kb, which makes out
our throughput and should deliver about 150MB/s at least.
2015-05-08 19:06:38 +02:00
Sebastian Thiel
3efa4f2b12 fix(API): filter null values of requrest structs
Some servers, like youtube, reject null values possibly thanks to
the reliance on parts. Now we are filtering them (in a very inefficient,
but working way), which seems to be fine with the servers.

Effectively, we seem to be able now to upload videos ... .

More testing required !
2015-05-08 12:38:59 +02:00
Sebastian Thiel
b27c990db8 fix(API): simplified call to form_urlencode
It now supports more generic inputs, as suggested in a lenghty
dialog on a corresponding github issue.

Required to build with >=0.2.33
2015-05-05 08:48:25 +02:00
Sebastian Thiel
c346645fc9 fix(API): let delegate forget uploaded urls
When uploading using the resumable protocol, we are now telling the
delegate to forget the previously stored URL after successful upload.
Previously it would have tried to return such a URL and thus made
the system retry uploading a file that was already uploaded.

Fixes #85
[skip ci]
2015-05-01 16:24:31 +02:00
Sebastian Thiel
894b5b5ec7 feat(CLI): adjust to serde usage in yup-oauth
* More detailed error type for JsonTokenStorage
* removed all traces of rustc_serialize
* use pretty-printers everywhere to allow writing human-readable json
  files for secretes and for tokens

Fixes #93
2015-04-30 15:20:56 +02:00
Sebastian Thiel
d46c083975 fix(API): remove unused std_misc feature
Hopefully this will not trigger errors elsewhere, but we will
just find out I guess ;)
2015-04-30 11:18:58 +02:00
Sebastian Thiel
57808cf92a fix(compat): make it work with latest hyper
This is known to work with the master of hyper. It's probably OK
to keep it, preparing for the next release and under the assupmtion
that I will not be releasing binaries for a while.
2015-04-28 10:10:45 +02:00
Sebastian Thiel
6f5c159916 docs(API): request values are moved, not borrowed
[skip ci]
2015-04-26 19:08:35 +02:00
Sebastian Thiel
944e04bd12 docs(CLI): filled README.md
All possible documentation was added in a quality sufficient for
a first release. After all, everything there is is documented.

Fixes #50
2015-04-26 11:22:28 +02:00
Sebastian Thiel
607ba745d1 fix(lib): update changed url crate imports 2015-04-26 10:00:04 +02:00
Sebastian Thiel
b6a48bdcd5 fix(CLI): request value cursor handling and docs
* now the cursor will only be set permanently if the -r flag is used in
  'cursor' mode. In 'cursor=value' mode, the cursor change doesn't
  persist among the flags. That way, one can easily distinguish
  between setting the cursor, and setting a field. However,
  '...sublevel.level=value' will still work as it did previously, yet
  the cursor change will not persist.
* Documentation was adjusted to represent the new cursor style.

Fixes #86
2015-04-26 07:58:59 +02:00
Sebastian Thiel
2f3b2d24ce fix(CLI): simple and resumable upload works
* fixed boundary syntax of multi-part message. Was --BOUNDARY, now is
  --BOUNDARY--
* Fixed ContentRange parsing and serialization. We actually managed
  to break it last time we tried to update it to match the Go
  implementation.
* fixed uploadType header parameter. It's based on chosen protocol and
  whether or not the method supports multipart operation for the given
  protocol.

Related to #76
2015-04-25 18:45:37 +02:00