That way, crate names reveal exact inforamtion about the contained
API revision.
* crate version: code gen version
* +<revision> (build-metadata): exact version of API schema
Fixes#38
* renamed `*MethodsBuilder` type to `*Methods` type
* renamed `*CallBuilder` type to `*Call` type
* greatly simplified `doit()` signature if uploads are involved
* pass `auth` to upload helper
Layout the `ResumableUploadHelper` and implement the entire logic
with the mbuild renerator.
All that's left to be done is to implement the 'chunked upload' method.
The borrow checker helped me to prevent a bug as well.
* do not emit unused types. Sometimes though, rustc doesn't seem to
detect that attributses are actually used
* ToParts trait is used and implemented only when needed.
Linters are back to 'normal'.
Fixes#35
Now we use the DefaultDelegate as standin in case there is user-delgate.
That way, we save plenty of complexity as no additional
`if let Some(ref mut dlg) = delegate` is necesary.
Fixes#30
With one of the recent changes, the crate name was changed to be
different from the library name. However, there were still plenty of
places that would refer to the library name instead of the new crate
name.
That way, links in the README.md as well as index/index.html still
pointed to the old location.
* add method listing for various categories, like 'downloads' and
'uploads'
* add general information on how to do downloads and uploads using
various protocols
Fixes#28
This also includes documentation to state which methods actually support
media download, and how to achieve that.
Added TODO to not forget we should tell the user how to achieve these
kinds of things.
Fixes#21
* reserve_exact(X) where possible (params, multi-part-reader)
* `if let` used whereever possible to prevent duplicate checks
This increases the possible performance, and makes for more readable,
concise code.
Those were totally real, actually, and I am happy the borrow checker
exists !
Only one weirdness happened with RefCell<BorrowMut<C>>, but it could be
fixed by checking actual types using `let foo: () = something_nasty()`.
* outer frame of `MultiPartReader` to allow using it in `doit()`
* restructured `doit()` to get content-types right
There is more work to do, as it currently doesn't compile, nor
do we deal with our streams correctly.
But we are on a good way.
Now I just add a 'virtual' resource, which is called 'methods'.
The good thing about this is that it works well standalone, or
in conjunction with actual resources.
Also the system works with it just with minimal changes
Fixes#19
Now json errors are handled and delegated with the option to retry,
and all other values are just decoded according to plan.
For now, I brutally unwrap json values assuming this will work, because
it really should work.
Previously, I would just assign all useful traits to all types, no
matter on how they were actually used.
Now it builds all dependnecies and considers them when assigning
traits, which is as precise as we need it.
This is important to us as the `Json` type is just encodable, but
not decodable. Fortunately, we just have to encode it, but in theory
this makes it hard to embed any json in a known structure.
It is a Json object, with a schema as defined elsewhere. It's quite
cool to see this (nearly) working already. However, it will require
us to transitively assign the required markers which is based
on information we don't currently have.
Maybe implementing this could also help to simplify name-clash checks
or make them better at least ?
It was possible for a nested type to be generated with a name that in
fact CLASHED with an existing schema type. What are the odds !
The clash-check added will just verify against clashes with schema
types, which seems to be doing it for now.
It seems we do it better than the actual Go implementation, which fails
to detect that scopes are actually having a string member.
However, there still is an issue, as it's as hashmap for us, but just
a member for go ... lets see ...
https://developers.google.com/discovery/v1/reference/apis#resource
shows that we implement it correctly :) !!
That way, we don't have recursive method builders, but instead
flatten the hierarchy. In our case, this is easier and means
less to type. E.g.
`hub.user().message().import(...)` now is
`hub.user().message_import(...)`
In go it would look like this though
`hub.user.messages.import(...)
which is neater.
We will never have that though, as it will initialize a massive amount
of data right on the stack, even though only some of it is ever used
... .
That way, we make retrieved tokens independent of the order scopes
were passed in. Additionally, we can pass any scopes, just in case
someone uses one token for multiple APIs.
Let's keep it flexible.
... however, it will become an enumeration, as I don't like people
putting in strings all by themselves. This also means we have to
generate good enums ourselves.
It works for uploads as well as for others.
Next up is to setup the head and authentication. It will be as simple
as calling and handling `GetToken`, even though I think that there
needs to be better support for the scope that is asked for ... .
Now query params are handled completely, including clash check.
Additionally, there is a new result type which encapsulates everything.
It must be typed to the actual result type though, which can be a
request result
Custom property annotations have been very useful, to steer very special
cases.
It's also good that now there is enough infrastructure to deal with
any amount of additional type parameters.
With a big but ! The most simple thing to do it was to just add
additional type parameters to the respective method.
Now the type cannot be inferred, which means type-hints must be added.
This should be easy enough, but ... has to be done somehow.