Commit Graph

110 Commits

Author SHA1 Message Date
Sebastian Thiel
cf258bf4e5 fix(build): fixes to help more projects to build
Involving
* complete list of reserved words (keywords in Rust)
* use namespace for otherwise clashing types in cmn::, io::
2015-03-11 08:16:10 +01:00
Sebastian Thiel
d99ba9c5b3 fix(mako): fix name clashes
Scopes could be invalid, previosly, and the hub type could clash
with other types provided as Schema.

Also, we used reserved identifiers
2015-03-10 18:03:35 +01:00
Sebastian Thiel
df9f0299bf fix(mako): deal with missing auth information
Now all APIs can be built successfully, which should help to
prevent things from getting hardcoded in any way.
2015-03-10 17:10:07 +01:00
Sebastian Thiel
c7e169dff3 fix(util): resource-to-category map
It allows to obtain category, which we previously dropped
2015-03-10 16:23:22 +01:00
Sebastian Thiel
7816cc8145 fix(util): do not degenerate during activity_split
First step, next one will actually be keeping that data ...
2015-03-10 16:10:19 +01:00
Sebastian Thiel
1e332ddb91 fix(libdocs): asssure candidate is in mapping
It seems nearly nothing can be taken for granted ;).
It's best to just run against a big set of APIs and fix issues as they
arise though.

More flexibility means more maintenance, after all.
2015-03-10 15:58:39 +01:00
Sebastian Thiel
92d8fa76d0 fix(apis): intermediate improvements ...
... it shows that the override I used previously won't work for `admin`.
Therefore we have to keep the actual value, instead of degenrating it.

Makes sense ... it's interesting how much one tends to hard-code things
to work just for a few cases, unless you opt in to see the whole picture
2015-03-10 15:54:43 +01:00
Sebastian Thiel
ff5cbb3bf4 fix(api-versions): ignore beta/alpha,assure latest
There were a few bugs in the generator program, which caused old
versions to be picked up, and alphas/betas
2015-03-10 15:12:26 +01:00
Sebastian Thiel
9377220c59 chore(data-merge): api-list is now in separte file
This file is completely generated, and allows us to easily bring in
new versions after each json update.

To make that work, we simple merge all data handed to mako-render,
inside of it. That way, we can put 'api/list' data in any yaml.
2015-03-10 15:00:43 +01:00
Sebastian Thiel
2d036b6623 feat(all-apis): build all apis, were possible
Now there is a blacklist feature, allowing to list apis we can't yet
handle for whichever reason.
2015-03-10 14:34:26 +01:00
Sebastian Thiel
2531011fc5 fix(resource): now with flattened activities
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
... .
2015-03-10 11:55:11 +01:00
Sebastian Thiel
35bd1c3e9c fix(resources): first recursive resource support
However, this also means we need recursive builders, which is tottally
unsupported for now ... .

This means we have to generalize rbuild generation ... could be easy.
Lets see
2015-03-10 11:04:25 +01:00
Sebastian Thiel
3b7e63f286 fix(scope): make scope gen work with gmail 2015-03-10 10:38:04 +01:00
Sebastian Thiel
7b81646f43 chore(make): update-json and all APIs
It's about time we finish up this part, to make it even easier to test
against more APIs, and keep them up-to-date
2015-03-10 10:34:19 +01:00
Sebastian Thiel
874cfb6f68 chore(cargo): cargo calls for any API
That way, it's so much easier to parallelize doc and test generation,
just to be sure it's truly working.
2015-03-10 10:04:47 +01:00
Sebastian Thiel
6d2b0fc264 fix(scope): scopes are sorted Strings now
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.
2015-03-10 09:31:29 +01:00
Sebastian Thiel
28878e0618 fix(Scope): Manual scope parameter ...
... however, it should better be a set, and there must be a way to
control certain global names using the configuration :)
2015-03-10 09:05:03 +01:00
Sebastian Thiel
bb76832b2f feat(lib): new Scope enum type
For use in all places where scopes are desired. It will also be made
available for adding scopes by the user.
2015-03-10 08:35:57 +01:00
Sebastian Thiel
9bcb3f8ba9 docs(params): for additional parameters
Based on the parameters suitable for the entire API. One could also
make them available in the builder ... .
2015-03-10 07:54:58 +01:00
Sebastian Thiel
e1b7a63f06 feat(mbuild): scope as property ...
... 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.
2015-03-10 07:43:49 +01:00
Sebastian Thiel
aabed38581 feat(doit): query string setup
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 ... .
2015-03-09 17:29:44 +01:00
Sebastian Thiel
da300e035e feat(result): generic result type
... and we actually add additional fields to our fields list.
2015-03-09 16:16:13 +01:00
Sebastian Thiel
7c6f7d5e97 feat(params): additional fields and Result type
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
2015-03-09 15:49:53 +01:00
Sebastian Thiel
6c41660943 feat(fields): put all fields onto a list
Also handle the case when the 'part' field is generated from the
request. Additional params still need work
2015-03-09 15:26:04 +01:00
Sebastian Thiel
1423e46210 fix(delegate): it now works in every which way
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.
2015-03-09 11:55:33 +01:00
Sebastian Thiel
432faa275f feat(dev): spike to see how delegate can be work
To avoid an additional type parameter, we will use dynamic dispatch
for the delegate.

