Commit Graph

28 Commits

Author SHA1 Message Date
philippeitis
a8d5b2e6d9 Link hub in resource builder docs 2022-10-14 22:41:36 -07:00
philippeitis
3183af080a Refactor modification of scopes
`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.

Refactor modification of scopes

`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.

Refactor modification of scopes

`add_scope` is simplified to simply add scopes, and no longer takes an `Option<_>` item.
Added `add_scopes` convenience function, which allows adding multiple scopes at once.
Added `clear_scopes` function to explicitly allow clearing method scopes.
2022-10-14 22:04:40 -07:00
philippeitis
24f361749a Use .to_string() directly for reduction in build size
Went from 3,325,128b to 3,287,744b for accessapproval1 by using .to_string() directly, under --release config.
2022-10-10 17:37:16 -07:00
philippeitis
98a02a73a4 Simplify searching for "alt=json" param 2022-10-10 17:14:43 -07:00
philippeitis
d611a319de Fix bug in removing used parameters
The current implementation removes parameters if they are used - however, it only removes the first instance, and removes instances by index. However, when multiple items are being removed, following indices must be decremented by 1 to account for previously removed items.
2022-10-10 17:13:38 -07:00
philippeitis
fa1c5a84ec Use BTreeSet instead of BTreeMap 2022-10-10 17:08:58 -07:00
philippeitis
59874c9c98 Remove indentation 2022-10-10 00:53:24 +00:00
philippeitis
1c04f662d1 Use correct string impls for http headers 2022-10-09 00:04:30 -07:00
philippeitis
f6cced9605 Support serde for arbitrary field types
This introduces the `serde_with` dependency and `rust_type.py`, to allow supporting arbitrary types for serialization.
Since fields may have arbitrary types (eg. `HashMap<_, chrono::Duration>`) which need deserialization, it is necessary to
use type-based serialization to avoid implementing (de)serialization for every permutation of types that require special serialization.
However, `serde` does not let you (de)serialize one type as another (eg. `chrono::Duration` as `Wrapper`) - thus necessitating `serde_with`, which does. `rust_type.py` introduces the `RustType` class, which makes it easy to describe the (de)serialization type used by `serde_with`
2022-10-08 23:01:30 -07:00
philippeitis
8cc2707563 Fix cargo check w.r.t. FieldMask
The serde traits are now directly implemented for FieldMask - this helps address potential serde issues with wrapper types, and simplifies the serde process somewhat.
2022-10-08 19:59:23 -07:00
philippeitis
ddac761e06 Add #[serde(default)] for Option parsing
If using #[serde(with = ...)] with an Option type, serde will expect all marked fields to be present. Adding #[serde(default)] restores expected behaviour - if no Option value is present, None will be used.
2022-10-08 15:50:47 -07:00
philippeitis
afb96bd264 Add FieldMask and serde impl 2022-10-08 03:22:08 -07:00
philippeitis
5398dc6f79 refactor serde functionality into separate module 2022-10-08 00:51:59 -07:00
philippeitis
23dd5d7c24 chrono example types 2022-10-07 21:46:03 -07:00
philippeitis
05df68de32 Use chrono::Duration directly with serde attributes 2022-10-07 20:34:40 -07:00
philippeitis
29aa8df15b Use appropriate types for date-time, duration, bytes 2022-10-07 13:36:03 -07:00
Sebastian Thiel
fe1e97299f Merge branch 'patch-2' 2022-10-01 09:43:31 +08:00
philippeitis
2b5f119242 Change dependency in api.rs 2022-10-01 01:36:23 +00:00
philippeitis
27891b8a10 Use tokio::time::sleep over std:🧵:sleep in api.rs as well 2022-10-01 01:34:56 +00:00
shinichi kogai
cd863136e0 attempt to avoid conflict of common resource name 2022-09-29 12:39:51 +09:00
Sebastian Thiel
8d7309b78c rename google-api-client to google-apis-common 2022-09-25 19:43:56 +08:00
philippeitis
3fc9a077d2 Remove yup-oauth2 from API crates 2022-09-24 21:04:58 -07:00
philippeitis
e6be1edb45 Split out common api client code into separate crate 2022-09-24 20:36:01 -07:00
philippeitis
7c045d7a25 Add yup-oauth2 error to auth error handling 2022-09-24 12:16:58 -07:00
philippeitis
cac4666204 Remove breaking changes, add TODOs 2022-09-24 11:55:55 -07:00
philippeitis
7078038857 Use generic Authy trait in place of yup_oauth2 2022-09-23 00:21:27 -07:00
Kyle Gentle
8ba6acb88b util.py: Make new_context dict-compatible
This is an incremental change towards a strongly-typed util module,
aimed at reducing dependency on the DictObject class. The rough idea is
to annotate everything as Dict, add some tests to codify the existing
behavior, and then start defining dataclasses for the dischovery schema.

We also remove some unused logic & params.
2022-08-18 21:23:55 -04:00
Kyle Gentle
08552c4364 Restructure src dir
Make a few changes in the toplevel src dir to help separate
templates from code. Specifically, we rename `src/mako` to
`src/generator`, and nest the mako templates inside a
`src/generator/templates` dir.

This isolates most Python code into the `src/generator/lib` dir.
2022-08-18 21:23:55 -04:00