Having function overrides at some point seems like an excercise better
left for version 1.1 ;)
2015-03-09 11:18:44 +01:00
Sebastian Thiel
678b6929ca feat(delegate): first attempt to get it to work
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.
2015-03-09 10:44:13 +01:00
Sebastian Thiel
ac35432b3f docs(lib): cross linking of resources/activities
This makes it so much easier to get to the example call you are
interested in.
It's getting there, slowly ;)
2015-03-08 18:58:15 +01:00
Sebastian Thiel
4b12da4a12 docs(mbuild): docs for terms.upload methods
Also fs::File is now used with prefix, to prevent clashes.
2015-03-08 18:10:35 +01:00
Sebastian Thiel
baea071a6f fix(mbuild): added size and mime type support
This information must be provided, I just forgot it
2015-03-08 17:42:41 +01:00
Sebastian Thiel
6fad7600a0 fix(mbuild): doit() call with enum type annotation
It's syntax I never used before, but ... works !
Now lets try to get the BorrowMut back
2015-03-08 15:55:41 +01:00
Sebastian Thiel
5b2d8a77a3 feat(mbuild): media-upload doit() methods
It's just a first step, and even though the generation works well,
I am still missing the right Rust code. Will have to simplify ...
2015-03-08 15:49:28 +01:00
Sebastian Thiel
de0c7a4ae0 feat(mbuild): param() to set any parameter
That way, things like drive.files.insert alt=media has a chance to work.
We should actually check for this to support various 'alt' values
2015-03-08 14:00:02 +01:00
Sebastian Thiel
0d9f6363eb fix(nestedtypes): recursion for nested types
Drive has recursive nested types, which were not handled preeviously.
2015-03-08 12:45:02 +01:00
Sebastian Thiel
66f3ae14e5 feat(drive): added gogole drive API
Just to have another, different set of api information to deal with,
and not accidentally hard-code things to work with youtube only.

Prepared dealing with media uploads, and it turns out to be best to
adjust the 'doit()' to take the respective type parameter.

We also have to think about downloads, like the ones for google drive,
which requires custom query parameters.
2015-03-08 11:38:06 +01:00
Sebastian Thiel
182d0c6fac docs(scopes): scope docs for method builders 2015-03-08 09:48:42 +01:00
Sebastian Thiel
020300af15 feat(type-params): ground work for upload media
This might mean we need additional type parameters, but I will see how
it's going to work out.

In theory, we could define a new trait for Seek+Read, but this would
mean that we couldn't contain owned streams.

For max flexibility, it's better to have additional type parameters
and use BorrowMut to allow ownership, and borrow.
2015-03-08 09:09:18 +01:00
Sebastian Thiel
a7f93a93b6 docs(visuals): fixed spacing
Also, the `do()` implementation was moved into it's own def, even
though it's still quite empty.
2015-03-06 17:15:25 +01:00
Sebastian Thiel
0ff1e07e53 docs(visuals): improved spacing 2015-03-05 17:57:45 +01:00
Sebastian Thiel
4bdee961d1 fix(markup): examples section in mbuilder got lost 2015-03-05 17:54:58 +01:00
Sebastian Thiel
fad0a7177a fix(docs): filter request value props by parts
Previously, it would just show all parts.
It's still not correct though as this isn't necessarily the parts used
in the request value, but only the ones in the response value.

It's as good as it gets though, that's all the information contained
in the json.
2015-03-05 17:47:35 +01:00
Sebastian Thiel
42ae75c1a1 docs(mbuild): added info about settable parts
It's not as good as the parts info on the website, but it's something !
At least people don't have to read the text, but find this information
in all the spots that are relevant to this.
2015-03-05 17:32:26 +01:00
Sebastian Thiel
a2550d1181 refactor(mbuild:usage): into own def
Was rather easy, and shows that plenty of complexity arose from the
usage example.

Implementing the action will probably be quite something ... .
Can't wait to have an auto-generated sample program !
2015-03-05 16:42:16 +01:00
Sebastian Thiel
4e8872b37a docs(mbuild): more information, nicer visuals 2015-03-05 16:28:23 +01:00
Sebastian Thiel
a3206abc92 fix(test): method builder examples work now
It was easier than expected, but in the end needs quite some custom
code and handling. Good to have mako (and python !!!)
2015-03-05 16:10:59 +01:00
Sebastian Thiel
9cbb2adc5a fix(docs): have to handle required/optionals vals
Of course, it's ok to do that, but ... of course it doesn't make things
easier. However, I want these examples to be representing the real thing
2015-03-05 16:03:05 +01:00
Sebastian Thiel
bfa20a18c8 docs(mbuild): method builder call example
With nearly fully randomized examples to show how it can be done.
It's quite nice to see actual calls, using everything required to get
a call. The only thing the user has to manage is to fill in actual
values.

But, it also shows that our builder pattern doesn't work yet due to ...
you guessed it ... lifetime issues :D
2015-03-05 15:42:37 +01:00
Sebastian Thiel
f2dda421e6 fix(docs): remove empty '/// # ' lines
They seem to make cargo fail to build valid doctests. Might be worth
a ticket !
2015-03-05 12:05:02 +01:00
Sebastian Thiel
331ecf87a7 refactor(rbuild): methods useful for mbuild as too
It's vital to be able to traverse parameters easily and consistently :)
2015-03-05 11:27:12 +01:00
Sebastian Thiel
70ea612f19 fix(builders): fixed part handling,it compiles now
What's missing is docs, which will see some work now.
I guess it will be best to hide all the prelude from the user, to allow
him to focus on what's important here.
2015-03-05 11:07:43 +01:00